diff options
Diffstat (limited to 'platform')
42 files changed, 2800 insertions, 2910 deletions
diff --git a/platform/android/jni/mupdf.c b/platform/android/jni/mupdf.c index 21c7bbb5..5e6506be 100644 --- a/platform/android/jni/mupdf.c +++ b/platform/android/jni/mupdf.c @@ -137,7 +137,7 @@ static void drop_page_cache(globals *glo, page_cache *pc) pc->page_list = NULL; fz_drop_display_list(ctx, pc->annot_list); pc->annot_list = NULL; - fz_free_page(doc, pc->page); + fz_free_page(ctx, pc->page); pc->page = NULL; drop_changed_rects(ctx, &pc->changed_rects); drop_changed_rects(ctx, &pc->hq_changed_rects); @@ -180,27 +180,28 @@ static void show_alert(globals *glo, pdf_alert_event *alert) pthread_mutex_unlock(&glo->fin_lock2); } -static void event_cb(pdf_doc_event *event, void *data) +static void event_cb(fz_context *ctx, pdf_document *doc, pdf_doc_event *event, void *data) { globals *glo = (globals *)data; switch (event->type) { case PDF_DOCUMENT_EVENT_ALERT: - show_alert(glo, pdf_access_alert_event(event)); + show_alert(glo, pdf_access_alert_event(ctx, event)); break; } } static void alerts_init(globals *glo) { - pdf_document *idoc = pdf_specifics(glo->doc); + fz_context *ctx = glo->ctx; + pdf_document *idoc = pdf_specifics(ctx, glo->doc); if (!idoc || glo->alerts_initialised) return; if (idoc) - pdf_enable_js(idoc); + pdf_enable_js(ctx, idoc); glo->alerts_active = 0; glo->alert_request = 0; @@ -211,20 +212,21 @@ static void alerts_init(globals *glo) pthread_cond_init(&glo->alert_request_cond, NULL); pthread_cond_init(&glo->alert_reply_cond, NULL); - pdf_set_doc_event_callback(idoc, event_cb, glo); + pdf_set_doc_event_callback(ctx, idoc, event_cb, glo); LOGT("alert_init"); glo->alerts_initialised = 1; } static void alerts_fin(globals *glo) { - pdf_document *idoc = pdf_specifics(glo->doc); + fz_context *ctx = glo->ctx; + pdf_document *idoc = pdf_specifics(ctx, glo->doc); if (!glo->alerts_initialised) return; LOGT("Enter alerts_fin"); if (idoc) - pdf_set_doc_event_callback(idoc, NULL, NULL); + pdf_set_doc_event_callback(ctx, idoc, NULL, NULL); // Set alerts_active false and wake up show_alert and waitForAlertInternal, pthread_mutex_lock(&glo->alert_lock); @@ -330,9 +332,9 @@ JNI_FN(MuPDFCore_openFile)(JNIEnv * env, jobject thiz, jstring jfilename) fz_catch(ctx) { LOGE("Failed: %s", ctx->error->message); - fz_close_document(glo->doc); + fz_drop_document(ctx, glo->doc); glo->doc = NULL; - fz_free_context(ctx); + fz_drop_context(ctx); glo->ctx = NULL; free(glo); glo = NULL; @@ -350,7 +352,7 @@ typedef struct buffer_state_s } buffer_state; -static int bufferStreamNext(fz_stream *stream, int max) +static int bufferStreamNext(fz_context *ctx, fz_stream *stream, int max) { buffer_state *bs = (buffer_state *)stream->state; globals *glo = bs->globals; @@ -382,7 +384,7 @@ static void bufferStreamClose(fz_context *ctx, void *state) fz_free(ctx, state); } -static void bufferStreamSeek(fz_stream *stream, int offset, int whence) +static void bufferStreamSeek(fz_context *ctx, fz_stream *stream, int offset, int whence) { buffer_state *bs = (buffer_state *)stream->state; globals *glo = bs->globals; @@ -459,7 +461,7 @@ JNI_FN(MuPDFCore_openBuffer)(JNIEnv * env, jobject thiz, jstring jmagic) { bs = fz_malloc_struct(ctx, buffer_state); bs->globals = glo; - stream = fz_new_stream(ctx, bs, bufferStreamNext, bufferStreamClose, NULL); + stream = fz_new_stream(ctx, bs, bufferStreamNext, bufferStreamClose); stream->seek = bufferStreamSeek; glo->colorspace = fz_device_rgb(ctx); @@ -479,14 +481,14 @@ JNI_FN(MuPDFCore_openBuffer)(JNIEnv * env, jobject thiz, jstring jmagic) } fz_always(ctx) { - fz_close(stream); + fz_drop_stream(ctx, stream); } fz_catch(ctx) { LOGE("Failed: %s", ctx->error->message); - fz_close_document(glo->doc); + fz_drop_document(ctx, glo->doc); glo->doc = NULL; - fz_free_context(ctx); + fz_drop_context(ctx); glo->ctx = NULL; free(glo); glo = NULL; @@ -506,7 +508,7 @@ JNI_FN(MuPDFCore_countPagesInternal)(JNIEnv *env, jobject thiz) fz_try(ctx) { - count = fz_count_pages(glo->doc); + count = fz_count_pages(ctx, glo->doc); } fz_catch(ctx) { @@ -520,8 +522,9 @@ JNI_FN(MuPDFCore_fileFormatInternal)(JNIEnv * env, jobject thiz) { char info[64]; globals *glo = get_globals(env, thiz); + fz_context *ctx = glo->ctx; - fz_meta(glo->doc, FZ_META_FORMAT_INFO, info, sizeof(info)); + fz_meta(ctx, glo->doc, FZ_META_FORMAT_INFO, info, sizeof(info)); return (*env)->NewStringUTF(env, info); } @@ -533,11 +536,12 @@ JNI_FN(MuPDFCore_isUnencryptedPDFInternal)(JNIEnv * env, jobject thiz) if (glo == NULL) return JNI_FALSE; - pdf_document *idoc = pdf_specifics(glo->doc); + fz_context *ctx = glo->ctx; + pdf_document *idoc = pdf_specifics(ctx, glo->doc); if (idoc == NULL) return JNI_FALSE; // Not a PDF - int cryptVer = pdf_crypt_version(idoc); + int cryptVer = pdf_crypt_version(ctx, idoc); return (cryptVer == 0) ? JNI_TRUE : JNI_FALSE; } @@ -600,9 +604,9 @@ JNI_FN(MuPDFCore_gotoPageInternal)(JNIEnv *env, jobject thiz, int page) { fz_rect rect; LOGI("Load page %d", pc->number); - pc->page = fz_load_page(glo->doc, pc->number); + pc->page = fz_load_page(ctx, glo->doc, pc->number); zoom = glo->resolution / 72; - fz_bound_page(glo->doc, pc->page, &pc->media_box); + fz_bound_page(ctx, pc->page, &pc->media_box); fz_scale(&ctm, zoom, zoom); rect = pc->media_box; fz_round_rect(&bbox, fz_transform_rect(&rect, &ctm)); @@ -635,25 +639,27 @@ JNIEXPORT jboolean JNICALL JNI_FN(MuPDFCore_javascriptSupported)(JNIEnv *env, jobject thiz) { globals *glo = get_globals(env, thiz); - pdf_document *idoc = pdf_specifics(glo->doc); - return pdf_js_supported(idoc); + fz_context *ctx = glo->ctx; + pdf_document *idoc = pdf_specifics(ctx, glo->doc); + return pdf_js_supported(ctx, idoc); } static void update_changed_rects(globals *glo, page_cache *pc, pdf_document *idoc) { + fz_context *ctx = glo->ctx; fz_annot *annot; - pdf_update_page(idoc, (pdf_page *)pc->page); - while ((annot = (fz_annot *)pdf_poll_changed_annot(idoc, (pdf_page *)pc->page)) != NULL) + pdf_update_page(ctx, idoc, (pdf_page *)pc->page); + while ((annot = (fz_annot *)pdf_poll_changed_annot(ctx, idoc, (pdf_page *)pc->page)) != NULL) { /* FIXME: We bound the annot twice here */ rect_node *node = fz_malloc_struct(glo->ctx, rect_node); - fz_bound_annot(glo->doc, annot, &node->rect); + fz_bound_annot(ctx, pc->page, annot, &node->rect); node->next = pc->changed_rects; pc->changed_rects = node; node = fz_malloc_struct(glo->ctx, rect_node); - fz_bound_annot(glo->doc, annot, &node->rect); + fz_bound_annot(ctx, pc->page, annot, &node->rect); node->next = pc->hq_changed_rects; pc->hq_changed_rects = node; } @@ -712,7 +718,7 @@ JNI_FN(MuPDFCore_drawPage)(JNIEnv *env, jobject thiz, jobject bitmap, fz_try(ctx) { fz_irect pixbbox; - pdf_document *idoc = pdf_specifics(doc); + pdf_document *idoc = pdf_specifics(ctx, doc); if (idoc) { @@ -729,8 +735,8 @@ JNI_FN(MuPDFCore_drawPage)(JNIEnv *env, jobject thiz, jobject bitmap, /* Render to list */ pc->page_list = fz_new_display_list(ctx); dev = fz_new_list_device(ctx, pc->page_list); - fz_run_page_contents(doc, pc->page, dev, &fz_identity, cookie); - fz_free_device(dev); + fz_run_page_contents(ctx, pc->page, dev, &fz_identity, cookie); + fz_drop_device(ctx, dev); dev = NULL; if (cookie != NULL && cookie->abort) { @@ -744,9 +750,9 @@ JNI_FN(MuPDFCore_drawPage)(JNIEnv *env, jobject thiz, jobject bitmap, fz_annot *annot; pc->annot_list = fz_new_display_list(ctx); dev = fz_new_list_device(ctx, pc->annot_list); - for (annot = fz_first_annot(doc, pc->page); annot; annot = fz_next_annot(doc, annot)) - fz_run_annot(doc, pc->page, annot, dev, &fz_identity, cookie); - fz_free_device(dev); + for (annot = fz_first_annot(ctx, pc->page); annot; annot = fz_next_annot(ctx, pc->page, annot)) + fz_run_annot(ctx, pc->page, annot, dev, &fz_identity, cookie); + fz_drop_device(ctx, dev); dev = NULL; if (cookie != NULL && cookie->abort) { @@ -793,12 +799,12 @@ JNI_FN(MuPDFCore_drawPage)(JNIEnv *env, jobject thiz, jobject bitmap, for (i=0; i<100;i++) { #endif if (pc->page_list) - fz_run_display_list(pc->page_list, dev, &ctm, &rect, cookie); + fz_run_display_list(ctx, pc->page_list, dev, &ctm, &rect, cookie); if (cookie != NULL && cookie->abort) fz_throw(ctx, FZ_ERROR_GENERIC, "Render aborted"); if (pc->annot_list) - fz_run_display_list(pc->annot_list, dev, &ctm, &rect, cookie); + fz_run_display_list(ctx, pc->annot_list, dev, &ctm, &rect, cookie); if (cookie != NULL && cookie->abort) fz_throw(ctx, FZ_ERROR_GENERIC, "Render aborted"); @@ -808,14 +814,14 @@ JNI_FN(MuPDFCore_drawPage)(JNIEnv *env, jobject thiz, jobject bitmap, LOGI("100 renders in %d (%d per sec)", time, CLOCKS_PER_SEC); } #endif - fz_free_device(dev); + fz_drop_device(ctx, dev); dev = NULL; fz_drop_pixmap(ctx, pix); LOGI("Rendered"); } fz_always(ctx) { - fz_free_device(dev); + fz_drop_device(ctx, dev); dev = NULL; } fz_catch(ctx) @@ -884,7 +890,7 @@ JNI_FN(MuPDFCore_updatePageInternal)(JNIEnv *env, jobject thiz, jobject bitmap, return JNI_FN(MuPDFCore_drawPage)(env, thiz, bitmap, pageW, pageH, patchX, patchY, patchW, patchH, (jlong)(intptr_t)cookie); } - idoc = pdf_specifics(doc); + idoc = pdf_specifics(ctx, doc); fz_var(pix); fz_var(dev); @@ -927,8 +933,8 @@ JNI_FN(MuPDFCore_updatePageInternal)(JNIEnv *env, jobject thiz, jobject bitmap, /* Render to list */ pc->page_list = fz_new_display_list(ctx); dev = fz_new_list_device(ctx, pc->page_list); - fz_run_page_contents(doc, pc->page, dev, &fz_identity, cookie); - fz_free_device(dev); + fz_run_page_contents(ctx, pc->page, dev, &fz_identity, cookie); + fz_drop_device(ctx, dev); dev = NULL; if (cookie != NULL && cookie->abort) { @@ -941,9 +947,9 @@ JNI_FN(MuPDFCore_updatePageInternal)(JNIEnv *env, jobject thiz, jobject bitmap, if (pc->annot_list == NULL) { pc->annot_list = fz_new_display_list(ctx); dev = fz_new_list_device(ctx, pc->annot_list); - for (annot = fz_first_annot(doc, pc->page); annot; annot = fz_next_annot(doc, annot)) - fz_run_annot(doc, pc->page, annot, dev, &fz_identity, cookie); - fz_free_device(dev); + for (annot = fz_first_annot(ctx, pc->page); annot; annot = fz_next_annot(ctx, pc->page, annot)) + fz_run_annot(ctx, pc->page, annot, dev, &fz_identity, cookie); + fz_drop_device(ctx, dev); dev = NULL; if (cookie != NULL && cookie->abort) { @@ -990,16 +996,16 @@ JNI_FN(MuPDFCore_updatePageInternal)(JNIEnv *env, jobject thiz, jobject bitmap, fz_clear_pixmap_rect_with_value(ctx, pix, 0xff, &abox); dev = fz_new_draw_device_with_bbox(ctx, pix, &abox); if (pc->page_list) - fz_run_display_list(pc->page_list, dev, &ctm, &arect, cookie); + fz_run_display_list(ctx, pc->page_list, dev, &ctm, &arect, cookie); if (cookie != NULL && cookie->abort) fz_throw(ctx, FZ_ERROR_GENERIC, "Render aborted"); if (pc->annot_list) - fz_run_display_list(pc->annot_list, dev, &ctm, &arect, cookie); + fz_run_display_list(ctx, pc->annot_list, dev, &ctm, &arect, cookie); if (cookie != NULL && cookie->abort) fz_throw(ctx, FZ_ERROR_GENERIC, "Render aborted"); - fz_free_device(dev); + fz_drop_device(ctx, dev); dev = NULL; } } @@ -1012,7 +1018,7 @@ JNI_FN(MuPDFCore_updatePageInternal)(JNIEnv *env, jobject thiz, jobject bitmap, } fz_always(ctx) { - fz_free_device(dev); + fz_drop_device(ctx, dev); dev = NULL; } fz_catch(ctx) @@ -1027,17 +1033,17 @@ JNI_FN(MuPDFCore_updatePageInternal)(JNIEnv *env, jobject thiz, jobject bitmap, } static int -charat(fz_text_page *page, int idx) +charat(fz_context *ctx, fz_text_page *page, int idx) { fz_char_and_box cab; - return fz_text_char_at(&cab, page, idx)->c; + return fz_text_char_at(ctx, &cab, page, idx)->c; } static fz_rect -bboxcharat(fz_text_page *page, int idx) +bboxcharat(fz_context *ctx, fz_text_page *page, int idx) { fz_char_and_box cab; - return fz_text_char_at(&cab, page, idx)->bbox; + return fz_text_char_at(ctx, &cab, page, idx)->bbox; } static int @@ -1120,8 +1126,9 @@ JNIEXPORT jboolean JNICALL JNI_FN(MuPDFCore_needsPasswordInternal)(JNIEnv * env, jobject thiz) { globals *glo = get_globals(env, thiz); + fz_context *ctx = glo->ctx; - return fz_needs_password(glo->doc) ? JNI_TRUE : JNI_FALSE; + return fz_needs_password(ctx, glo->doc) ? JNI_TRUE : JNI_FALSE; } JNIEXPORT jboolean JNICALL @@ -1130,12 +1137,13 @@ JNI_FN(MuPDFCore_authenticatePasswordInternal)(JNIEnv *env, jobject thiz, jstrin const char *pw; int result; globals *glo = get_globals(env, thiz); + fz_context *ctx = glo->ctx; pw = (*env)->GetStringUTFChars(env, password, NULL); if (pw == NULL) return JNI_FALSE; - result = fz_authenticate_password(glo->doc, (char *)pw); + result = fz_authenticate_password(ctx, glo->doc, (char *)pw); (*env)->ReleaseStringUTFChars(env, password, pw); return result; } @@ -1144,9 +1152,10 @@ JNIEXPORT jboolean JNICALL JNI_FN(MuPDFCore_hasOutlineInternal)(JNIEnv * env, jobject thiz) { globals *glo = get_globals(env, thiz); - fz_outline *outline = fz_load_outline(glo->doc); + fz_context *ctx = glo->ctx; + fz_outline *outline = fz_load_outline(ctx, glo->doc); - fz_free_outline(glo->ctx, outline); + fz_drop_outline(glo->ctx, outline); return (outline == NULL) ? JNI_FALSE : JNI_TRUE; } @@ -1160,6 +1169,7 @@ JNI_FN(MuPDFCore_getOutlineInternal)(JNIEnv * env, jobject thiz) fz_outline *outline; int nItems; globals *glo = get_globals(env, thiz); + fz_context *ctx = glo->ctx; jobjectArray ret; olClass = (*env)->FindClass(env, PACKAGENAME "/OutlineItem"); @@ -1167,7 +1177,7 @@ JNI_FN(MuPDFCore_getOutlineInternal)(JNIEnv * env, jobject thiz) ctor = (*env)->GetMethodID(env, olClass, "<init>", "(ILjava/lang/String;I)V"); if (ctor == NULL) return NULL; - outline = fz_load_outline(glo->doc); + outline = fz_load_outline(ctx, glo->doc); nItems = countOutlineItems(outline); arr = (*env)->NewObjectArray(env, @@ -1179,7 +1189,7 @@ JNI_FN(MuPDFCore_getOutlineInternal)(JNIEnv * env, jobject thiz) ret = fillInOutlineItems(env, olClass, ctor, arr, 0, outline, 0) > 0 ? arr :NULL; - fz_free_outline(glo->ctx, outline); + fz_drop_outline(glo->ctx, outline); return ret; } @@ -1226,17 +1236,17 @@ JNI_FN(MuPDFCore_searchPage)(JNIEnv * env, jobject thiz, jstring jtext) sheet = fz_new_text_sheet(ctx); text = fz_new_text_page(ctx); dev = fz_new_text_device(ctx, sheet, text); - fz_run_page(doc, pc->page, dev, &ctm, NULL); - fz_free_device(dev); + fz_run_page(ctx, pc->page, dev, &ctm, NULL); + fz_drop_device(ctx, dev); dev = NULL; hit_count = fz_search_text_page(ctx, text, str, glo->hit_bbox, MAX_SEARCH_HITS); } fz_always(ctx) { - fz_free_text_page(ctx, text); - fz_free_text_sheet(ctx, sheet); - fz_free_device(dev); + fz_drop_text_page(ctx, text); + fz_drop_text_sheet(ctx, sheet); + fz_drop_device(ctx, dev); } fz_catch(ctx) { @@ -1316,8 +1326,8 @@ JNI_FN(MuPDFCore_text)(JNIEnv * env, jobject thiz) sheet = fz_new_text_sheet(ctx); text = fz_new_text_page(ctx); dev = fz_new_text_device(ctx, sheet, text); - fz_run_page(doc, pc->page, dev, &ctm, NULL); - fz_free_device(dev); + fz_run_page(ctx, pc->page, dev, &ctm, NULL); + fz_drop_device(ctx, dev); dev = NULL; barr = (*env)->NewObjectArray(env, text->len, textBlockClass, NULL); @@ -1356,7 +1366,7 @@ JNI_FN(MuPDFCore_text)(JNIEnv * env, jobject thiz) { fz_text_char *ch = &span->text[c]; fz_rect bbox; - fz_text_char_bbox(&bbox, span, c); + fz_text_char_bbox(ctx, &bbox, span, c); jobject cobj = (*env)->NewObject(env, textCharClass, ctor, bbox.x0, bbox.y0, bbox.x1, bbox.y1, ch->c); if (cobj == NULL) fz_throw(ctx, FZ_ERROR_GENERIC, "NewObjectfailed"); @@ -1378,9 +1388,9 @@ JNI_FN(MuPDFCore_text)(JNIEnv * env, jobject thiz) } fz_always(ctx) { - fz_free_text_page(ctx, text); - fz_free_text_sheet(ctx, sheet); - fz_free_device(dev); + fz_drop_text_page(ctx, text); + fz_drop_text_sheet(ctx, sheet); + fz_drop_device(ctx, dev); } fz_catch(ctx) { @@ -1424,31 +1434,31 @@ JNI_FN(MuPDFCore_textAsHtml)(JNIEnv * env, jobject thiz) sheet = fz_new_text_sheet(ctx); text = fz_new_text_page(ctx); dev = fz_new_text_device(ctx, sheet, text); - fz_run_page(doc, pc->page, dev, &ctm, NULL); - fz_free_device(dev); + fz_run_page(ctx, pc->page, dev, &ctm, NULL); + fz_drop_device(ctx, dev); dev = NULL; fz_analyze_text(ctx, sheet, text); buf = fz_new_buffer(ctx, 256); out = fz_new_output_with_buffer(ctx, buf); - fz_printf(out, "<html>\n"); - fz_printf(out, "<style>\n"); - fz_printf(out, "body{margin:0;}\n"); - fz_printf(out, "div.page{background-color:white;}\n"); - fz_printf(out, "div.block{margin:0pt;padding:0pt;}\n"); - fz_printf(out, "div.metaline{display:table;width:100%%}\n"); - fz_printf(out, "div.line{display:table-row;}\n"); - fz_printf(out, "div.cell{display:table-cell;padding-left:0.25em;padding-right:0.25em}\n"); - //fz_printf(out, "p{margin:0;padding:0;}\n"); - fz_printf(out, "</style>\n"); - fz_printf(out, "<body style=\"margin:0\"><div style=\"padding:10px\" id=\"content\">"); + fz_printf(ctx, out, "<html>\n"); + fz_printf(ctx, out, "<style>\n"); + fz_printf(ctx, out, "body{margin:0;}\n"); + fz_printf(ctx, out, "div.page{background-color:white;}\n"); + fz_printf(ctx, out, "div.block{margin:0pt;padding:0pt;}\n"); + fz_printf(ctx, out, "div.metaline{display:table;width:100%%}\n"); + fz_printf(ctx, out, "div.line{display:table-row;}\n"); + fz_printf(ctx, out, "div.cell{display:table-cell;padding-left:0.25em;padding-right:0.25em}\n"); + //fz_printf(ctx, out, "p{margin:0;padding:0;}\n"); + fz_printf(ctx, out, "</style>\n"); + fz_printf(ctx, out, "<body style=\"margin:0\"><div style=\"padding:10px\" id=\"content\">"); fz_print_text_page_html(ctx, out, text); - fz_printf(out, "</div></body>\n"); - fz_printf(out, "<style>\n"); + fz_printf(ctx, out, "</div></body>\n"); + fz_printf(ctx, out, "<style>\n"); fz_print_text_sheet(ctx, out, sheet); - fz_printf(out, "</style>\n</html>\n"); - fz_close_output(out); + fz_printf(ctx, out, "</style>\n</html>\n"); + fz_drop_output(ctx, out); out = NULL; bArray = (*env)->NewByteArray(env, buf->len); @@ -1459,10 +1469,10 @@ JNI_FN(MuPDFCore_textAsHtml)(JNIEnv * env, jobject thiz) } fz_always(ctx) { - fz_free_text_page(ctx, text); - fz_free_text_sheet(ctx, sheet); - fz_free_device(dev); - fz_close_output(out); + fz_drop_text_page(ctx, text); + fz_drop_text_sheet(ctx, sheet); + fz_drop_device(ctx, dev); + fz_drop_output(ctx, out); fz_drop_buffer(ctx, buf); } fz_catch(ctx) @@ -1484,7 +1494,7 @@ JNI_FN(MuPDFCore_addMarkupAnnotationInternal)(JNIEnv * env, jobject thiz, jobjec globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; fz_document *doc = glo->doc; - pdf_document *idoc = pdf_specifics(doc); + pdf_document *idoc = pdf_specifics(ctx, doc); page_cache *pc = &glo->pages[glo->current]; jclass pt_cls; jfieldID x_fid, y_fid; @@ -1556,10 +1566,10 @@ JNI_FN(MuPDFCore_addMarkupAnnotationInternal)(JNIEnv * env, jobject thiz, jobjec fz_transform_point(&pts[i], &ctm); } - annot = (fz_annot *)pdf_create_annot(idoc, (pdf_page *)pc->page, type); + annot = (fz_annot *)pdf_create_annot(ctx, idoc, (pdf_page *)pc->page, type); - pdf_set_markup_annot_quadpoints(idoc, (pdf_annot *)annot, pts, n); - pdf_set_markup_appearance(idoc, (pdf_annot *)annot, color, alpha, line_thickness, line_height); + pdf_set_markup_annot_quadpoints(ctx, idoc, (pdf_annot *)annot, pts, n); + pdf_set_markup_appearance(ctx, idoc, (pdf_annot *)annot, color, alpha, line_thickness, line_height); dump_annotation_display_lists(glo); } @@ -1583,7 +1593,7 @@ JNI_FN(MuPDFCore_addInkAnnotationInternal)(JNIEnv * env, jobject thiz, jobjectAr globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; fz_document *doc = glo->doc; - pdf_document *idoc = pdf_specifics(doc); + pdf_document *idoc = pdf_specifics(ctx, doc); page_cache *pc = &glo->pages[glo->current]; jclass pt_cls; jfieldID x_fid, y_fid; @@ -1651,9 +1661,9 @@ JNI_FN(MuPDFCore_addInkAnnotationInternal)(JNIEnv * env, jobject thiz, jobjectAr (*env)->DeleteLocalRef(env, arc); } - annot = (fz_annot *)pdf_create_annot(idoc, (pdf_page *)pc->page, FZ_ANNOT_INK); + annot = (fz_annot *)pdf_create_annot(ctx, idoc, (pdf_page *)pc->page, FZ_ANNOT_INK); - pdf_set_ink_annot_list(idoc, (pdf_annot *)annot, pts, counts, n, color, INK_THICKNESS); + pdf_set_ink_annot_list(ctx, idoc, (pdf_annot *)annot, pts, counts, n, color, INK_THICKNESS); dump_annotation_display_lists(glo); } @@ -1678,7 +1688,7 @@ JNI_FN(MuPDFCore_deleteAnnotationInternal)(JNIEnv * env, jobject thiz, int annot globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; fz_document *doc = glo->doc; - pdf_document *idoc = pdf_specifics(doc); + pdf_document *idoc = pdf_specifics(ctx, doc); page_cache *pc = &glo->pages[glo->current]; fz_annot *annot; int i; @@ -1688,13 +1698,13 @@ JNI_FN(MuPDFCore_deleteAnnotationInternal)(JNIEnv * env, jobject thiz, int annot fz_try(ctx) { - annot = fz_first_annot(glo->doc, pc->page); + annot = fz_first_annot(ctx, pc->page); for (i = 0; i < annot_index && annot; i++) - annot = fz_next_annot(glo->doc, annot); + annot = fz_next_annot(ctx, pc->page, annot); if (annot) { - pdf_delete_annot(idoc, (pdf_page *)pc->page, (pdf_annot *)annot); + pdf_delete_annot(ctx, idoc, (pdf_page *)pc->page, (pdf_annot *)annot); dump_annotation_display_lists(glo); } } @@ -1718,7 +1728,7 @@ static void close_doc(globals *glo) alerts_fin(glo); - fz_close_document(glo->doc); + fz_drop_document(glo->ctx, glo->doc); glo->doc = NULL; } @@ -1733,7 +1743,7 @@ JNI_FN(MuPDFCore_destroying)(JNIEnv * env, jobject thiz) fz_free(glo->ctx, glo->current_path); glo->current_path = NULL; close_doc(glo); - fz_free_context(glo->ctx); + fz_drop_context(glo->ctx); glo->ctx = NULL; free(glo); #ifdef MEMENTO @@ -1795,7 +1805,7 @@ JNI_FN(MuPDFCore_getPageLinksInternal)(JNIEnv * env, jobject thiz, int pageNumbe zoom = glo->resolution / 72; fz_scale(&ctm, zoom, zoom); - list = fz_load_links(glo->doc, pc->page); + list = fz_load_links(glo->ctx, pc->page); count = 0; for (link = list; link; link = link->next) { @@ -1883,6 +1893,7 @@ JNI_FN(MuPDFCore_getWidgetAreasInternal)(JNIEnv * env, jobject thiz, int pageNum globals *glo = get_globals(env, thiz); if (glo == NULL) return NULL; + fz_context *ctx = glo->ctx; rectFClass = (*env)->FindClass(env, "android/graphics/RectF"); if (rectFClass == NULL) return NULL; @@ -1894,7 +1905,7 @@ JNI_FN(MuPDFCore_getWidgetAreasInternal)(JNIEnv * env, jobject thiz, int pageNum if (pc->number != pageNumber || pc->page == NULL) return NULL; - idoc = pdf_specifics(glo->doc); + idoc = pdf_specifics(ctx, glo->doc); if (idoc == NULL) return NULL; @@ -1902,17 +1913,17 @@ JNI_FN(MuPDFCore_getWidgetAreasInternal)(JNIEnv * env, jobject thiz, int pageNum fz_scale(&ctm, zoom, zoom); count = 0; - for (widget = pdf_first_widget(idoc, (pdf_page *)pc->page); widget; widget = pdf_next_widget(widget)) + for (widget = pdf_first_widget(ctx, idoc, (pdf_page *)pc->page); widget; widget = pdf_next_widget(ctx, widget)) count ++; arr = (*env)->NewObjectArray(env, count, rectFClass, NULL); if (arr == NULL) return NULL; count = 0; - for (widget = pdf_first_widget(idoc, (pdf_page *)pc->page); widget; widget = pdf_next_widget(widget)) + for (widget = pdf_first_widget(ctx, idoc, (pdf_page *)pc->page); widget; widget = pdf_next_widget(ctx, widget)) { fz_rect rect; - pdf_bound_widget(widget, &rect); + pdf_bound_widget(ctx, widget, &rect); fz_transform_rect(&rect, &ctm); rectF = (*env)->NewObject(env, rectFClass, ctor, @@ -1942,6 +1953,7 @@ JNI_FN(MuPDFCore_getAnnotationsInternal)(JNIEnv * env, jobject thiz, int pageNum globals *glo = get_globals(env, thiz); if (glo == NULL) return NULL; + fz_context *ctx = glo->ctx; annotClass = (*env)->FindClass(env, PACKAGENAME "/Annotation"); if (annotClass == NULL) return NULL; @@ -1957,18 +1969,18 @@ JNI_FN(MuPDFCore_getAnnotationsInternal)(JNIEnv * env, jobject thiz, int pageNum fz_scale(&ctm, zoom, zoom); count = 0; - for (annot = fz_first_annot(glo->doc, pc->page); annot; annot = fz_next_annot(glo->doc, annot)) + for (annot = fz_first_annot(ctx, pc->page); annot; annot = fz_next_annot(ctx, pc->page, annot)) count ++; arr = (*env)->NewObjectArray(env, count, annotClass, NULL); if (arr == NULL) return NULL; count = 0; - for (annot = fz_first_annot(glo->doc, pc->page); annot; annot = fz_next_annot(glo->doc, annot)) + for (annot = fz_first_annot(ctx, pc->page); annot; annot = fz_next_annot(ctx, pc->page, annot)) { fz_rect rect; - fz_annot_type type = pdf_annot_type((pdf_annot *)annot); - fz_bound_annot(glo->doc, annot, &rect); + fz_annot_type type = pdf_annot_type(ctx, (pdf_annot *)annot); + fz_bound_annot(ctx, pc->page, annot, &rect); fz_transform_rect(&rect, &ctm); jannot = (*env)->NewObject(env, annotClass, ctor, @@ -1989,7 +2001,7 @@ JNI_FN(MuPDFCore_passClickEventInternal)(JNIEnv * env, jobject thiz, int pageNum globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; fz_matrix ctm; - pdf_document *idoc = pdf_specifics(glo->doc); + pdf_document *idoc = pdf_specifics(ctx, glo->doc); float zoom; fz_point p; pdf_ui_event event; @@ -2021,9 +2033,9 @@ JNI_FN(MuPDFCore_passClickEventInternal)(JNIEnv * env, jobject thiz, int pageNum event.etype = PDF_EVENT_TYPE_POINTER; event.event.pointer.pt = p; event.event.pointer.ptype = PDF_POINTER_DOWN; - changed = pdf_pass_event(idoc, (pdf_page *)pc->page, &event); + changed = pdf_pass_event(ctx, idoc, (pdf_page *)pc->page, &event); event.event.pointer.ptype = PDF_POINTER_UP; - changed |= pdf_pass_event(idoc, (pdf_page *)pc->page, &event); + changed |= pdf_pass_event(ctx, idoc, (pdf_page *)pc->page, &event); if (changed) { dump_annotation_display_lists(glo); } @@ -2045,14 +2057,14 @@ JNI_FN(MuPDFCore_getFocusedWidgetTextInternal)(JNIEnv * env, jobject thiz) fz_try(ctx) { - pdf_document *idoc = pdf_specifics(glo->doc); + pdf_document *idoc = pdf_specifics(ctx, glo->doc); if (idoc) { - pdf_widget *focus = pdf_focused_widget(idoc); + pdf_widget *focus = pdf_focused_widget(ctx, idoc); if (focus) - text = pdf_text_widget_text(idoc, focus); + text = pdf_text_widget_text(ctx, idoc, focus); } } fz_catch(ctx) @@ -2080,15 +2092,15 @@ JNI_FN(MuPDFCore_setFocusedWidgetTextInternal)(JNIEnv * env, jobject thiz, jstri fz_try(ctx) { - pdf_document *idoc = pdf_specifics(glo->doc); + pdf_document *idoc = pdf_specifics(ctx, glo->doc); if (idoc) { - pdf_widget *focus = pdf_focused_widget(idoc); + pdf_widget *focus = pdf_focused_widget(ctx, idoc); if (focus) { - result = pdf_text_widget_set_text(idoc, focus, (char *)text); + result = pdf_text_widget_set_text(ctx, idoc, focus, (char *)text); dump_annotation_display_lists(glo); } } @@ -2108,7 +2120,7 @@ JNI_FN(MuPDFCore_getFocusedWidgetChoiceOptions)(JNIEnv * env, jobject thiz) { globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; - pdf_document *idoc = pdf_specifics(glo->doc); + pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; int type; int nopts, i; @@ -2119,20 +2131,20 @@ JNI_FN(MuPDFCore_getFocusedWidgetChoiceOptions)(JNIEnv * env, jobject thiz) if (idoc == NULL) return NULL; - focus = pdf_focused_widget(idoc); + focus = pdf_focused_widget(ctx, idoc); if (focus == NULL) return NULL; - type = pdf_widget_get_type(focus); + type = pdf_widget_get_type(ctx, focus); if (type != PDF_WIDGET_TYPE_LISTBOX && type != PDF_WIDGET_TYPE_COMBOBOX) return NULL; fz_var(opts); fz_try(ctx) { - nopts = pdf_choice_widget_options(idoc, focus, NULL); + nopts = pdf_choice_widget_options(ctx, idoc, focus, NULL); opts = fz_malloc(ctx, nopts * sizeof(*opts)); - (void)pdf_choice_widget_options(idoc, focus, opts); + (void)pdf_choice_widget_options(ctx, idoc, focus, opts); } fz_catch(ctx) { @@ -2164,7 +2176,7 @@ JNI_FN(MuPDFCore_getFocusedWidgetChoiceSelected)(JNIEnv * env, jobject thiz) { globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; - pdf_document *idoc = pdf_specifics(glo->doc); + pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; int type; int nsel, i; @@ -2175,20 +2187,20 @@ JNI_FN(MuPDFCore_getFocusedWidgetChoiceSelected)(JNIEnv * env, jobject thiz) if (idoc == NULL) return NULL; - focus = pdf_focused_widget(idoc); + focus = pdf_focused_widget(ctx, idoc); if (focus == NULL) return NULL; - type = pdf_widget_get_type(focus); + type = pdf_widget_get_type(ctx, focus); if (type != PDF_WIDGET_TYPE_LISTBOX && type != PDF_WIDGET_TYPE_COMBOBOX) return NULL; fz_var(sel); fz_try(ctx) { - nsel = pdf_choice_widget_value(idoc, focus, NULL); + nsel = pdf_choice_widget_value(ctx, idoc, focus, NULL); sel = fz_malloc(ctx, nsel * sizeof(*sel)); - (void)pdf_choice_widget_value(idoc, focus, sel); + (void)pdf_choice_widget_value(ctx, idoc, focus, sel); } fz_catch(ctx) { @@ -2220,7 +2232,7 @@ JNI_FN(MuPDFCore_setFocusedWidgetChoiceSelectedInternal)(JNIEnv * env, jobject t { globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; - pdf_document *idoc = pdf_specifics(glo->doc); + pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; int type; int nsel, i; @@ -2230,11 +2242,11 @@ JNI_FN(MuPDFCore_setFocusedWidgetChoiceSelectedInternal)(JNIEnv * env, jobject t if (idoc == NULL) return; - focus = pdf_focused_widget(idoc); + focus = pdf_focused_widget(ctx, idoc); if (focus == NULL) return; - type = pdf_widget_get_type(focus); + type = pdf_widget_get_type(ctx, focus); if (type != PDF_WIDGET_TYPE_LISTBOX && type != PDF_WIDGET_TYPE_COMBOBOX) return; @@ -2258,7 +2270,7 @@ JNI_FN(MuPDFCore_setFocusedWidgetChoiceSelectedInternal)(JNIEnv * env, jobject t fz_try(ctx) { - pdf_choice_widget_set_value(idoc, focus, nsel, sel); + pdf_choice_widget_set_value(ctx, idoc, focus, nsel, sel); dump_annotation_display_lists(glo); } fz_catch(ctx) @@ -2277,18 +2289,19 @@ JNIEXPORT int JNICALL JNI_FN(MuPDFCore_getFocusedWidgetTypeInternal)(JNIEnv * env, jobject thiz) { globals *glo = get_globals(env, thiz); - pdf_document *idoc = pdf_specifics(glo->doc); + fz_context *ctx = glo->ctx; + pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; - if (idoc == NULL) + if (ctx, idoc == NULL) return NONE; - focus = pdf_focused_widget(idoc); + focus = pdf_focused_widget(ctx, idoc); if (focus == NULL) return NONE; - switch (pdf_widget_get_type(focus)) + switch (pdf_widget_get_type(ctx, focus)) { case PDF_WIDGET_TYPE_TEXT: return TEXT; case PDF_WIDGET_TYPE_LISTBOX: return LISTBOX; @@ -2311,13 +2324,14 @@ JNIEXPORT int JNICALL JNI_FN(MuPDFCore_getFocusedWidgetSignatureState)(JNIEnv * env, jobject thiz) { globals *glo = get_globals(env, thiz); - pdf_document *idoc = pdf_specifics(glo->doc); + fz_context *ctx = glo->ctx; + pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; - if (idoc == NULL) + if (ctx, idoc == NULL) return Signature_NoSupport; - focus = pdf_focused_widget(idoc); + focus = pdf_focused_widget(ctx, idoc); if (focus == NULL) return Signature_NoSupport; @@ -2325,26 +2339,27 @@ JNI_FN(MuPDFCore_getFocusedWidgetSignatureState)(JNIEnv * env, jobject thiz) if (!pdf_signatures_supported()) return Signature_NoSupport; - return pdf_dict_gets(((pdf_annot *)focus)->obj, "V") ? Signature_Signed : Signature_Unsigned; + return pdf_dict_gets(ctx, ((pdf_annot *)focus)->obj, "V") ? Signature_Signed : Signature_Unsigned; } JNIEXPORT jstring JNICALL JNI_FN(MuPDFCore_checkFocusedSignatureInternal)(JNIEnv * env, jobject thiz) { globals *glo = get_globals(env, thiz); - pdf_document *idoc = pdf_specifics(glo->doc); + fz_context *ctx = glo->ctx; + pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; char ebuf[256] = "Failed"; if (idoc == NULL) goto exit; - focus = pdf_focused_widget(idoc); + focus = pdf_focused_widget(ctx, idoc); if (focus == NULL) goto exit; - if (pdf_check_signature(idoc, focus, glo->current_path, ebuf, sizeof(ebuf))) + if (pdf_check_signature(ctx, idoc, focus, glo->current_path, ebuf, sizeof(ebuf))) { strcpy(ebuf, "Signature is valid"); } @@ -2358,7 +2373,7 @@ JNI_FN(MuPDFCore_signFocusedSignatureInternal)(JNIEnv * env, jobject thiz, jstri { globals *glo = get_globals(env, thiz); fz_context *ctx = glo->ctx; - pdf_document *idoc = pdf_specifics(glo->doc); + pdf_document *idoc = pdf_specifics(ctx, glo->doc); pdf_widget *focus; const char *keyfile; const char *password; @@ -2367,7 +2382,7 @@ JNI_FN(MuPDFCore_signFocusedSignatureInternal)(JNIEnv * env, jobject thiz, jstri if (idoc == NULL) return JNI_FALSE; - focus = pdf_focused_widget(idoc); + focus = pdf_focused_widget(ctx, idoc); if (focus == NULL) return JNI_FALSE; @@ -2380,7 +2395,7 @@ JNI_FN(MuPDFCore_signFocusedSignatureInternal)(JNIEnv * env, jobject thiz, jstri fz_var(res); fz_try(ctx) { - pdf_sign_signature(idoc, focus, keyfile, password); + pdf_sign_signature(ctx, idoc, focus, keyfile, password); dump_annotation_display_lists(glo); res = JNI_TRUE; } @@ -2521,9 +2536,10 @@ JNIEXPORT jboolean JNICALL JNI_FN(MuPDFCore_hasChangesInternal)(JNIEnv * env, jobject thiz) { globals *glo = get_globals(env, thiz); - pdf_document *idoc = pdf_specifics(glo->doc); + fz_context *ctx = glo->ctx; + pdf_document *idoc = pdf_specifics(ctx, glo->doc); - return (idoc && pdf_has_unsaved_changes(idoc)) ? JNI_TRUE : JNI_FALSE; + return (idoc && pdf_has_unsaved_changes(ctx, idoc)) ? JNI_TRUE : JNI_FALSE; } static char *tmp_path(char *path) @@ -2593,7 +2609,7 @@ JNI_FN(MuPDFCore_saveInternal)(JNIEnv * env, jobject thiz) if (!err) { - fz_write_document(glo->doc, tmp, &opts); + fz_write_document(ctx, glo->doc, tmp, &opts); written = 1; } } diff --git a/platform/android/src/com/artifex/mupdfdemo/ReaderView.java b/platform/android/src/com/artifex/mupdfdemo/ReaderView.java index e27f0bbf..07eb6824 100644 --- a/platform/android/src/com/artifex/mupdfdemo/ReaderView.java +++ b/platform/android/src/com/artifex/mupdfdemo/ReaderView.java @@ -408,7 +408,7 @@ public class ReaderView } break; case MOVING_DOWN: - if (HORIZONTAL_SCROLLING && bounds.bottom <= 0) { + if (!HORIZONTAL_SCROLLING && bounds.bottom <= 0) { // Fling off to the bottom bring previous view onto screen View vr = mChildViews.get(mCurrent-1); diff --git a/platform/ios/Classes/MuDocRef.m b/platform/ios/Classes/MuDocRef.m index bd2b87c0..44337dc0 100644 --- a/platform/ios/Classes/MuDocRef.m +++ b/platform/ios/Classes/MuDocRef.m @@ -33,7 +33,7 @@ if (self) { if (doc != NULL) - fz_close_document(doc); + fz_drop_document(doc); [self release]; self = nil; } @@ -46,7 +46,7 @@ { __block fz_document *block_doc = doc; dispatch_async(queue, ^{ - fz_close_document(block_doc); + fz_drop_document(block_doc); }); [super dealloc]; } diff --git a/platform/ios/Classes/MuDocumentController.m b/platform/ios/Classes/MuDocumentController.m index 3c0391a8..01d8221c 100644 --- a/platform/ios/Classes/MuDocumentController.m +++ b/platform/ios/Classes/MuDocumentController.m @@ -183,7 +183,7 @@ static void saveDoc(char *current_path, fz_document *doc) outline = [[MuOutlineController alloc] initWithTarget: self titles: titles pages: pages]; [titles release]; [pages release]; - fz_free_outline(ctx, root); + fz_drop_outline(ctx, root); } return self; diff --git a/platform/ios/Classes/MuPageViewNormal.m b/platform/ios/Classes/MuPageViewNormal.m index 3c461a00..5e115ea0 100644 --- a/platform/ios/Classes/MuPageViewNormal.m +++ b/platform/ios/Classes/MuPageViewNormal.m @@ -78,7 +78,7 @@ static NSArray *enumerateWords(fz_document *doc, fz_page *page) text = fz_new_text_page(ctx); dev = fz_new_text_device(ctx, sheet, text); fz_run_page(doc, page, dev, &fz_identity, NULL); - fz_free_device(dev); + fz_drop_device(dev); dev = NULL; for (b = 0; b < text->len; b++) @@ -138,9 +138,9 @@ static NSArray *enumerateWords(fz_document *doc, fz_page *page) } fz_always(ctx); { - fz_free_text_page(ctx, text); - fz_free_text_sheet(ctx, sheet); - fz_free_device(dev); + fz_drop_text_page(ctx, text); + fz_drop_text_sheet(ctx, sheet); + fz_drop_device(dev); } fz_catch(ctx) { @@ -383,7 +383,7 @@ static fz_display_list *create_page_list(fz_document *doc, fz_page *page) } fz_always(ctx) { - fz_free_device(dev); + fz_drop_device(dev); } fz_catch(ctx) { @@ -413,7 +413,7 @@ static fz_display_list *create_annot_list(fz_document *doc, fz_page *page) } fz_always(ctx) { - fz_free_device(dev); + fz_drop_device(dev); } fz_catch(ctx) { @@ -461,7 +461,7 @@ static fz_pixmap *renderPixmap(fz_document *doc, fz_display_list *page_list, fz_ } fz_always(ctx) { - fz_free_device(dev); + fz_drop_device(dev); } fz_catch(ctx) { @@ -563,7 +563,7 @@ static void updatePixmap(fz_document *doc, fz_display_list *page_list, fz_displa dev = fz_new_draw_device_with_bbox(ctx, pixmap, &abox); fz_run_display_list(page_list, dev, &ctm, &arect, NULL); fz_run_display_list(annot_list, dev, &ctm, &arect, NULL); - fz_free_device(dev); + fz_drop_device(dev); dev = NULL; } rlist = rlist->next; @@ -571,7 +571,7 @@ static void updatePixmap(fz_document *doc, fz_display_list *page_list, fz_displa } fz_always(ctx) { - fz_free_device(dev); + fz_drop_device(dev); } fz_catch(ctx) { diff --git a/platform/ios/Classes/MuPageViewReflow.m b/platform/ios/Classes/MuPageViewReflow.m index bc0e2c79..a9716df5 100644 --- a/platform/ios/Classes/MuPageViewReflow.m +++ b/platform/ios/Classes/MuPageViewReflow.m @@ -27,7 +27,7 @@ NSString *textAsHtml(fz_document *doc, int pageNum) dev = fz_new_text_device(ctx, sheet, text); page = fz_load_page(doc, pageNum); fz_run_page(doc, page, dev, &ctm, NULL); - fz_free_device(dev); + fz_drop_device(dev); dev = NULL; fz_analyze_text(ctx, sheet, text); @@ -57,9 +57,9 @@ NSString *textAsHtml(fz_document *doc, int pageNum) } fz_always(ctx) { - fz_free_text_page(ctx, text); - fz_free_text_sheet(ctx, sheet); - fz_free_device(dev); + fz_drop_text_page(ctx, text); + fz_drop_text_sheet(ctx, sheet); + fz_drop_device(dev); fz_close_output(out); fz_drop_buffer(ctx, buf); fz_free_page(doc, page); diff --git a/platform/ios/Classes/MuPrintPageRenderer.m b/platform/ios/Classes/MuPrintPageRenderer.m index 36f66ee9..9408a6e3 100644 --- a/platform/ios/Classes/MuPrintPageRenderer.m +++ b/platform/ios/Classes/MuPrintPageRenderer.m @@ -114,7 +114,7 @@ static void renderPage(fz_document *doc, fz_page *page, fz_pixmap *pix, fz_matri } fz_always(ctx) { - fz_free_device(dev); + fz_drop_device(dev); } fz_catch(ctx) { diff --git a/platform/ios/common.m b/platform/ios/common.m index f4a1676d..6ca320e9 100644 --- a/platform/ios/common.m +++ b/platform/ios/common.m @@ -25,12 +25,12 @@ int search_page(fz_document *doc, int number, char *needle, fz_cookie *cookie) fz_text_page *text = fz_new_text_page(ctx); fz_device *dev = fz_new_text_device(ctx, sheet, text); fz_run_page(doc, page, dev, &fz_identity, cookie); - fz_free_device(dev); + fz_drop_device(dev); hit_count = fz_search_text_page(ctx, text, needle, hit_bbox, nelem(hit_bbox)); - fz_free_text_page(ctx, text); - fz_free_text_sheet(ctx, sheet); + fz_drop_text_page(ctx, text); + fz_drop_text_sheet(ctx, sheet); fz_free_page(doc, page); return hit_count; diff --git a/platform/win32/generate.bat b/platform/win32/generate.bat index 934dec4b..f47e2c56 100644 --- a/platform/win32/generate.bat +++ b/platform/win32/generate.bat @@ -15,7 +15,6 @@ if not exist cquote.exe goto usage if not exist bin2hex.exe goto usage if not exist generated/gen_font_base14.h fontdump.exe generated/gen_font_base14.h resources/fonts/urw/*.cff -if not exist generated/gen_font_droid.h fontdump.exe generated/gen_font_droid.h resources/fonts/droid/DroidSans.ttf resources/fonts/droid/DroidSansMono.ttf if not exist generated/gen_font_cjk.h fontdump.exe generated/gen_font_cjk.h resources/fonts/droid/DroidSansFallback.ttc if not exist generated/gen_font_cjk_full.h fontdump.exe generated/gen_font_cjk_full.h resources/fonts/droid/DroidSansFallbackFull.ttc diff --git a/platform/win32/libmupdf.vcproj b/platform/win32/libmupdf.vcproj index 438be2b1..2ef2d5c9 100644 --- a/platform/win32/libmupdf.vcproj +++ b/platform/win32/libmupdf.vcproj @@ -337,6 +337,14 @@ RelativePath="..\..\source\cbz\mucbz.c" > </File> + <File + RelativePath="..\..\source\cbz\muimg.c" + > + </File> + <File + RelativePath="..\..\source\cbz\mutiff.c" + > + </File> </Filter> <Filter Name="xps" @@ -723,14 +731,6 @@ </File> </Filter> <Filter - Name="img" - > - <File - RelativePath="..\..\source\img\muimage.c" - > - </File> - </Filter> - <Filter Name="pdf" > <File @@ -938,18 +938,10 @@ Name="!include" > <File - RelativePath="..\..\include\mupdf\cbz.h" - > - </File> - <File RelativePath="..\..\include\mupdf\fitz.h" > </File> <File - RelativePath="..\..\include\mupdf\img.h" - > - </File> - <File RelativePath="..\..\include\mupdf\memento.h" > </File> @@ -1202,14 +1194,6 @@ </File> </Filter> </Filter> - <Filter - Name="tiff" - > - <File - RelativePath="..\..\source\tiff\mutiff.c" - > - </File> - </Filter> </Files> <Globals> </Globals> diff --git a/platform/windows/gsprint.vcxproj b/platform/windows/gsprint.vcxproj new file mode 100644 index 00000000..c191599d --- /dev/null +++ b/platform/windows/gsprint.vcxproj @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{09FE8E75-9952-44E7-95F8-E8D74707FBA1}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>gsprint</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v120</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(SolutionDir)\gsview\bin\$(Configuration)\</OutDir> + <IntDir>$(Platform)\$(Configuration)\</IntDir> + <TargetName>$(ProjectName)32</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(SolutionDir)\gsview\bin\$(Configuration)\</OutDir> + <TargetName>$(ProjectName)64</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + <TargetName>$(ProjectName)32</TargetName> + <OutDir>$(SolutionDir)\gsview\bin\$(Configuration)\</OutDir> + <IntDir>$(Platform)\$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(SolutionDir)\gsview\bin\$(Configuration)\</OutDir> + <TargetName>$(ProjectName)64</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GSPRINT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GSPRINT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GSPRINT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GSPRINT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <Text Include="ReadMe.txt" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="gsprint\gsprint.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="gsprint\dllmain.cpp" /> + <ClCompile Include="gsprint\gsprint.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/platform/windows/gsprint/dllmain.cpp b/platform/windows/gsprint/dllmain.cpp new file mode 100644 index 00000000..bfaa6519 --- /dev/null +++ b/platform/windows/gsprint/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include <windows.h> + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/platform/windows/gsprint/gsprint.cpp b/platform/windows/gsprint/gsprint.cpp new file mode 100644 index 00000000..4f4a3924 --- /dev/null +++ b/platform/windows/gsprint/gsprint.cpp @@ -0,0 +1,73 @@ +// gsprint.cpp : Defines the exported functions for the DLL application. +// +#include "gsprint.h" +#include "stdlib.h" + +#define FAIL -1 + +/* Code to handle the special device properties window as well as make sure + * that the values are maintained when we leave */ +SYMBOL_DECLSPEC int __stdcall ShowPropertiesDialog(void *hptr, void *printername, bool show_win) +{ + HWND hWnd = (HWND)hptr; + HANDLE hPrinter = NULL; + LPDEVMODE pDevMode; + DWORD dwNeeded, dwRet; + wchar_t *output = NULL; + + int lenA = lstrlenA((char*)printername); + int lenW = ::MultiByteToWideChar(CP_ACP, 0, (char*)printername, lenA, NULL, 0); + if (lenW > 0) + { + output = new wchar_t[lenW + 1]; + if (output == NULL) + return -1; + ::MultiByteToWideChar(CP_ACP, 0, (char*)printername, lenA, output, lenW); + output[lenW] = 0; + } + else + return FAIL; + + if (!OpenPrinter(output, &hPrinter, NULL)) + { + delete[] output; + return FAIL; + } + + /* First get the size needed */ + dwNeeded = DocumentProperties(hWnd, hPrinter, output, NULL, NULL, 0); + pDevMode = (LPDEVMODE)malloc(dwNeeded); + if (pDevMode == NULL) + { + delete[] output; + ClosePrinter(hPrinter); + return FAIL; + } + + /* Now actually get the DEVMODE data. DM_IN_PROMPT brings up the window. + * DM_OUT_BUFFER ensures that we get the values that have been set */ + DWORD fMode = DM_OUT_BUFFER; + if (show_win) + fMode = fMode | DM_IN_PROMPT; + + dwRet = DocumentProperties(hWnd, hPrinter, output, pDevMode, NULL, fMode); + if (dwRet != IDOK) + { + delete[] output; + ClosePrinter(hPrinter); + free(pDevMode); + return FAIL; + } + + /* This is the secret to ensure that the DEVMODE settings are saved. Fun + * finding this bit of information in the MS literature */ + PRINTER_INFO_9 new_info; + new_info.pDevMode = pDevMode; + SetPrinter(hPrinter, 9, (LPBYTE)&new_info, 0); + + /* Clean up */ + free(pDevMode); + delete[] output; + ClosePrinter(hPrinter); + return 0; +} diff --git a/platform/windows/gsprint/gsprint.h b/platform/windows/gsprint/gsprint.h new file mode 100644 index 00000000..cfc2c7b3 --- /dev/null +++ b/platform/windows/gsprint/gsprint.h @@ -0,0 +1,12 @@ +#include <windows.h> +#include <winspool.h> + +#ifdef __cplusplus +#define EXTERNC extern "C" +#else +#define EXTERNC +#endif + +#define SYMBOL_DECLSPEC __declspec(dllexport) + +EXTERN_C SYMBOL_DECLSPEC int __stdcall ShowPropertiesDialog(void *ctx, void *printername, bool show_win); diff --git a/platform/windows/gsview/Install32/Install32.vdproj b/platform/windows/gsview/Install32/Install32.vdproj deleted file mode 100644 index 4fecfe14..00000000 --- a/platform/windows/gsview/Install32/Install32.vdproj +++ /dev/null @@ -1,1225 +0,0 @@ -"DeployProject" -{ -"VSVersion" = "3:800" -"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" -"IsWebType" = "8:FALSE" -"ProjectName" = "8:Install32" -"LanguageId" = "3:1033" -"CodePage" = "3:1252" -"UILanguageId" = "3:1033" -"SccProjectName" = "8:" -"SccLocalPath" = "8:" -"SccAuxPath" = "8:" -"SccProvider" = "8:" - "Hierarchy" - { - "Entry" - { - "MsmKey" = "8:_016DC0AD4FFB4399B8519ACA84400E23" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_14D6D6CD543648468701A0FE8D5A2463" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1F1881EE52A84F49A62D42DE7E4D9D24" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_200E66532F6140579FA9390D6F7CC178" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_2684CEAF38794D53AF9D906A7F8D677C" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_389C02C6991141428A41BC2459A55E76" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_4826B6F3283A4770935083729B0777B2" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_4879181DB5BD4512A8A1790BC22435A0" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_791D64A55F0847788638D3FCDD1802DD" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_87036B53E422457DBCA496540B818802" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_A62B07FE876C4ACBBE7DEF7A219A570E" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_B2090A11BD04495DACDA72D4E5D72B7E" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_4879181DB5BD4512A8A1790BC22435A0" - "MsmSig" = "8:_UNDEFINED" - } - } - "Configurations" - { - "Debug" - { - "DisplayName" = "8:Debug" - "IsDebugOnly" = "11:TRUE" - "IsReleaseOnly" = "11:FALSE" - "OutputFilename" = "8:Debug\\Install32.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" - { - "Enabled" = "11:TRUE" - "PromptEnabled" = "11:TRUE" - "PrerequisitesLocation" = "2:1" - "Url" = "8:" - "ComponentsUrl" = "8:" - } - } - "Release" - { - "DisplayName" = "8:Release" - "IsDebugOnly" = "11:FALSE" - "IsReleaseOnly" = "11:TRUE" - "OutputFilename" = "8:Release\\Install32.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" - { - "Enabled" = "11:TRUE" - "PromptEnabled" = "11:TRUE" - "PrerequisitesLocation" = "2:1" - "Url" = "8:" - "ComponentsUrl" = "8:" - "Items" - { - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.5" - { - "Name" = "8:Microsoft .NET Framework 4.5 (x86 and x64)" - "ProductCode" = "8:.NETFramework,Version=v4.5" - } - } - } - } - } - "Deployable" - { - "CustomAction" - { - } - "DefaultFeature" - { - "Name" = "8:DefaultFeature" - "Title" = "8:" - "Description" = "8:" - } - "ExternalPersistence" - { - "LaunchCondition" - { - "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_3D4E37C6DF874A34821259A8B423B24C" - { - "Name" = "8:.NET Framework" - "Message" = "8:[VSDNETMSG]" - "FrameworkVersion" = "8:.NETFramework,Version=v4.5" - "AllowLaterVersions" = "11:FALSE" - "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=395269" - } - } - } - "File" - { - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_016DC0AD4FFB4399B8519ACA84400E23" - { - "SourcePath" = "8:..\\Resources\\pagePNG.ico" - "TargetName" = "8:pagePNG.ico" - "Tag" = "8:" - "Folder" = "8:_F28BDA152FBB403EAF109B8E144140A8" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_14D6D6CD543648468701A0FE8D5A2463" - { - "SourcePath" = "8:..\\Resources\\pageCBZ.ico" - "TargetName" = "8:pageCBZ.ico" - "Tag" = "8:" - "Folder" = "8:_F28BDA152FBB403EAF109B8E144140A8" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1F1881EE52A84F49A62D42DE7E4D9D24" - { - "SourcePath" = "8:..\\Resources\\pageEPS.ico" - "TargetName" = "8:pageEPS.ico" - "Tag" = "8:" - "Folder" = "8:_F28BDA152FBB403EAF109B8E144140A8" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_200E66532F6140579FA9390D6F7CC178" - { - "SourcePath" = "8:..\\Resources\\pagePDF.ico" - "TargetName" = "8:pagePDF.ico" - "Tag" = "8:" - "Folder" = "8:_F28BDA152FBB403EAF109B8E144140A8" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_2684CEAF38794D53AF9D906A7F8D677C" - { - "SourcePath" = "8:..\\Resources\\pagePS.ico" - "TargetName" = "8:pagePS.ico" - "Tag" = "8:" - "Folder" = "8:_F28BDA152FBB403EAF109B8E144140A8" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_389C02C6991141428A41BC2459A55E76" - { - "SourcePath" = "8:..\\Resources\\pageOXPS.ico" - "TargetName" = "8:pageOXPS.ico" - "Tag" = "8:" - "Folder" = "8:_F28BDA152FBB403EAF109B8E144140A8" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_4826B6F3283A4770935083729B0777B2" - { - "SourcePath" = "8:..\\Resources\\pageJPG.ico" - "TargetName" = "8:pageJPG.ico" - "Tag" = "8:" - "Folder" = "8:_F28BDA152FBB403EAF109B8E144140A8" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_4879181DB5BD4512A8A1790BC22435A0" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:gsview, Version=6.0.0.0, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - } - "SourcePath" = "8:..\\bin\\Release\\gsview.exe" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_F115E751BD3842299C96BA6F8A5B0F40" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_791D64A55F0847788638D3FCDD1802DD" - { - "SourcePath" = "8:..\\Resources\\pageXPS.ico" - "TargetName" = "8:pageXPS.ico" - "Tag" = "8:" - "Folder" = "8:_F28BDA152FBB403EAF109B8E144140A8" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_87036B53E422457DBCA496540B818802" - { - "SourcePath" = "8:..\\bin\\Release\\mupdfnet32.dll" - "TargetName" = "8:mupdfnet32.dll" - "Tag" = "8:" - "Folder" = "8:_F115E751BD3842299C96BA6F8A5B0F40" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_A62B07FE876C4ACBBE7DEF7A219A570E" - { - "SourcePath" = "8:..\\gsview.visualelementsmanifest.xml" - "TargetName" = "8:gsview.visualelementsmanifest.xml" - "Tag" = "8:" - "Folder" = "8:_F115E751BD3842299C96BA6F8A5B0F40" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B2090A11BD04495DACDA72D4E5D72B7E" - { - "SourcePath" = "8:..\\gslib\\gsdll32.dll" - "TargetName" = "8:gsdll32.dll" - "Tag" = "8:" - "Folder" = "8:_F115E751BD3842299C96BA6F8A5B0F40" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - } - "FileType" - { - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_12B01738B600492AA1C8D89AD0821413" - { - "Name" = "8:CDisplay ZIP Archived Comic Book file" - "Description" = "8:CDisplay ZIP Archived Comic Book file" - "Extensions" = "8:cbz" - "MIME" = "8:" - "Icon" = "8:_14D6D6CD543648468701A0FE8D5A2463" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_4879181DB5BD4512A8A1790BC22435A0" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_33B319EC439B40E38BD09902607AFE0B" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_13D929725BF0460F823C23414FB2F0A1" - { - "Name" = "8:Open XPS Document" - "Description" = "8:Open XPS Document" - "Extensions" = "8:oxps" - "MIME" = "8:" - "Icon" = "8:_389C02C6991141428A41BC2459A55E76" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_4879181DB5BD4512A8A1790BC22435A0" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_02319B3587ED4701B20BE6C84D578514" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_65F612197D8D450C8AC251D615131D21" - { - "Name" = "8:PostScript File" - "Description" = "8:PostScript File" - "Extensions" = "8:ps" - "MIME" = "8:" - "Icon" = "8:_2684CEAF38794D53AF9D906A7F8D677C" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_4879181DB5BD4512A8A1790BC22435A0" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_1CC8050B2F6146E6A1F7C71C12ACB66E" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_69F979C4C92C4C348E8001B157A92FED" - { - "Name" = "8:EPS File" - "Description" = "8:EPS File" - "Extensions" = "8:eps" - "MIME" = "8:" - "Icon" = "8:_1F1881EE52A84F49A62D42DE7E4D9D24" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_4879181DB5BD4512A8A1790BC22435A0" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_EA00D9AD05ED40BE82A6F8CF37AA21EE" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_A5691CEB907F4D66A3FE718B4FF65E8D" - { - "Name" = "8:PNG image" - "Description" = "8:PNG image" - "Extensions" = "8:png" - "MIME" = "8:" - "Icon" = "8:_016DC0AD4FFB4399B8519ACA84400E23" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_4879181DB5BD4512A8A1790BC22435A0" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_95A3859E50134298ACEA0E1EACA47513" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_CD91C7FED2C94607AC5CFB7F6571A963" - { - "Name" = "8:XPS Document" - "Description" = "8:XPS Document" - "Extensions" = "8:xps" - "MIME" = "8:" - "Icon" = "8:_791D64A55F0847788638D3FCDD1802DD" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_4879181DB5BD4512A8A1790BC22435A0" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_C39CD59228F345E48878777D30252120" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_EA8DCA7319A3441EA0A8F07F20C7EC71" - { - "Name" = "8:JPEG image" - "Description" = "8:JPEG image" - "Extensions" = "8:jpeg" - "MIME" = "8:" - "Icon" = "8:_4826B6F3283A4770935083729B0777B2" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_4879181DB5BD4512A8A1790BC22435A0" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_90799BABA05F49D6AB9D093411DD157E" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_EA91006930CC4A349642A7F0AD319AA4" - { - "Name" = "8:PDF" - "Description" = "8:PDF" - "Extensions" = "8:pdf" - "MIME" = "8:" - "Icon" = "8:_200E66532F6140579FA9390D6F7CC178" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_4879181DB5BD4512A8A1790BC22435A0" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_D9041E3AC16C43E4AF1822F9103B24D6" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - } - "Folder" - { - "{1525181F-901A-416C-8A58-119130FE478E}:_05287FF94E284ACF9E55AD5BF0AF82E6" - { - "Name" = "8:#1919" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:ProgramMenuFolder" - "Folders" - { - "{9EF0B969-E518-4E46-987F-47570745A589}:_8ADA7142ADE14DFFA878A5107FE5C304" - { - "Name" = "8:Artifex Software" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:_AF85737E4DAA4E318495768F54D7F0AF" - "Folders" - { - } - } - } - } - "{1525181F-901A-416C-8A58-119130FE478E}:_74B5607A82364A9E8F63FA435CF2C5FA" - { - "Name" = "8:#1916" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:DesktopFolder" - "Folders" - { - } - } - "{3C67513D-01DD-4637-8A68-80971EB9504F}:_F115E751BD3842299C96BA6F8A5B0F40" - { - "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" - "Name" = "8:#1925" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:TARGETDIR" - "Folders" - { - "{9EF0B969-E518-4E46-987F-47570745A589}:_F28BDA152FBB403EAF109B8E144140A8" - { - "Name" = "8:Resources" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:_76594C33BABA488DBC160B0B115E0F1B" - "Folders" - { - } - } - } - } - } - "LaunchCondition" - { - } - "Locator" - { - } - "MsiBootstrapper" - { - "LangId" = "3:1033" - "RequiresElevation" = "11:FALSE" - } - "Product" - { - "Name" = "8:Microsoft Visual Studio" - "ProductName" = "8:GSview 6.0" - "ProductCode" = "8:{BB8C85F6-5B3C-4163-9B55-6B07E747E947}" - "PackageCode" = "8:{85959242-0814-4BFE-8891-EE46ADB397D6}" - "UpgradeCode" = "8:{00F5E049-7C22-449F-9879-A4D6A7634B7E}" - "AspNetVersion" = "8:4.0.30319.0" - "RestartWWWService" = "11:FALSE" - "RemovePreviousVersions" = "11:TRUE" - "DetectNewerInstalledVersion" = "11:TRUE" - "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:6.0.0" - "Manufacturer" = "8:Artifex Software" - "ARPHELPTELEPHONE" = "8:" - "ARPHELPLINK" = "8:http://www.artifex.com" - "Title" = "8:Install GSview 6.0 x86" - "Subject" = "8:" - "ARPCONTACT" = "8:Artifex Software" - "Keywords" = "8:" - "ARPCOMMENTS" = "8:Install GSview 6.0 for x86" - "ARPURLINFOABOUT" = "8:http://www.artifex.com" - "ARPPRODUCTICON" = "8:" - "ARPIconIndex" = "3:0" - "SearchPath" = "8:" - "UseSystemSearchPath" = "11:TRUE" - "TargetPlatform" = "3:0" - "PreBuildEvent" = "8:" - "PostBuildEvent" = "8:" - "RunPostBuildEvent" = "3:0" - } - "Registry" - { - "HKLM" - { - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_233AE572F5BA48D1A577D7F88DE5C94E" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_75350EE0EC77414B82CAB14EAF87F8AA" - { - "Name" = "8:[Manufacturer]" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCU" - { - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_18E520707B824ADE8636026ABE055101" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_07D3F609B0F0416CB43A58C33358E4B5" - { - "Name" = "8:[Manufacturer]" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCR" - { - "Keys" - { - } - } - "HKU" - { - "Keys" - { - } - } - "HKPU" - { - "Keys" - { - } - } - } - "Sequences" - { - } - "Shortcut" - { - "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_027434B1EED34DEF86F7CF3635B5FD30" - { - "Name" = "8:GSView 6.0" - "Arguments" = "8:" - "Description" = "8:" - "ShowCmd" = "3:1" - "IconIndex" = "3:32512" - "Transitive" = "11:FALSE" - "Target" = "8:_4879181DB5BD4512A8A1790BC22435A0" - "Folder" = "8:_8ADA7142ADE14DFFA878A5107FE5C304" - "WorkingFolder" = "8:_F115E751BD3842299C96BA6F8A5B0F40" - "Icon" = "8:_4879181DB5BD4512A8A1790BC22435A0" - "Feature" = "8:" - } - } - "UserInterface" - { - "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_1F01AD235CE94923AAD616EC2F3B2101" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdUserInterface.wim" - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_332E71C0C4E14EB9950570071C650B0B" - { - "Name" = "8:#1902" - "Sequence" = "3:2" - "Attributes" = "3:3" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_20E5387842C44457BF0F53E5E053BADA" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminFinishedDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_50F65640B6CC47C882EDDB10C3EA355C" - { - "Name" = "8:#1902" - "Sequence" = "3:1" - "Attributes" = "3:3" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_C0FA7EB2C0E949D99D49ED30340AD678" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdFinishedDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "UpdateText" - { - "Name" = "8:UpdateText" - "DisplayName" = "8:#1058" - "Description" = "8:#1158" - "Type" = "3:15" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1258" - "DefaultValue" = "8:#1258" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_8B3DB474F8184537ABFC9E001FAD6796" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdBasicDialogs.wim" - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_90A48D00803D4600A3A0587F503DF240" - { - "Name" = "8:#1901" - "Sequence" = "3:1" - "Attributes" = "3:2" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_AC19A30ACDE24F4C9F6FC61008980022" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdProgressDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_BF426D392BBE410FB49E79B38576061E" - { - "Name" = "8:#1901" - "Sequence" = "3:2" - "Attributes" = "3:2" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_672D3C120E06497894B6A7787DB2AD1D" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminProgressDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_ECDD7A4101B249C88A997FF923CC7009" - { - "Name" = "8:#1900" - "Sequence" = "3:1" - "Attributes" = "3:1" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_51BA1897377D4A5D98ACE0E2EB251293" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdConfirmDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_AC4CC79CCC9E47D59B61182471DE1D40" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdWelcomeDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_F1DD6CBB2F29447BB67A41DC327C2254" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "InstallAllUsersVisible" - { - "Name" = "8:InstallAllUsersVisible" - "DisplayName" = "8:#1059" - "Description" = "8:#1159" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_F2A4ABF584D248E7812843F3F6D91F91" - { - "Name" = "8:#1900" - "Sequence" = "3:2" - "Attributes" = "3:1" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_2A85F1F786AB43EF820FA580E2689977" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminWelcomeDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_E63962ADBAE3438ABDEFC6290FFF9B71" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_FD25300108814F51958E9811E0EF375D" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminConfirmDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - } - "MergeModule" - { - } - "ProjectOutput" - { - } - } -} diff --git a/platform/windows/gsview/Install64/Install64.vdproj b/platform/windows/gsview/Install64/Install64.vdproj deleted file mode 100644 index faef7562..00000000 --- a/platform/windows/gsview/Install64/Install64.vdproj +++ /dev/null @@ -1,1238 +0,0 @@ -"DeployProject" -{ -"VSVersion" = "3:800" -"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" -"IsWebType" = "8:FALSE" -"ProjectName" = "8:Install64" -"LanguageId" = "3:1033" -"CodePage" = "3:1252" -"UILanguageId" = "3:1033" -"SccProjectName" = "8:" -"SccLocalPath" = "8:" -"SccAuxPath" = "8:" -"SccProvider" = "8:" - "Hierarchy" - { - "Entry" - { - "MsmKey" = "8:_0BD3A92E2F2F40A3B601C2CF21584C48" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_157FB597E59745DFAD45AE54F232D39D" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_1BF4736955034DCEBB4B7C53AEFECA2A" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_28423EA654C8488A8F59859D947164F4" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_372F38F3347F4E0491FA521F236BA54C" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_44A71C9401B94929A3DF6828309FE684" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_6724F24524E24AA1907957AF0812BD09" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_9F16FF3C56C249B58F3F64B821ABBF97" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_AB1B21BC24164EF4929937FE8C3ED270" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_BC8D174211B84DE6968562ECF0A0443B" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_C11D0300BF42444AA9362921375DF910" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_D300E715CB524AF1AE46CE9EB3ED67C8" - "OwnerKey" = "8:_UNDEFINED" - "MsmSig" = "8:_UNDEFINED" - } - "Entry" - { - "MsmKey" = "8:_UNDEFINED" - "OwnerKey" = "8:_44A71C9401B94929A3DF6828309FE684" - "MsmSig" = "8:_UNDEFINED" - } - } - "Configurations" - { - "Debug" - { - "DisplayName" = "8:Debug" - "IsDebugOnly" = "11:TRUE" - "IsReleaseOnly" = "11:FALSE" - "OutputFilename" = "8:Debug\\Install64.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" - { - "Enabled" = "11:TRUE" - "PromptEnabled" = "11:TRUE" - "PrerequisitesLocation" = "2:1" - "Url" = "8:" - "ComponentsUrl" = "8:" - "Items" - { - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.5" - { - "Name" = "8:Microsoft .NET Framework 4.5 (x86 and x64)" - "ProductCode" = "8:.NETFramework,Version=v4.5" - } - } - } - } - "Release" - { - "DisplayName" = "8:Release" - "IsDebugOnly" = "11:FALSE" - "IsReleaseOnly" = "11:TRUE" - "OutputFilename" = "8:Release\\Install64.msi" - "PackageFilesAs" = "3:2" - "PackageFileSize" = "3:-2147483648" - "CabType" = "3:1" - "Compression" = "3:2" - "SignOutput" = "11:FALSE" - "CertificateFile" = "8:" - "PrivateKeyFile" = "8:" - "TimeStampServer" = "8:" - "InstallerBootstrapper" = "3:2" - "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" - { - "Enabled" = "11:TRUE" - "PromptEnabled" = "11:TRUE" - "PrerequisitesLocation" = "2:1" - "Url" = "8:" - "ComponentsUrl" = "8:" - "Items" - { - "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.5" - { - "Name" = "8:Microsoft .NET Framework 4.5 (x86 and x64)" - "ProductCode" = "8:.NETFramework,Version=v4.5" - } - } - } - } - } - "Deployable" - { - "CustomAction" - { - } - "DefaultFeature" - { - "Name" = "8:DefaultFeature" - "Title" = "8:" - "Description" = "8:" - } - "ExternalPersistence" - { - "LaunchCondition" - { - "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_D0F5C30769F1419B8C1834A6F984A56F" - { - "Name" = "8:.NET Framework" - "Message" = "8:[VSDNETMSG]" - "FrameworkVersion" = "8:.NETFramework,Version=v4.5" - "AllowLaterVersions" = "11:FALSE" - "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=395269" - } - } - } - "File" - { - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_0BD3A92E2F2F40A3B601C2CF21584C48" - { - "SourcePath" = "8:..\\Resources\\pageEPS.ico" - "TargetName" = "8:pageEPS.ico" - "Tag" = "8:" - "Folder" = "8:_52FA2F218E56408DA37ABFD7E103994C" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_157FB597E59745DFAD45AE54F232D39D" - { - "SourcePath" = "8:..\\Resources\\pageXPS.ico" - "TargetName" = "8:pageXPS.ico" - "Tag" = "8:" - "Folder" = "8:_52FA2F218E56408DA37ABFD7E103994C" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_1BF4736955034DCEBB4B7C53AEFECA2A" - { - "SourcePath" = "8:..\\gslib\\gsdll64.dll" - "TargetName" = "8:gsdll64.dll" - "Tag" = "8:" - "Folder" = "8:_CDB2B40979C34EBAA8A815DA144BF441" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_28423EA654C8488A8F59859D947164F4" - { - "SourcePath" = "8:..\\Resources\\pageOXPS.ico" - "TargetName" = "8:pageOXPS.ico" - "Tag" = "8:" - "Folder" = "8:_52FA2F218E56408DA37ABFD7E103994C" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_372F38F3347F4E0491FA521F236BA54C" - { - "SourcePath" = "8:..\\bin\\Release\\mupdfnet64.dll" - "TargetName" = "8:mupdfnet64.dll" - "Tag" = "8:" - "Folder" = "8:_CDB2B40979C34EBAA8A815DA144BF441" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_44A71C9401B94929A3DF6828309FE684" - { - "AssemblyRegister" = "3:1" - "AssemblyIsInGAC" = "11:FALSE" - "AssemblyAsmDisplayName" = "8:gsview, Version=6.0.0.0, Culture=neutral, processorArchitecture=MSIL" - "ScatterAssemblies" - { - "_44A71C9401B94929A3DF6828309FE684" - { - "Name" = "8:gsview.exe" - "Attributes" = "3:512" - } - } - "SourcePath" = "8:..\\bin\\Release\\gsview.exe" - "TargetName" = "8:" - "Tag" = "8:" - "Folder" = "8:_CDB2B40979C34EBAA8A815DA144BF441" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_6724F24524E24AA1907957AF0812BD09" - { - "SourcePath" = "8:..\\Resources\\pagePS.ico" - "TargetName" = "8:pagePS.ico" - "Tag" = "8:" - "Folder" = "8:_52FA2F218E56408DA37ABFD7E103994C" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9F16FF3C56C249B58F3F64B821ABBF97" - { - "SourcePath" = "8:..\\Resources\\pageCBZ.ico" - "TargetName" = "8:pageCBZ.ico" - "Tag" = "8:" - "Folder" = "8:_52FA2F218E56408DA37ABFD7E103994C" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_AB1B21BC24164EF4929937FE8C3ED270" - { - "SourcePath" = "8:..\\Resources\\pagePDF.ico" - "TargetName" = "8:pagePDF.ico" - "Tag" = "8:" - "Folder" = "8:_52FA2F218E56408DA37ABFD7E103994C" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_BC8D174211B84DE6968562ECF0A0443B" - { - "SourcePath" = "8:..\\gsview.visualelementsmanifest.xml" - "TargetName" = "8:gsview.visualelementsmanifest.xml" - "Tag" = "8:" - "Folder" = "8:_CDB2B40979C34EBAA8A815DA144BF441" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C11D0300BF42444AA9362921375DF910" - { - "SourcePath" = "8:..\\Resources\\pagePNG.ico" - "TargetName" = "8:pagePNG.ico" - "Tag" = "8:" - "Folder" = "8:_52FA2F218E56408DA37ABFD7E103994C" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D300E715CB524AF1AE46CE9EB3ED67C8" - { - "SourcePath" = "8:..\\Resources\\pageJPG.ico" - "TargetName" = "8:pageJPG.ico" - "Tag" = "8:" - "Folder" = "8:_52FA2F218E56408DA37ABFD7E103994C" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Vital" = "11:TRUE" - "ReadOnly" = "11:FALSE" - "Hidden" = "11:FALSE" - "System" = "11:FALSE" - "Permanent" = "11:FALSE" - "SharedLegacy" = "11:FALSE" - "PackageAs" = "3:1" - "Register" = "3:1" - "Exclude" = "11:FALSE" - "IsDependency" = "11:FALSE" - "IsolateTo" = "8:" - } - } - "FileType" - { - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_11428E8F96C54BA3900AF3407233AAC0" - { - "Name" = "8:PostScript File" - "Description" = "8:PostScript File" - "Extensions" = "8:ps" - "MIME" = "8:" - "Icon" = "8:_6724F24524E24AA1907957AF0812BD09" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_44A71C9401B94929A3DF6828309FE684" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_8E3935BB44F543D5B0E48ACB12FF306D" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_5C233C0E4937479FB108F39E16FABDE6" - { - "Name" = "8:CDisplay ZIP Archived Comic Book file" - "Description" = "8:CDisplay ZIP Archived Comic Book file" - "Extensions" = "8:cbz" - "MIME" = "8:" - "Icon" = "8:_9F16FF3C56C249B58F3F64B821ABBF97" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_44A71C9401B94929A3DF6828309FE684" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_8D3603F262824461A9EA284DBB30D575" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_61007590E6A24BA1A769A064AC2AC094" - { - "Name" = "8:JPEG image" - "Description" = "8:JPEG image" - "Extensions" = "8:jpeg" - "MIME" = "8:" - "Icon" = "8:_D300E715CB524AF1AE46CE9EB3ED67C8" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_44A71C9401B94929A3DF6828309FE684" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_0E6BD260F46C4A89891F1D0A7029A6EF" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_962DBD1C82974C33960B863AB9E1FC9F" - { - "Name" = "8:Open XPS Document" - "Description" = "8:Open XPS Document" - "Extensions" = "8:oxps" - "MIME" = "8:" - "Icon" = "8:_28423EA654C8488A8F59859D947164F4" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_44A71C9401B94929A3DF6828309FE684" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_6B19B65AF043423897A64F9129571FE9" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_A59FDC99A2564A0089516522926CE6C3" - { - "Name" = "8:PNG image" - "Description" = "8:PNG image" - "Extensions" = "8:png" - "MIME" = "8:" - "Icon" = "8:_C11D0300BF42444AA9362921375DF910" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_44A71C9401B94929A3DF6828309FE684" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_948A77318E904662886D34BDC0BCFE0E" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_A8D59D004BB94148B529FD692DDC5460" - { - "Name" = "8:XPS Document" - "Description" = "8:XPS Document" - "Extensions" = "8:xps" - "MIME" = "8:" - "Icon" = "8:_157FB597E59745DFAD45AE54F232D39D" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_44A71C9401B94929A3DF6828309FE684" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_A9ABA43924574B7A992B78537E7F2FB7" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_A8EDD49D509A4974B971BF4FBD093455" - { - "Name" = "8:PDF" - "Description" = "8:PDF" - "Extensions" = "8:pdf" - "MIME" = "8:" - "Icon" = "8:_AB1B21BC24164EF4929937FE8C3ED270" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_44A71C9401B94929A3DF6828309FE684" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_9396BB7A2A2841B0890D2DB6A6360F4E" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - "{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_AA94DC1A560A4224A9410A3EAAB34D77" - { - "Name" = "8:EPS File" - "Description" = "8:EPS File" - "Extensions" = "8:eps" - "MIME" = "8:" - "Icon" = "8:_0BD3A92E2F2F40A3B601C2CF21584C48" - "IconIndex" = "3:0" - "Command" - { - "Command" = "8:_44A71C9401B94929A3DF6828309FE684" - } - "Verbs" - { - "{95C0C507-CBF0-42B8-B119-07219E384A4A}:_BAFA7BE3B6AF4D9283D623A69D266E9B" - { - "Command" = "8:&Open" - "Verb" = "8:open" - "Arguments" = "8:\"%1\"" - "Order" = "3:0" - } - } - } - } - "Folder" - { - "{1525181F-901A-416C-8A58-119130FE478E}:_A2CF2A9B6D384F768C297CC789FBB997" - { - "Name" = "8:#1916" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:DesktopFolder" - "Folders" - { - } - } - "{1525181F-901A-416C-8A58-119130FE478E}:_BE3A2AB1B2C04D7AB9F691ADFDCA6EE1" - { - "Name" = "8:#1919" - "AlwaysCreate" = "11:TRUE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:ProgramMenuFolder" - "Folders" - { - "{9EF0B969-E518-4E46-987F-47570745A589}:_EAE10184B82B40399A965598BE4C92BC" - { - "Name" = "8:Artifex Software" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:_6289816925F64FEEA99AF2712A31DF22" - "Folders" - { - } - } - } - } - "{3C67513D-01DD-4637-8A68-80971EB9504F}:_CDB2B40979C34EBAA8A815DA144BF441" - { - "DefaultLocation" = "8:[ProgramFiles64Folder][Manufacturer]\\[ProductName]" - "Name" = "8:#1925" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:TARGETDIR" - "Folders" - { - "{9EF0B969-E518-4E46-987F-47570745A589}:_52FA2F218E56408DA37ABFD7E103994C" - { - "Name" = "8:Resources" - "AlwaysCreate" = "11:FALSE" - "Condition" = "8:" - "Transitive" = "11:FALSE" - "Property" = "8:_0E795A41F6474AC8ACB9997020B3421A" - "Folders" - { - } - } - } - } - } - "LaunchCondition" - { - } - "Locator" - { - } - "MsiBootstrapper" - { - "LangId" = "3:1033" - "RequiresElevation" = "11:FALSE" - } - "Product" - { - "Name" = "8:Microsoft Visual Studio" - "ProductName" = "8:GSview 6.0" - "ProductCode" = "8:{A22596C0-BCF4-46F9-9CF2-1C66E8588C30}" - "PackageCode" = "8:{980224C0-59E3-4811-81F5-6EF5D4BA2270}" - "UpgradeCode" = "8:{B494B7A2-738F-4F9D-87F4-31830A16FB76}" - "AspNetVersion" = "8:4.0.30319.0" - "RestartWWWService" = "11:FALSE" - "RemovePreviousVersions" = "11:TRUE" - "DetectNewerInstalledVersion" = "11:TRUE" - "InstallAllUsers" = "11:TRUE" - "ProductVersion" = "8:6.0.0" - "Manufacturer" = "8:Artifex Software" - "ARPHELPTELEPHONE" = "8:" - "ARPHELPLINK" = "8:http://www.artifex.com" - "Title" = "8:Install GSview 6.0 x64" - "Subject" = "8:" - "ARPCONTACT" = "8:Artifex Software" - "Keywords" = "8:" - "ARPCOMMENTS" = "8:Install GSview 6.0 for x64" - "ARPURLINFOABOUT" = "8:http://www.artifex.com" - "ARPPRODUCTICON" = "8:_44A71C9401B94929A3DF6828309FE684" - "ARPIconIndex" = "3:32512" - "SearchPath" = "8:" - "UseSystemSearchPath" = "11:TRUE" - "TargetPlatform" = "3:1" - "PreBuildEvent" = "8:" - "PostBuildEvent" = "8:" - "RunPostBuildEvent" = "3:0" - } - "Registry" - { - "HKLM" - { - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_1E605C0AD6C1431799974106D953AE68" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_22F6F34C883A4B46B3D926048627ECB6" - { - "Name" = "8:[Manufacturer]" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCU" - { - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_C1C61CD1AF1A4D718391EC0C924CCEDC" - { - "Name" = "8:Software" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_78C4B8465B114416A32C1313FA510012" - { - "Name" = "8:[Manufacturer]" - "Condition" = "8:" - "AlwaysCreate" = "11:FALSE" - "DeleteAtUninstall" = "11:FALSE" - "Transitive" = "11:FALSE" - "Keys" - { - } - "Values" - { - } - } - } - "Values" - { - } - } - } - } - "HKCR" - { - "Keys" - { - } - } - "HKU" - { - "Keys" - { - } - } - "HKPU" - { - "Keys" - { - } - } - } - "Sequences" - { - } - "Shortcut" - { - "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_DD3E47DAFCAA48ED9A8A02F3B29E888E" - { - "Name" = "8:GSView 6.0" - "Arguments" = "8:" - "Description" = "8:" - "ShowCmd" = "3:1" - "IconIndex" = "3:32512" - "Transitive" = "11:FALSE" - "Target" = "8:_44A71C9401B94929A3DF6828309FE684" - "Folder" = "8:_EAE10184B82B40399A965598BE4C92BC" - "WorkingFolder" = "8:_CDB2B40979C34EBAA8A815DA144BF441" - "Icon" = "8:_44A71C9401B94929A3DF6828309FE684" - "Feature" = "8:" - } - } - "UserInterface" - { - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_84D62A451A39423FB4CBFBF0B05992AE" - { - "Name" = "8:#1901" - "Sequence" = "3:2" - "Attributes" = "3:2" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_91A9D42868164E8A8F4197F300F1B9D8" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminProgressDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_8A4A575119DD460AA6774C08CB4BA465" - { - "Name" = "8:#1901" - "Sequence" = "3:1" - "Attributes" = "3:2" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_44BF62E80B0E4B2DA3C75D4B8B3D11EB" - { - "Sequence" = "3:100" - "DisplayName" = "8:Progress" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdProgressDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "ShowProgress" - { - "Name" = "8:ShowProgress" - "DisplayName" = "8:#1009" - "Description" = "8:#1109" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_914CB62F95114045827D6FD18322AE3C" - { - "Name" = "8:#1900" - "Sequence" = "3:2" - "Attributes" = "3:1" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_1A397F336F944DEAB35C08D6CEA5FE2A" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminConfirmDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_5A2C0AE1AE7D4D17B87F0474E7424544" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminWelcomeDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_FFE13B0235424B189193B4E4F400CB78" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_BC4637BE7ED7492A9359C01A9E29ACDC" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdBasicDialogs.wim" - } - "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_C0B167A59DF14DA9A4170111D28C6057" - { - "UseDynamicProperties" = "11:FALSE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdUserInterface.wim" - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_C71BEB46A03841F0A26B15DC40628CE8" - { - "Name" = "8:#1902" - "Sequence" = "3:2" - "Attributes" = "3:3" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_E843264C683A45A5B80393D60A1EA3EB" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdAdminFinishedDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_DD9DE969B7A74DAC8E617049CE2C3AC1" - { - "Name" = "8:#1900" - "Sequence" = "3:1" - "Attributes" = "3:1" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_A7B7CDCFC5904E1D9128AA5B88FE3583" - { - "Sequence" = "3:200" - "DisplayName" = "8:Installation Folder" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdFolderDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "InstallAllUsersVisible" - { - "Name" = "8:InstallAllUsersVisible" - "DisplayName" = "8:#1059" - "Description" = "8:#1159" - "Type" = "3:5" - "ContextData" = "8:1;True=1;False=0" - "Attributes" = "3:0" - "Setting" = "3:0" - "Value" = "3:1" - "DefaultValue" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_BC68E9D5B9714365AD5E43D2BD52B953" - { - "Sequence" = "3:300" - "DisplayName" = "8:Confirm Installation" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdConfirmDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - } - } - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_D4358EB6E55E497193888CAFBDD4F2C9" - { - "Sequence" = "3:100" - "DisplayName" = "8:Welcome" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdWelcomeDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:0" - "UsePlugInResources" = "11:TRUE" - } - "CopyrightWarning" - { - "Name" = "8:CopyrightWarning" - "DisplayName" = "8:#1002" - "Description" = "8:#1102" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1202" - "DefaultValue" = "8:#1202" - "UsePlugInResources" = "11:TRUE" - } - "Welcome" - { - "Name" = "8:Welcome" - "DisplayName" = "8:#1003" - "Description" = "8:#1103" - "Type" = "3:3" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1203" - "DefaultValue" = "8:#1203" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_F3C1167A3B7748BCB1C893E82BBED76A" - { - "Name" = "8:#1902" - "Sequence" = "3:1" - "Attributes" = "3:3" - "Dialogs" - { - "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_9313CCEC27A04A03B8010FCEC3B1BEC1" - { - "Sequence" = "3:100" - "DisplayName" = "8:Finished" - "UseDynamicProperties" = "11:TRUE" - "IsDependency" = "11:FALSE" - "SourcePath" = "8:<VsdDialogDir>\\VsdFinishedDlg.wid" - "Properties" - { - "BannerBitmap" - { - "Name" = "8:BannerBitmap" - "DisplayName" = "8:#1001" - "Description" = "8:#1101" - "Type" = "3:8" - "ContextData" = "8:Bitmap" - "Attributes" = "3:4" - "Setting" = "3:1" - "UsePlugInResources" = "11:TRUE" - } - "UpdateText" - { - "Name" = "8:UpdateText" - "DisplayName" = "8:#1058" - "Description" = "8:#1158" - "Type" = "3:15" - "ContextData" = "8:" - "Attributes" = "3:0" - "Setting" = "3:1" - "Value" = "8:#1258" - "DefaultValue" = "8:#1258" - "UsePlugInResources" = "11:TRUE" - } - } - } - } - } - } - "MergeModule" - { - } - "ProjectOutput" - { - } - } -} diff --git a/platform/windows/gsview/LICENSE b/platform/windows/gsview/LICENSE new file mode 100644 index 00000000..4fd64b19 --- /dev/null +++ b/platform/windows/gsview/LICENSE @@ -0,0 +1,66 @@ +This End User License Agreement (“Agreement”) is a legal agreement between ARTIFEX SOFTWARE INC., a California corporation with its principal place of business as 7 Mt. Lassen Drive, A-134, San Rafael, California 94903 (“Artifex”) and you (either an individual or an entity, as identified in your invoice regarding the use of Artifex's software for which you have purchased a license, including any documentation that may be included in the software (together, the “Software”). + + +Grant of License. + +Subject to the restrictions herein, and payment of the applicable license fees, Artifex hereby grants to you the personal, nontransferable, non-exclusive right to use the Software, for internal purposes only. You may use the Software as follows, depending on the licenses you have ordered as reflected in your invoice: + +• Individual License. You may use the Software, on only one computer, and only by one user, at a time. You may not store the Software on a server that enables access via multiple computers. + +• Multiple Licenses. One user may use one copy of the Software for each license you have purchased. You may make a reasonable number of copies to support such use. + +• Site License. All of your employees located at a particular site, as indicated in your invoice, may use the Software via computers located at that site, provided the employee’s primary office is at that site. For clarity, a computer will be considered on-site when a user accesses the Software via that computer, even if the Software is being served from offsite servers, and even if the users access their primary computers via virtualization or remote access. + +• Enterprise License. All your employees may use the Software regardless of the number of copies or locations. + + +Copyright. + +The Software is licensed to you, not sold. All copies of the Software are the property of Artifex. Artifex reserves all intellectual property rights in the Software. The Software is protected by United States copyright and other intellectual property laws and international treaty provisions. Therefore, you may not use, copy, modify or distribute the Software without authorization. You may make a reasonable number of copies of the Software solely for backup or archival purposes. + + +Restrictions. + +You may not rent, lease, or loan the Software. You may not reverse engineer, decompile, or disassemble the Software, except to the extent the foregoing restriction is prohibited by applicable law. You may not modify, or create derivative works based upon the Software. You many not use the Software to make its functionality available to others, such as via software-as-a-service offerings. If you make any copy of the Software, you must retain all copyright and other intellectual property notices. + + +Open Source Licensing. + +Artifex may offer versions of the Software under open source licenses such as the Affero General Public License 3.0. This Agreement will not vitiate any rights you may have separately under such open source licenses. + +Termination. + +You may terminate the license granted in this Agreement by so advising Artifex in writing. The license granted in this Agreement will terminate automatically upon any violation by you of its terms or conditions. Upon termination of the license, you must destroy all your copies of the Software. + + +Updates. + +The right to receive support or updates to the Software may be subject to additional terms, conditions or charges. Please contact Artifex for additional information about maintenance and support programs. To the extent you are provided updates, revisions, or new versions of the Software, this Agreement will govern them and they will be considered part of the Software hereunder, unless you and Artifex agree to a new license agreement covering them. + + +NO WARRANTIES. + +YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO MEET YOUR NEEDS. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, ARTIFEX DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. SOME STATES DO NOT ALLOW LIMITATIONS ON IMPLIED WARRANTIES, SO THE ABOVE LIMITATION MAY NOT APPLY TO YOU. + + +NO LIABILITY FOR CONSEQUENTIAL DAMAGES. + +IN NO EVENT WILL ARTIFEX OR ITS SUPPLIERS OR LICENSORS BE LIABLE FOR ANY CONSEQUENTIAL, INCIDENTAL, OR INDIRECT DAMAGES (INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF BUSINESS PROFITS OR BUSINESS INTERRUPTION) ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL ARTIFEX OR ITS SUPPLIERS OR LICENSORS BE LIABLE FOR MORE THAN THE AMOUNT ACTUALLY PAID BY YOU TO ARTIFEX FOR THE SOFTWARE. BECAUSE SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, THE ABOVE LIMITATION MAY NOT APPLY TO YOU. + + +U.S. Government-Restricted Rights. + +The Software and accompanying documentation are deemed to be "commercial computer Software" and "commercial computer Software documentation," respectively, pursuant to DFAR Section 227.7202 and FAR Section 12.212(b), as applicable. Any use, modification, reproduction release, performance, display or disclosure of the Software and accompanying documentation, and any derivative works thereof, by the U.S. Government will be governed solely by the terms of this Agreement. + + +Export Restrictions. + +You may not download, export, or re-export the Software (a) into, or to a national or resident of, any country to which the United States has embargoed goods, or (b) to anyone on the United States Treasury Department's list of Specially Designated Nationals or the U.S. Commerce Department's Table of Deny Orders. By downloading or using the Software, you are representing and warranting that you are not located in, under the control of, or a national or resident of any such country or on any such list. + + +General. + +This Agreement is governed by the laws of the United States and the State of California, without reference to conflict of laws principles. Any dispute between you and Artifex arising out of or relating to this Agreement will be subject to the exclusive venue and jurisdiction of the state and federal courts located in Marin County, California. This Agreement is the entire agreement between you and Artifex and supersedes any prior agreements relating thereto. If any provision of this Agreement is held invalid, the remainder of this Agreement will continue in full force and effect and the invalid provision will be reformed and enforced to reflect the original intent of the parties. + + +Should you have any questions concerning this Agreement, or if you desire to contact Artifex for any reason, please contact: miles.jones@artifex.com diff --git a/platform/windows/gsview/MainWindow.xaml b/platform/windows/gsview/MainWindow.xaml index 10d126bb..37ae3e1e 100644 --- a/platform/windows/gsview/MainWindow.xaml +++ b/platform/windows/gsview/MainWindow.xaml @@ -192,7 +192,7 @@ <MenuItem Header="Page Conversions..." Click="ConvertClick" x:Name="xaml_conversions"> </MenuItem> <Separator /> - <MenuItem Header="Print..." Command="Print" InputGestureText="Ctrl+P" x:Name="xaml_print"> + <MenuItem Header="Print..." Command="Print" InputGestureText="Ctrl+P" x:Name="xaml_print_menu"> <MenuItem.Icon> <Image Source="Resources/printer.ico" /> </MenuItem.Icon> diff --git a/platform/windows/gsview/MainWindow.xaml.cs b/platform/windows/gsview/MainWindow.xaml.cs index 6e6ee855..0ca822e9 100644 --- a/platform/windows/gsview/MainWindow.xaml.cs +++ b/platform/windows/gsview/MainWindow.xaml.cs @@ -21,6 +21,9 @@ using System.Printing; using System.Windows.Markup; using System.Runtime.InteropServices; using Microsoft.Win32; /* For registry */ +using System.Reflection; +using System.Diagnostics; + public enum AA_t { @@ -153,6 +156,7 @@ static class Constants public const int SCROLL_EDGE_BUFFER = 90; public const int VERT_SCROLL_STEP = 48; public const int PAGE_MARGIN = 1; + public const int MAX_PRINT_PREVIEW_LENGTH = 250; } public static class DocumentTypes @@ -205,6 +209,15 @@ namespace gsview public int num_rects; } + public struct printPreviewPage_t + { + public Byte[] bitmap; + public int width; + public int height; + public double width_inches; + public double height_inches; + } + public struct textSelectInfo_t { public int pagenum; @@ -282,6 +295,7 @@ namespace gsview List<DocPage> m_thumbnails; List<List<RectList>> m_page_link_list = null; IList<RectList> m_text_list; + DocPage m_PrintPreviewPage; public List<LinesText> m_lineptrs = null; public List<BlocksText> m_textptrs = null; List<Boolean> m_textset = null; @@ -304,16 +318,19 @@ namespace gsview String m_origfile; private gsprint m_ghostprint = null; bool m_isXPS; + bool m_isImage; gsOutput m_gsoutput; Convert m_convertwin; PageExtractSave m_extractwin; Password m_password = null; + PrintControl m_printcontrol = null; String m_currpassword = null; BackgroundWorker m_thumbworker = null; BackgroundWorker m_textsearch = null; BackgroundWorker m_linksearch = null; BackgroundWorker m_openfile = null; BackgroundWorker m_initrender = null; + BackgroundWorker m_printerpreview = null; BackgroundWorker m_copytext = null; String m_document_type; Info m_infowindow; @@ -349,6 +366,7 @@ namespace gsview { m_docPages = new Pages(); m_thumbnails = new List<DocPage>(); + m_PrintPreviewPage = new DocPage(); m_lineptrs = new List<LinesText>(); m_textptrs = new List<BlocksText>(); m_textset = new List<Boolean>(); @@ -426,6 +444,8 @@ namespace gsview m_gsoutput.RealWindowClosing(); if (m_outputintents != null) m_outputintents.RealWindowClosing(); + if (m_printcontrol != null) + m_printcontrol.RealWindowClosing(); } else { @@ -433,6 +453,8 @@ namespace gsview m_gsoutput.Hide(); if (m_outputintents != null) m_outputintents.Hide(); + if (m_printcontrol != null) + m_printcontrol.Hide(); } } @@ -493,7 +515,7 @@ namespace gsview xaml_extractselection.IsEnabled = false; xaml_conversions.IsEnabled = false; xaml_gsmessage.IsEnabled = false; - xaml_print.IsEnabled = false; + xaml_print_menu.IsEnabled = false; xaml_view.IsEnabled = false; xaml_edit.IsEnabled = false; } @@ -558,6 +580,7 @@ namespace gsview m_links_on = false; m_doczoom = 1.0; m_isXPS = false; + m_isImage = false; //xaml_CancelThumb.IsEnabled = true; m_currpage = 0; m_ignorescrollchange = false; @@ -579,12 +602,23 @@ namespace gsview return result; } + private String GetVersion() + { + Assembly assembly = Assembly.GetExecutingAssembly(); + FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); + String vers = fileVersionInfo.ProductVersion; + String[] parts = vers.Split('.'); + String simple_vers = parts[0] + '.' + parts[1]; + return simple_vers; + } + /* Initialize from registry */ private void InitFromRegistry() { RegistryKey key = Registry.CurrentUser.CreateSubKey("Software"); RegistryKey keyA = key.CreateSubKey("Artifex Software"); - RegistryKey keygs = keyA.CreateSubKey("GSview 6.0"); + String vers = GetVersion(); + RegistryKey keygs = keyA.CreateSubKey("gsview " + vers); String filepath = null; Int32 page; AA_t aa = AA_t.HIGH; @@ -622,7 +656,8 @@ namespace gsview RegistryKey key = Registry.CurrentUser.CreateSubKey("Software"); RegistryKey keyA = key.CreateSubKey("Artifex Software"); - RegistryKey keygs = keyA.CreateSubKey("GSview 6.0"); + String vers = GetVersion(); + RegistryKey keygs = keyA.CreateSubKey("gsview " + vers); if (m_origfile != null && (m_document_type == DocumentTypes.PS || m_document_type == DocumentTypes.EPS)) @@ -707,6 +742,13 @@ namespace gsview if (m_password != null && m_password.IsActive) m_password.Close(); + if (m_printcontrol != null && m_printcontrol.IsActive) + m_printcontrol.Close(); + + /* Release the print control regardless of it being opened. + We don't want previous documents pages in the preview */ + m_printcontrol = null; + if (m_infowindow != null && m_infowindow.IsActive) m_infowindow.Close(); @@ -794,6 +836,9 @@ namespace gsview /* Set if this is already xps for printing */ if (extension.ToUpper() == ".XPS" || extension.ToUpper() == ".OXPS") m_isXPS = true; + if (extension.ToUpper() == ".CBZ" || extension.ToUpper() == ".PNG" || + extension.ToUpper() == ".JPG") + m_isImage = true; OpenFile2(FileName); } @@ -980,11 +1025,25 @@ namespace gsview xaml_extractselection.IsEnabled = true; xaml_conversions.IsEnabled = true; xaml_gsmessage.IsEnabled = true; - xaml_print.IsEnabled = true; + xaml_print_menu.IsEnabled = true; xaml_view.IsEnabled = true; xaml_edit.IsEnabled = true; - if (m_isXPS) + if (m_isXPS || m_isImage) DisabletoPDF(); + if (m_isImage) + { + xaml_Print.IsEnabled = false; + xaml_print_menu.IsEnabled = false; + xaml_Print.Opacity = 0.5; + xaml_print_menu.Opacity = 0.5; + } + else + { + xaml_Print.IsEnabled = true; + xaml_print_menu.IsEnabled = true; + xaml_Print.Opacity = 1.0; + xaml_print_menu.Opacity = 1.0; + } xaml_OpenProgressGrid.Visibility = System.Windows.Visibility.Collapsed; xaml_VerticalScroll.Visibility = System.Windows.Visibility.Visible; xaml_VerticalScroll.Value = 0; @@ -1743,47 +1802,40 @@ namespace gsview if (!m_file_open) return; - /* If file is already xps then gs need not do this */ - if (!m_isXPS) + if (m_printcontrol == null) { - xaml_DistillProgress.Value = 0; - if (m_ghostscript.CreateXPS(m_currfile, Constants.DEFAULT_GS_RES, m_num_pages) == gsStatus.GS_BUSY) - { - ShowMessage(NotifyType_t.MESS_STATUS, "GS currently busy"); - return; - } - else - { - /* Right now this is not possible to cancel due to the way - * that gs is run for xpswrite from pdf */ - xaml_CancelDistill.Visibility = System.Windows.Visibility.Collapsed; - xaml_DistillName.Text = "Convert to XPS"; - xaml_DistillName.FontWeight = FontWeights.Bold; - xaml_DistillGrid.Visibility = System.Windows.Visibility.Visible; - } + m_printcontrol = new PrintControl(m_num_pages, m_currpage); + m_printcontrol.PrintDiagUpdatePreview += new PrintControl.PrintDiagCallBackPreview(PrintDiagUpdatePreview); + m_printcontrol.PrintDiagPrint += new PrintControl.PrintDiagCallBackPrint(PrintDiagPrint); + m_printcontrol.PrintDLLProblemMain += new PrintControl.PrintDLLProblem(gsDLL); + m_printcontrol.Activate(); + m_printcontrol.Show(); /* Makes it modal */ + PrintDiagEventArgs args = new PrintDiagEventArgs(0); + PrintDiagUpdatePreview(null, args); } else - PrintXPS(m_currfile); + m_printcontrol.Show(); + return; } private void PrintXPS(String file) { gsprint ghostprint = new gsprint(); - System.Windows.Controls.PrintDialog pDialog = ghostprint.GetPrintDialog(); - if (pDialog == null) - return; /* We have to create the XPS document on a different thread */ XpsDocument xpsDocument = new XpsDocument(file, FileAccess.Read); FixedDocumentSequence fixedDocSeq = xpsDocument.GetFixedDocumentSequence(); - PrintQueue printQueue = pDialog.PrintQueue; + System.Windows.Size temp = new Size(200, 200); + fixedDocSeq.DocumentPaginator.PageSize = temp; + + PrintQueue printq = m_printcontrol.m_selectedPrinter; m_ghostprint = ghostprint; xaml_PrintGrid.Visibility = System.Windows.Visibility.Visible; xaml_PrintProgress.Value = 0; - ghostprint.Print(printQueue, fixedDocSeq); + ghostprint.Print(printq, fixedDocSeq, m_printcontrol); } private void PrintProgress(object printHelper, gsPrintEventArgs Information) @@ -1963,7 +2015,7 @@ namespace gsview private void ExtractPages(object sender, RoutedEventArgs e) { - if (!m_init_done || m_isXPS) + if (!m_init_done || m_isXPS || m_isImage) return; if (m_extractwin == null || !m_extractwin.IsActive) @@ -4902,5 +4954,105 @@ namespace gsview m_showannot = false; RenderRange(m_currpage, false, zoom_t.NO_ZOOM, 0); } + + /* Print preview rendering and control */ + private void RenderPrintPreview(object sender, DoWorkEventArgs e) + { + BackgroundWorker worker = sender as BackgroundWorker; + List<object> genericlist = e.Argument as List<object>; + int k = (int)genericlist[0]; + int desiredMax = Constants.MAX_PRINT_PREVIEW_LENGTH; + + Point ras_size; + double scale_factor = 1.0; + Byte[] bitmap; + BlocksText charlist; + status_t code; + Annotate_t annot; + + if (ComputePageSize(k, scale_factor, out ras_size) == status_t.S_ISOK) + { + /* Adjust the scale factor to ensure max length is set as desired */ + int maxSize = Math.Max((int)ras_size.X, (int)ras_size.Y); + scale_factor = (double)desiredMax / (double)maxSize; + ComputePageSize(k, scale_factor, out ras_size); + printPreviewPage_t result; + + try + { + bitmap = new byte[(int)ras_size.X * (int)ras_size.Y * 4]; + code = (status_t)mu_doc.RenderPage(k, bitmap, (int)ras_size.X, + (int)ras_size.Y, scale_factor, false, true, + false, out charlist, m_showannot, out annot); + result.width = (int)ras_size.X; + result.height = (int)ras_size.Y; + result.bitmap = bitmap; + ComputePageSize(k, 1.0, out ras_size); + result.height_inches = ras_size.Y / 72.0; + result.width_inches = ras_size.X / 72.0; + e.Result = result; + } + catch (OutOfMemoryException em) + { + Console.WriteLine("Memory allocation failed print preview page " + k + em.Message + "\n"); + } + } + } + + private void RenderPrintPreviewCompleted(object sender, RunWorkerCompletedEventArgs e) + { + BitmapSource BitMapSrc; + printPreviewPage_t Result = (printPreviewPage_t)e.Result; + + int stride = Result.width * 4; + BitMapSrc = BitmapSource.Create(Result.width, Result.height, + 72, 72, PixelFormats.Pbgra32, BitmapPalettes.Halftone256, Result.bitmap, stride); + + m_printcontrol.SetImage(BitMapSrc, Result.height_inches, Result.width_inches); + } + + private bool PrintDiagUpdatePreview(object PrintDiag, PrintDiagEventArgs args) + { + try + { + m_printerpreview = new BackgroundWorker(); + m_printerpreview.WorkerReportsProgress = false; + m_printerpreview.WorkerSupportsCancellation = false; + m_printerpreview.DoWork += new DoWorkEventHandler(RenderPrintPreview); + m_printerpreview.RunWorkerCompleted += new RunWorkerCompletedEventHandler(RenderPrintPreviewCompleted); + var arguments = new List<object>(); + arguments.Add(args.m_page); + m_printerpreview.RunWorkerAsync(arguments); + } + catch (OutOfMemoryException e) + { + Console.WriteLine("Memory allocation failed during printpreview render\n"); + ShowMessage(NotifyType_t.MESS_ERROR, "Out of memory: " + e.Message); + } + return true; + } + + private void PrintDiagPrint(object PrintDiag) + { + /* If file is already xps then gs need not do this */ + if (!m_isXPS) + { + xaml_DistillProgress.Value = 0; + if (m_ghostscript.CreateXPS(m_currfile, Constants.DEFAULT_GS_RES, m_num_pages, m_printcontrol) == gsStatus.GS_BUSY) + { + ShowMessage(NotifyType_t.MESS_STATUS, "GS currently busy"); + return; + } + else + { + xaml_CancelDistill.Visibility = System.Windows.Visibility.Collapsed; + xaml_DistillName.Text = "Convert to XPS"; + xaml_DistillName.FontWeight = FontWeights.Bold; + xaml_DistillGrid.Visibility = System.Windows.Visibility.Visible; + } + } + else + PrintXPS(m_currfile); + } } }
\ No newline at end of file diff --git a/platform/windows/gsview/PrintControl.xaml b/platform/windows/gsview/PrintControl.xaml new file mode 100644 index 00000000..e89fe8b4 --- /dev/null +++ b/platform/windows/gsview/PrintControl.xaml @@ -0,0 +1,247 @@ +<Window x:Class="gsview.PrintControl" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + Title="gsview print" Height="650" Width="653" + SizeToContent="WidthAndHeight" ResizeMode="NoResize"> + + + <Window.Resources> + <Style x:Key="MySimpleScrollBar" TargetType="{x:Type ScrollBar}"> + <Setter Property="Stylus.IsFlicksEnabled" Value="false"/> + <Setter Property="Width" Value="Auto"/> + <Setter Property="MinHeight" Value="30"/> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ScrollBar}"> + <Border BorderThickness="1" BorderBrush="Gray"> + <Grid Margin="2"> + <Grid.ColumnDefinitions> + <ColumnDefinition/> + <ColumnDefinition /> + </Grid.ColumnDefinitions> + <TextBox VerticalAlignment="Center" FontSize="12" MinWidth="25" Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}}"/> + <Grid Grid.Column="1" x:Name="GridRoot" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Background="{TemplateBinding Background}"> + <Grid.RowDefinitions> + <RowDefinition MaxHeight="18"/> + <RowDefinition Height="0.00001*"/> + <RowDefinition MaxHeight="18"/> + </Grid.RowDefinitions> + <RepeatButton x:Name="DecreaseRepeat" Command="ScrollBar.LineDownCommand" Focusable="False"> + <Grid> + <Path x:Name="DecreaseArrow" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Data="M 0 4 L 8 4 L 4 0 Z"/> + </Grid> + </RepeatButton> + <RepeatButton Grid.Row="2" x:Name="IncreaseRepeat" Command="ScrollBar.LineUpCommand" Focusable="False"> + <Grid> + <Path x:Name="IncreaseArrow" Stroke="{TemplateBinding Foreground}" StrokeThickness="1" Data="M 0 0 L 4 4 L 8 0 Z"/> + </Grid> + </RepeatButton> + </Grid> + </Grid> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </Window.Resources> + + <DockPanel Background="WhiteSmoke" LastChildFill="False" Margin="0,0,0,0"> + <GroupBox Header="Printer" Height="100" Width="500" DockPanel.Dock="Top" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="15,15,0,0"> + <Grid Background="WhiteSmoke" Visibility="Visible" > + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <Grid Grid.Column="0" Grid.Row="0" Background="WhiteSmoke"> + <Grid.RowDefinitions> + <RowDefinition Height="30" /> + <RowDefinition Height="30" /> + </Grid.RowDefinitions> + <TextBox Grid.Column="0" Grid.Row="0" Text="Name:" FontSize="12" FontFamily="Segoe UI" Background="WhiteSmoke" BorderThickness="0" VerticalAlignment="Center"/> + <TextBox Grid.Column="0" Grid.Row="1" Text="Status:" FontSize="12" FontFamily="Segoe UI" Background="WhiteSmoke" BorderThickness="0" VerticalAlignment="Center"/> + </Grid> + <Grid Grid.Column="1" Grid.Row="0" Background="WhiteSmoke"> + <Grid.RowDefinitions> + <RowDefinition Height="30" /> + <RowDefinition Height="30" /> + </Grid.RowDefinitions> + <ComboBox Grid.Column="0" Grid.Row="0" x:Name="xaml_selPrinter" SelectionChanged="selPrinterChanged" Width="225" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" > + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal"> + <TextBlock FontSize="11" FontFamily="Segoe UI" Text="{Binding Name}" /> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + <TextBox Grid.Column="0" Grid.Row="1" x:Name="xaml_Status" FontSize="12" FontFamily="Segoe UI" Text="" Margin="105,92,497,301" Background="WhiteSmoke" BorderThickness="0"/> + </Grid> + <Grid Grid.Column="2" Grid.Row="0" Background="WhiteSmoke"> + <Grid.RowDefinitions> + <RowDefinition Height="30" /> + </Grid.RowDefinitions> + <Button Grid.Column="0" Grid.Row="0" Content="Properties" FontSize="12" FontFamily="Segoe UI" HorizontalAlignment="Center" Margin="0, 0, 30, 0" VerticalAlignment="Center" Width="75" Click="ShowProperties"/> + </Grid> + </Grid> + </GroupBox> + <Grid DockPanel.Dock="Left" Background="WhiteSmoke" Visibility="Visible"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <GroupBox Grid.Column="0" Grid.Row="0" Header="Print Range" Height="150" Width="250" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="15,15,0,0"> + <Grid Background="WhiteSmoke" Visibility="Visible" > + <Grid.RowDefinitions> + <RowDefinition Height="30" /> + <RowDefinition Height="30" /> + <RowDefinition Height="30" /> + <RowDefinition Height="30" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="90" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <RadioButton Grid.Column="0" Grid.Row="0" Name="xaml_rbAll" VerticalAlignment="Center" GroupName="PageRange" Checked="AllPages">All</RadioButton> + <RadioButton Grid.Column="0" Grid.Row="1" Name="xaml_rbCurrent" VerticalAlignment="Center" GroupName="PageRange" Checked="CurrentPage">Current page</RadioButton> + <RadioButton Grid.Column="0" Grid.Row="2" Name="xaml_rbPages" VerticalAlignment="Center" GroupName="PageRange" Checked="PageRange">Pages</RadioButton> + + <TextBox x:Name="xaml_pagerange" Grid.Column="1" Grid.Row="2" Width="100" Height="20" VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Left" + HorizontalScrollBarVisibility="Hidden" VerticalAlignment="Center" FontSize="12" FontFamily="Segoe UI" Margin="0,0,0,0" PreviewKeyDown="PageNumberEnter"/> + + <TextBox x:Name="xaml_invalid" Grid.Column="1" Grid.Row="1" Width="Auto" Height="Auto" VerticalScrollBarVisibility="Hidden" HorizontalAlignment="Center" Background="WhiteSmoke" Visibility="Collapsed" + HorizontalScrollBarVisibility="Hidden" VerticalAlignment="Center" Foreground="Red" Text="Invalid Range! (3-5, 7) e.g." FontSize="12" FontFamily="Segoe UI" Margin="0,0,0,0" PreviewKeyDown="PageNumberEnter"/> + + + <TextBox Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Text="Subset:" FontSize="12" FontFamily="Segoe UI" Background="WhiteSmoke" BorderThickness="0"/> + <ComboBox Grid.Column="1" Grid.Row="3" x:Name="xaml_Subset" SelectionChanged="Subset_SelectionChanged" Width="140" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Left"> + <ComboBoxItem Name="all" FontSize="11" FontFamily="Segoe UI">All pages in range</ComboBoxItem> + <ComboBoxItem Name="odd" FontSize="11" FontFamily="Segoe UI">Odd pages only</ComboBoxItem> + <ComboBoxItem Name="even" FontSize="11" FontFamily="Segoe UI">Even pages only</ComboBoxItem> + </ComboBox> + </Grid> + </GroupBox> + + <GroupBox Grid.Column="0" Grid.Row="1" Header="Page Handling" Height="90" Width="250" Margin="15,15,0,0" DockPanel.Dock="Left" HorizontalAlignment="Center" VerticalAlignment="Center" > + <Grid Background="WhiteSmoke" Visibility="Visible" Height="103" VerticalAlignment="Top"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="90" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <TextBox Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" Text="Copies:" FontSize="12" FontFamily="Segoe UI" Background="WhiteSmoke" BorderThickness="0" /> + <ScrollBar Grid.Column="1" Grid.Row="0" x:Name="xaml_Copies" HorizontalAlignment="Left" Style="{DynamicResource MySimpleScrollBar}" VerticalAlignment="Top" Value="1" Maximum="999" SmallChange="1" Height="15" ValueChanged="xaml_Copies_ValueChanged"/> + <CheckBox x:Name="xaml_autofit" Grid.Column="0" Grid.Row="2" Content="Auto-Fit" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Checked="AutoFit_Checked" Unchecked="AutoFit_Unchecked" Grid.ColumnSpan="2"/> + </Grid> + </GroupBox> + </Grid> + + + <GroupBox Header="Preview" Height="450" Width="350" DockPanel.Dock="Right" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,15,15,0"> + <Grid Background="WhiteSmoke" Visibility="Visible" > + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="*" /> + <RowDefinition Height="40" /> + <RowDefinition Height="40" /> + <RowDefinition Height="40" /> + <RowDefinition Height="40" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Canvas x:Name="xaml_TopArrowCanvas" Grid.Row="0" Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="0,0,0,25" Height="0" Width="0" Visibility="Collapsed"> + <Grid Background="WhiteSmoke" HorizontalAlignment="Center"> + <Grid.RowDefinitions> + <RowDefinition Height="*" /> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + <Line x:Name="xaml_topsize" Grid.Row="1" Y1="0" X1="0" X2="100" Y2="0" Stroke="Black" StrokeThickness="1"/> + <Line x:Name="xaml_topleftbottomarrow" Grid.Row="1" Y1="0" X1="0" X2="7" Y2="7" Stroke="Black" StrokeThickness="1" /> + <Line x:Name="xaml_toplefttoparrow" Grid.Row="1" Y1="0" X1="0" X2="7" Y2="-7" Stroke="Black" StrokeThickness="1" /> + <Line x:Name="xaml_toprighttoparrow" Grid.Row="1" Y1="-7" X1="93" X2="100" Y2="0" Stroke="Black" StrokeThickness="1" /> + <Line x:Name="xaml_toprightbottomarrow" Grid.Row="1" Y1="7" X1="93" X2="100" Y2="0" Stroke="Black" StrokeThickness="1" /> + <TextBlock x:Name="xaml_topsizevalue" Text="100" Grid.Row="0" HorizontalAlignment="Center"/> + </Grid> + </Canvas> + + <Canvas x:Name="xaml_LeftArrowCanvas" Grid.Row="1" Grid.Column="0" Height="Auto" Width="40" VerticalAlignment="Top" HorizontalAlignment="Center" Visibility="Collapsed"> + <Grid Background="WhiteSmoke" VerticalAlignment="Top" HorizontalAlignment="Center"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Line x:Name="xaml_leftsize" Grid.Column="1" Y1="0" X1="0" X2="0" Y2="100" Stroke="Black" StrokeThickness="1" /> + <Line x:Name="xaml_lefttopleft" Grid.Column="1" Y1="0" X1="0" X2="-7" Y2="7" Stroke="Black" StrokeThickness="1" /> + <Line x:Name="xaml_lefttopright" Grid.Column="1" Y1="0" X1="0" X2="7" Y2="7" Stroke="Black" StrokeThickness="1" /> + <Line x:Name="xaml_leftbottomleft" Grid.Column="1" Y1="93" X1="-7" X2="0" Y2="100" Stroke="Black" StrokeThickness="1" /> + <Line x:Name="xaml_leftbottomright" Grid.Column="1" Y1="93" X1="7" X2="0" Y2="100" Stroke="Black" StrokeThickness="1" /> + <TextBlock x:Name="xaml_leftsizevalue" Text="100" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,10,0"/> + </Grid> + </Canvas> + + <!-- Draw the white paper full size white --> + <Rectangle x:Name="xaml_PreviewPaper" Visibility="Collapsed" Fill="White" Grid.Column="1" Grid.Row="1" Height="0" Width="0" VerticalAlignment="Top" HorizontalAlignment="Left"/> + + <!-- Draw the whole image --> + <Rectangle x:Name="xaml_PreviewImageRect" Visibility="Collapsed" Stroke="Red" Grid.Column="1" Grid.Row="1" Height="0" Width="0" VerticalAlignment="Top" HorizontalAlignment="Left"> + <Rectangle.Fill> + <ImageBrush x:Name="xaml_ImagePreview"> + </ImageBrush> + </Rectangle.Fill> + </Rectangle> + + <!-- Draw the gray shade over it --> + <Rectangle x:Name="xaml_PreviewGrayRect" Visibility="Collapsed" Stroke="Green" Fill="#7f7f7f7f" Grid.Column="1" Grid.Row="1" Height="0" Width="0" VerticalAlignment="Top" HorizontalAlignment="Left"/> + + <!-- Redraw with clipping --> + <Rectangle x:Name="xaml_PreviewImageRectClip" Visibility="Collapsed" Stroke="Blue" Grid.Column="1" Grid.Row="1" Height="0" Width="0" VerticalAlignment="Top" HorizontalAlignment="Left"> + <Rectangle.Fill> + <ImageBrush x:Name="xaml_ImagePreviewClip"> + </ImageBrush> + </Rectangle.Fill> + <Rectangle.Clip> + <RectangleGeometry x:Name="xaml_ImagePreviewClipGeom" Rect="0 0 50 100"/> + </Rectangle.Clip> + </Rectangle> + + <!-- Draw the final full black bounding rect for the paper--> + <Rectangle x:Name="xaml_PreviewPaperOuterRect" Stroke="Black" Fill="#00000000" Grid.Column="1" Grid.Row="1" Height="0" Width="0" VerticalAlignment="Top" HorizontalAlignment="Left"/> + + <Grid Grid.Column="1" Grid.Row="2" Height="Auto"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <TextBox Visibility="Collapsed" x:Name="xaml_pagesize" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" FontFamily="Segoe UI" Background="WhiteSmoke" BorderThickness="0" Height="16" Width="Auto" /> + <TextBox Visibility="Collapsed" x:Name="xaml_docsize" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" FontFamily="Segoe UI" Background="WhiteSmoke" BorderThickness="0" Height="16" Width="Auto" /> + </Grid> + + <TextBox x:Name="xaml_pagecount" Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" Text="1/1" FontSize="12" FontFamily="Segoe UI" Background="WhiteSmoke" BorderThickness="0" Height="16" Margin="0,12" Width="Auto" /> + <Slider x:Name="xaml_pageslider" IsSnapToTickEnabled="True" Grid.Column="1" Grid.Row="3" Maximum="100" VerticalAlignment="Center" Margin="15,11,36,11" Height="18" PreviewMouseUp="PageSelect_DragCompleted"/> + <TextBox Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Right" Text="Units:" FontSize="12" FontFamily="Segoe UI" Background="WhiteSmoke" BorderThickness="0" Height="16" Margin="0,12" Width="Auto" /> + <Grid Grid.Column="1" Grid.Row="4"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <RadioButton Grid.Column="0" Grid.Row="0" Name="xaml_inches" VerticalAlignment="Center" GroupName="units" Checked="Inches" Margin="5,0,0,0">inches</RadioButton> + <RadioButton Grid.Column="1" Grid.Row="0" Name="xaml_cm" VerticalAlignment="Center" GroupName="units" Checked="Centimeters" Margin="5,0,0,0">cm</RadioButton> + </Grid> + <Grid Background="WhiteSmoke" Grid.Column="1" Grid.Row="5" Visibility="Visible" Margin="0, 0, 0, 0" HorizontalAlignment="Center"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <Button Grid.Column="0" Grid.Row="0" Content="OK" FontSize="12" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center" Width="74" Click="ClickOK" Margin="20,0,0,0"/> + <Button Grid.Column="1" Grid.Row="0" Content="Cancel" FontSize="12" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center" Width="74" Click="ClickCancel" Margin="40,0,0,0"/> + </Grid> + </Grid> + </GroupBox> + </DockPanel> +</Window> diff --git a/platform/windows/gsview/PrintControl.xaml.cs b/platform/windows/gsview/PrintControl.xaml.cs new file mode 100644 index 00000000..c24fad17 --- /dev/null +++ b/platform/windows/gsview/PrintControl.xaml.cs @@ -0,0 +1,697 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; +using System.Printing; +using System.Drawing.Printing; +using System.Runtime.InteropServices; +using System.Windows.Interop; +using System.Text.RegularExpressions; + +namespace gsview +{ + /// <summary> + /// Interaction logic for PrintControl.xaml + /// </summary> + /// + + static class NATIVEWIN + { + public const int IDOK = 1; + public const int IDCANCEL = 2; + public const int DM_OUT_BUFFER = 2; + public const int DM_IN_BUFFER = 8; + public const int DM_IN_PROMPT = 4; + public const int DM_ORIENTATION = 1; + public const int DM_PAPERSIZE = 2; + public const int DM_PAPERLENGTH = 4; + public const int DM_WIDTH = 8; + public const int DMORIENT_PORTRAIT = 1; + public const int DMORIENT_LANDSCAPE = 2; + } + + public enum PrintPages_t + { + RANGE = 2, + CURRENT = 1, + ALL = 0 + } + + public enum PageSubset_t + { + ALL = 0, + ODD = 1, + EVEN = 2 + } + + public enum PageScale_t + { + NONE = 0, + FIT = 1, + } + + public enum Units_t + { + INCHES = 0, + CM = 1 + } + + public class PrintDiagEventArgs : EventArgs + { + public int m_page; + + public PrintDiagEventArgs(int page) + { + m_page = page; + } + } + + public class PrintRanges + { + public List<bool> ToPrint; + public bool HasEvens; + public bool HasOdds; + public int NumberPages; + + public PrintRanges(int number_pages) + { + ToPrint = new List<bool>(number_pages); + NumberPages = 0; + HasEvens = false; + HasOdds = false; + } + + public void InitRange(Match match) + { + NumberPages = 0; + HasEvens = false; + HasOdds = false; + + for (int k = 0; k < ToPrint.Count; k++) + { + if (CheckValue(match, k)) + { + NumberPages = NumberPages + 1; + ToPrint[k] = true; + if ((k+1) % 2 != 0) + HasOdds = true; + else + HasEvens = true; + } + else + ToPrint[k] = false; + } + } + + private bool CheckValue(Match match, int k) + { + return false; + } + } + + public partial class PrintControl : Window + { + private LocalPrintServer m_printServer; + public PrintQueue m_selectedPrinter = null; + String m_status; + PrintPages_t m_pages_setting; + PageSubset_t m_page_subset; + public double m_page_scale; + Units_t m_units; + int m_numpages; + int m_currpage; + PrintCapabilities m_printcap; + public PageSettings m_pagedetails; + TranslateTransform m_trans_pap; + TranslateTransform m_trans_doc; + double m_doc_height; + double m_doc_width; + public bool m_isrotated; + PrintRanges m_range_pages; + public int m_numcopies; + bool m_initdone; + bool m_is64bit; + + /* Callback to main to get preview images */ + internal delegate bool PrintDiagCallBackPreview(object gsObject, PrintDiagEventArgs info); + internal event PrintDiagCallBackPreview PrintDiagUpdatePreview; + /* Callback to perform printing */ + internal delegate void PrintDiagCallBackPrint(object gsObject); + internal event PrintDiagCallBackPrint PrintDiagPrint; + /* Callback to report problems */ + internal delegate void PrintDLLProblem(object gsObject, String mess); + internal event PrintDLLProblem PrintDLLProblemMain; + + /* Helper for displaying the custom printer dialog settings */ + #region DLLInterface + [DllImport("gsprint64.dll", EntryPoint = "ShowPropertiesDialog", CharSet = CharSet.Ansi, + CallingConvention = CallingConvention.StdCall)] + private static extern int ShowPropertiesDialog64(IntPtr hwnd, IntPtr printername, bool show_diag ); + [DllImport("gsprint32.dll", EntryPoint = "ShowPropertiesDialog", CharSet = CharSet.Ansi, + CallingConvention = CallingConvention.StdCall)] + private static extern int ShowPropertiesDialog32(IntPtr hwnd, IntPtr printername, bool show_diag); + + #endregion DLLInterface + + #region DLLErrorCatch + /* In case the DLL is not found we need to wrap the methods up with + * a try/catch. Also select 32 or 64 bit DLL at this time. This + * C# code is compiled as ANYCPU type */ + private int tc_ShowPropertiesDialog(IntPtr hwnd, IntPtr printername, bool show_prop) + { + int code; + + try + { + if (m_is64bit) + code = ShowPropertiesDialog64(hwnd, printername, show_prop); + else + code = ShowPropertiesDialog32(hwnd, printername, show_prop); + } + catch (DllNotFoundException) + { + /* DLL not found */ + String output = "DllNotFoundException: gsprint DLL not found"; + PrintDLLProblemMain(this, output); + return -1; + } + catch (BadImageFormatException) + { + /* Using 32 bit with 64 or vice versa */ + String output = "BadImageFormatException: Incorrect gsprint DLL"; + PrintDLLProblemMain(this, output); + return -1; + } + return code; + } + #endregion DLLErrorCatch + + /* Populate the printers */ + private void InitPrinterList() + { + PrintQueueCollection printQueuesOnLocalServer = + m_printServer.GetPrintQueues(new[] {EnumeratedPrintQueueTypes.Local, EnumeratedPrintQueueTypes.Connections}); + + this.xaml_selPrinter.ItemsSource = printQueuesOnLocalServer; + if (m_selectedPrinter != null) + { + foreach (PrintQueue pq in printQueuesOnLocalServer) + { + if (pq.FullName == m_selectedPrinter.FullName) + { + this.xaml_selPrinter.SelectedItem = pq; + break; + } + } + } + } + + /* Initialize */ + public PrintControl(int num_pages, int curr_page) + { + PrinterSettings ps = new PrinterSettings(); + + this.Closing += new System.ComponentModel.CancelEventHandler(FakeWindowClosing); + InitializeComponent(); + m_printServer = new LocalPrintServer(); + m_selectedPrinter = LocalPrintServer.GetDefaultPrintQueue(); + InitPrinterList(); + ps.PrinterName = m_selectedPrinter.FullName; + m_pagedetails = ps.DefaultPageSettings; + + + xaml_rbAll.IsChecked = true; + m_pages_setting = PrintPages_t.ALL; + m_page_subset = PageSubset_t.ALL; + xaml_Subset.SelectedIndex = (int) m_page_subset; + + xaml_autofit.IsChecked = false; + + xaml_inches.IsChecked = true; + m_units = Units_t.INCHES; + + m_currpage = curr_page; + m_numpages = num_pages; + xaml_pagecount.Text = "1/" + num_pages; + xaml_pageslider.Maximum = num_pages - 1; + + m_printcap = m_selectedPrinter.GetPrintCapabilities(); + + m_trans_pap = new TranslateTransform(0, 0); + m_trans_doc = new TranslateTransform(0, 0); + m_isrotated = false; + + /* Data range case */ + m_range_pages = new PrintRanges(m_numpages); + m_page_scale = 1.0; + + m_numcopies = 1; + m_initdone = false; + m_is64bit = Environment.Is64BitOperatingSystem && + Environment.Is64BitProcess; + } + + void FakeWindowClosing(object sender, System.ComponentModel.CancelEventArgs e) + { + e.Cancel = true; + this.Hide(); + } + + public void RealWindowClosing() + { + this.Closing -= new System.ComponentModel.CancelEventHandler(FakeWindowClosing); + this.Close(); + } + + /* Displays and updates the custom printer dialog settings. One can + * either do this with pinvoke of the various commands in winspool or + * go ahead and handle it in our own dll, which is what I decided to + * do. */ + private void ShowProperties(object sender, RoutedEventArgs e) + { + PrinterChanged(true); + } + + private void PrinterChanged(bool show_prop) + { + if (m_selectedPrinter != null) + { + var ptrNameGC = new GCHandle(); + var temp = System.Text.Encoding.UTF8.GetBytes(m_selectedPrinter.FullName.ToCharArray()); + ptrNameGC = GCHandle.Alloc(temp, GCHandleType.Pinned); + int res = tc_ShowPropertiesDialog(new WindowInteropHelper(this).Handle, ptrNameGC.AddrOfPinnedObject(), show_prop); + ptrNameGC.Free(); + if (res >= 0) + { + PrinterSettings ps = new PrinterSettings(); + ps.PrinterName = m_selectedPrinter.FullName; + m_pagedetails = ps.DefaultPageSettings; + UpdateView(); + } + } + } + + /* Printer selection changed */ + private void selPrinterChanged(object sender, SelectionChangedEventArgs e) + { + m_selectedPrinter = this.xaml_selPrinter.SelectedItem as PrintQueue; + GetPrinterStatus(); + if (m_initdone) + PrinterChanged(false); + } + + /* Printer Status */ + private void GetPrinterStatus() + { + if (m_selectedPrinter.IsBusy) + m_status = "Busy"; + else if (m_selectedPrinter.IsNotAvailable) + m_status = "Not Available"; + else if (m_selectedPrinter.IsOffline) + m_status = "Offline"; + else if (m_selectedPrinter.IsOutOfMemory) + m_status = "Out Of Memory"; + else if (m_selectedPrinter.IsOutOfPaper) + m_status = "Out Of Paper"; + else if (m_selectedPrinter.IsOutputBinFull) + m_status = "Output Bin Full"; + else if (m_selectedPrinter.IsPaperJammed) + m_status = "Paper Jam"; + else if (m_selectedPrinter.IsPaused) + m_status = "Paused"; + else if (m_selectedPrinter.IsPendingDeletion) + m_status = "Paused"; + else if (m_selectedPrinter.IsPrinting) + m_status = "Printing"; + else if (m_selectedPrinter.IsProcessing) + m_status = "Processing"; + else if (m_selectedPrinter.IsWaiting) + m_status = "Waiting"; + else if (m_selectedPrinter.IsWarmingUp) + m_status = "Warming Up"; + else + m_status = "Ready"; + xaml_Status.Text = m_status; + } + + private void Subset_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + /* On current page, only All is allowed */ + m_page_subset = (PageSubset_t) xaml_Subset.SelectedIndex; + if (m_pages_setting == PrintPages_t.CURRENT && + m_page_subset != PageSubset_t.ALL) + xaml_Subset.SelectedIndex = (int) PageSubset_t.ALL; + + /* Only one page, can't use even */ + if (m_pages_setting == PrintPages_t.ALL && + m_page_subset == PageSubset_t.EVEN && + m_numpages == 1) + xaml_Subset.SelectedIndex = (int)PageSubset_t.ALL; + } + + private void AllPages(object sender, RoutedEventArgs e) + { + xaml_invalid.Visibility = System.Windows.Visibility.Collapsed; + xaml_pageslider.Maximum = m_numpages - 1; + xaml_pageslider.Value = m_currpage; + xaml_pagecount.Text = (m_currpage + 1) + "/" + m_numpages; + m_pages_setting = PrintPages_t.ALL; + } + + private void CurrentPage(object sender, RoutedEventArgs e) + { + xaml_invalid.Visibility = System.Windows.Visibility.Collapsed; + m_pages_setting = PrintPages_t.CURRENT; + xaml_pagecount.Text = "1/1"; + xaml_pageslider.Maximum = 0; + xaml_pageslider.Value = 0; + PrintDiagEventArgs info = new PrintDiagEventArgs(m_currpage); + PrintDiagUpdatePreview(this, info); + } + + private void PageRange(object sender, RoutedEventArgs e) + { + xaml_invalid.Visibility = System.Windows.Visibility.Collapsed; + m_pages_setting = PrintPages_t.RANGE; + } + + private void UpdateScaleInfo() + { + /* + if (m_page_scale_type == PageScale_t.NONE) + { + double temp_width_doc = Math.Truncate(m_doc_width * 100.0) / 100.0; + double temp_height_doc = Math.Truncate(m_doc_height * 100.0) / 100.0; + double temp_width_page = m_pagedetails.Bounds.Width / 100; + double temp_height_page = m_pagedetails.Bounds.Height / 100; + + if (m_units == Units_t.CM) + { + temp_height_doc = (Math.Truncate(temp_height_doc * 2.54 * 100) / 100.0); + temp_width_doc = (Math.Truncate(temp_width_doc * 2.54 * 100) / 100.0); + temp_height_page = (Math.Truncate(temp_height_page * 2.54 * 100) / 100.0); + temp_width_page = (Math.Truncate(temp_width_page * 2.54 * 100) / 100.0); + } + xaml_pagesize.Text = "Paper:\t\t" + temp_width_page + " x " + temp_height_page; + xaml_docsize.Text = "Document:\t" + temp_width_doc + " x " + temp_height_doc; ; + xaml_pagesize.Visibility = System.Windows.Visibility.Visible; + xaml_docsize.Visibility = System.Windows.Visibility.Visible; + } + else + { + xaml_pagesize.Visibility = System.Windows.Visibility.Collapsed; + xaml_docsize.Visibility = System.Windows.Visibility.Collapsed; + } + * */ + } + + private void Inches(object sender, RoutedEventArgs e) + { + m_units = Units_t.INCHES; + UpdateUnits(); + UpdateScaleInfo(); + } + + private void Centimeters(object sender, RoutedEventArgs e) + { + m_units = Units_t.CM; + UpdateUnits(); + UpdateScaleInfo(); + } + + public void SetImage(BitmapSource image_in, double doc_height_in, + double doc_width_in) + { + xaml_PreviewImageRect.Visibility = System.Windows.Visibility.Collapsed; + xaml_PreviewGrayRect.Visibility = System.Windows.Visibility.Collapsed; + xaml_PreviewPaper.Visibility = System.Windows.Visibility.Collapsed; + + m_doc_width = doc_width_in; + m_doc_height = doc_height_in; + xaml_ImagePreview.ImageSource = image_in; + xaml_ImagePreviewClip.ImageSource = image_in; + + UpdateView(); + } + + private void UpdateView() + { + /* For our display we compute the page size as well as the paper size */ + /* The max length sets our scaling of each component */ + /* We then determine if any additional scaling is needed or translation + * based upon the settings of m_page_scale_type as well as the autofit + * and scale setting */ + double page_height = m_pagedetails.Bounds.Height; + double page_width = m_pagedetails.Bounds.Width; + double doc_height = m_doc_height * 100; + double doc_width = m_doc_width * 100; + bool autofit = (xaml_autofit.IsChecked == true); + bool center; + /* bool center = (xaml_center.IsChecked == true); */ + double scale_height; + double scale_width; + double max_scale; + double doc_offset_x = 0; + double doc_offset_y = 0; + double pap_offset_x = 0; + double pap_offset_y = 0; + Rect clip_rect; + + center = autofit; /* I may separate these later */ + m_page_scale = 1.0; + m_isrotated = false; + if (autofit && + ((m_pagedetails.Bounds.Height > m_pagedetails.Bounds.Width && doc_height < doc_width) || + (m_pagedetails.Bounds.Height < m_pagedetails.Bounds.Width && doc_height > doc_width))) + { + page_width = m_pagedetails.Bounds.Height; + page_height = m_pagedetails.Bounds.Width; + m_isrotated = true; + } + + /* Scale page data if needed. */ + + if (xaml_autofit.IsChecked == true) + { + scale_height = page_height / doc_height; + scale_width = page_width / doc_width; + max_scale = Math.Min(scale_height, scale_width); + + /* Adjust the doc size to fit in the page */ + doc_height = doc_height * max_scale; + doc_width = doc_width * max_scale; + m_page_scale = max_scale; + } + + /* Now figure out our preview scaling to ensure everything fits + * in the display window */ + double max_height = Math.Max(doc_height, page_height); + double max_width = Math.Max(doc_width, page_width); + double max_length = Math.Max(max_height, max_width); + double previewscale = (double)Constants.MAX_PRINT_PREVIEW_LENGTH / max_length; + + /* Adjust size of everything */ + doc_height = doc_height * previewscale; + doc_width = doc_width * previewscale; + page_height = page_height * previewscale; + page_width = page_width * previewscale; + + xaml_PreviewImageRect.Visibility = System.Windows.Visibility.Collapsed; + xaml_PreviewGrayRect.Visibility = System.Windows.Visibility.Collapsed; + xaml_PreviewPaper.Visibility = System.Windows.Visibility.Collapsed; + + /* Compute any offsets if needed due to centering */ + if (center) + { + if (doc_height > page_height) + pap_offset_y = (doc_height - page_height) / 2.0; + else + doc_offset_y = (page_height - doc_height) / 2.0; + if (doc_width > page_width) + pap_offset_x = (doc_width - page_width) / 2.0; + else + doc_offset_x = (page_width - doc_width) / 2.0; + } + + double offset_y = 0; + + if (!autofit) + offset_y = doc_height - page_height; + + /* See if the paper needs to translate */ + if (page_height < doc_height) + m_trans_pap = new TranslateTransform(pap_offset_x, pap_offset_y + offset_y); + else + m_trans_pap = new TranslateTransform(pap_offset_x, pap_offset_y); + + /* See if the doc needs to translate */ + if (page_height > doc_height) + m_trans_doc = new TranslateTransform(doc_offset_x, doc_offset_y - offset_y); + else + m_trans_doc = new TranslateTransform(doc_offset_x, doc_offset_y); + + /* Page black outer rect */ + xaml_PreviewPaperOuterRect.RenderTransform = m_trans_pap; + xaml_PreviewPaperOuterRect.Height = page_height; + xaml_PreviewPaperOuterRect.Width = page_width; + xaml_PreviewPaperOuterRect.Visibility = System.Windows.Visibility.Visible; + + /* Paper white fill */ + xaml_PreviewPaper.RenderTransform = m_trans_pap; + xaml_PreviewPaper.Height = page_height; + xaml_PreviewPaper.Width = page_width; + xaml_PreviewPaper.Visibility = System.Windows.Visibility.Visible; + + /* The image */ + xaml_PreviewImageRect.RenderTransform = m_trans_doc; + xaml_PreviewImageRect.Height = doc_height; + xaml_PreviewImageRect.Width = doc_width; + xaml_PreviewImageRect.Visibility = System.Windows.Visibility.Visible; + + /* The gray fill (not visible) */ + xaml_PreviewGrayRect.RenderTransform = m_trans_doc; + xaml_PreviewGrayRect.Height = doc_height; + xaml_PreviewGrayRect.Width = doc_width; + xaml_PreviewGrayRect.Visibility = System.Windows.Visibility.Visible; + + /* The visible portion */ + xaml_PreviewImageRectClip.RenderTransform = m_trans_doc; + xaml_PreviewImageRectClip.Height = doc_height; + xaml_PreviewImageRectClip.Width = doc_width; + clip_rect = new Rect(pap_offset_x, pap_offset_y + offset_y, page_width, page_height); + xaml_ImagePreviewClipGeom.Rect = clip_rect; + xaml_PreviewImageRectClip.Visibility = System.Windows.Visibility.Visible; + UpdateSizes(); + UpdateScaleInfo(); + m_initdone = true; + } + + private void PageSelect_DragCompleted(object sender, MouseButtonEventArgs e) + { + if (m_pages_setting == PrintPages_t.CURRENT) + return; + + /* Get the current page view */ + int page = (int) xaml_pageslider.Value; + PrintDiagEventArgs info = new PrintDiagEventArgs(page); + PrintDiagUpdatePreview(this, info); + page = page + 1; + xaml_pagecount.Text = page + "/" + m_numpages; + } + + private void AdjustPageSize() + { + m_printcap = m_selectedPrinter.GetPrintCapabilities(); + } + + private void UpdateSizes() + { + xaml_TopArrowCanvas.RenderTransform = new TranslateTransform(m_trans_pap.X, 0); + xaml_topsize.X2 = xaml_PreviewPaper.Width; + xaml_toprighttoparrow.X1 = xaml_PreviewPaper.Width - 7; + xaml_toprighttoparrow.X2 = xaml_PreviewPaper.Width; + xaml_toprightbottomarrow.X1 = xaml_PreviewPaper.Width - 7; + xaml_toprightbottomarrow.X2 = xaml_PreviewPaper.Width; + + xaml_LeftArrowCanvas.RenderTransform = new TranslateTransform(0, m_trans_pap.Y); + xaml_leftsize.Y2 = xaml_PreviewPaper.Height; + xaml_leftbottomleft.Y1 = xaml_PreviewPaper.Height - 7; + xaml_leftbottomleft.Y2 = xaml_PreviewPaper.Height; + xaml_leftbottomright.Y1 = xaml_PreviewPaper.Height - 7; + xaml_leftbottomright.Y2 = xaml_PreviewPaper.Height; + + xaml_LeftArrowCanvas.Visibility = System.Windows.Visibility.Visible; + xaml_TopArrowCanvas.Visibility = System.Windows.Visibility.Visible; + + UpdateUnits(); + } + + private void UpdateUnits() + { + + double valHeight = m_pagedetails.Bounds.Height; + double valWidth = m_pagedetails.Bounds.Width; + + if (m_units == Units_t.INCHES) + { + if (m_isrotated) + { + xaml_topsizevalue.Text = (Math.Truncate(valHeight) / 100.0).ToString(); + xaml_leftsizevalue.Text = (Math.Truncate(valWidth) / 100.0).ToString(); + } + else + { + xaml_leftsizevalue.Text = (Math.Truncate(valHeight) / 100.0).ToString(); + xaml_topsizevalue.Text = (Math.Truncate(valWidth) / 100.0).ToString(); + } + } + else + { + if (m_isrotated) + { + xaml_topsizevalue.Text = (Math.Truncate(valHeight * 2.54) / 100.0).ToString(); + xaml_leftsizevalue.Text = (Math.Truncate(valWidth * 2.54) / 100.0).ToString(); + } + else + { + xaml_leftsizevalue.Text = (Math.Truncate(valHeight * 2.54) / 100.0).ToString(); + xaml_topsizevalue.Text = (Math.Truncate(valWidth * 2.54) / 100.0).ToString(); + } + } + } + + private void PageNumberEnter(object sender, KeyEventArgs e) + { + if (e.Key == Key.Return) + { + e.Handled = true; + string desired_page = xaml_pagerange.Text; + + Regex rangePattern = new Regex(@"^\s*\d+\s*(\-\s*\d+\s*)?(\,\s*\d+\s*(\-\s*\d+\s*)?)*$"); + + Match m = rangePattern.Match(desired_page); + if (!m.Success) + xaml_invalid.Visibility = System.Windows.Visibility.Visible; + else + { + xaml_invalid.Visibility = System.Windows.Visibility.Collapsed; + } + } + } + + private void ClickOK(object sender, RoutedEventArgs e) + { + PrintDiagPrint(this); + this.Hide(); + } + + private void ClickCancel(object sender, RoutedEventArgs e) + { + this.Hide(); + } + + private void xaml_Copies_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) + { + m_numcopies = (int) e.NewValue; + } + + private void AutoFit_Checked(object sender, RoutedEventArgs e) + { + UpdateView(); + } + + private void AutoFit_Unchecked(object sender, RoutedEventArgs e) + { + UpdateView(); + } + } +} diff --git a/platform/windows/gsview/ghostsharp.cs b/platform/windows/gsview/ghostsharp.cs index 168ce476..099239e9 100644 --- a/platform/windows/gsview/ghostsharp.cs +++ b/platform/windows/gsview/ghostsharp.cs @@ -1047,10 +1047,10 @@ namespace gsview return RunGhostscript(gsparams); } - public gsStatus CreateXPS(String fileName, int resolution, int num_pages) + public gsStatus CreateXPS(String fileName, int resolution, int num_pages, + PrintControl printsettings) { gsParams_t gsparams = new gsParams_t(); - gsparams.init_file = null; gsparams.init_string = null; gsparams.device = gsDevice_t.xpswrite; @@ -1065,6 +1065,19 @@ namespace gsview gsparams.firstpage = -1; gsparams.lastpage = -1; gsparams.currpage = -1; + + if (printsettings != null) + { + double paperheight = printsettings.m_pagedetails.PaperSize.Height; + double paperwidth = printsettings.m_pagedetails.PaperSize.Width; + double width = paperwidth * 72.0 / 100.0; + double height = paperheight * 72.0 / 100.0; + String temp = " -dDEVICEWIDTHPOINTS=" + width + " -dDEVICEHEIGHTPOINTS=" + height + " -dFIXEDMEDIA"; + /* Scale and translate and rotate if needed */ + if (printsettings.xaml_autofit.IsChecked == true) + temp = temp + " -dFitPage"; + gsparams.options = gsparams.options + temp; + } return RunGhostscript(gsparams); } diff --git a/platform/windows/gsview/gsprint.cs b/platform/windows/gsview/gsprint.cs index 27976bc0..7d7c68fd 100644 --- a/platform/windows/gsview/gsprint.cs +++ b/platform/windows/gsview/gsprint.cs @@ -10,6 +10,7 @@ using System.Windows.Media; using System.Windows.Xps; using System.Windows.Xps.Packaging; using System.Windows.Xps.Serialization; +using System.Drawing.Printing; namespace gsview { @@ -74,8 +75,8 @@ namespace gsview PrintDialog dlg = new PrintDialog(); /* Current page and page ranges is going to require a little work */ dlg.PageRangeSelection = PageRangeSelection.AllPages; - //dlg.UserPageRangeEnabled = true; - //dlg.CurrentPageEnabled = true; + dlg.UserPageRangeEnabled = true; + dlg.CurrentPageEnabled = true; dlg.SelectedPagesEnabled = false; m_busy = false; if (dlg.ShowDialog() == true) @@ -84,30 +85,71 @@ namespace gsview } /* Main print entry point */ - public void Print(PrintQueue queu, FixedDocumentSequence fixdoc) + public void Print(PrintQueue queu, FixedDocumentSequence fixdoc, PrintControl printcontrol) { - XpsDocumentWriter docwrite = GetDocWriter(queu); - + XpsDocumentWriter docwrite; + PrintTicket Ticket = SetUpTicket(queu, printcontrol, fixdoc); + docwrite = GetDocWriter(queu); m_busy = true; +#if DISABLED_FOR_NOW docwrite.WritingPrintTicketRequired += - new WritingPrintTicketRequiredEventHandler(PrintTicket); - PrintPages(docwrite, fixdoc); + new WritingPrintTicketRequiredEventHandler(PrintTicket); +#endif + PrintPages(docwrite, fixdoc, Ticket); + } + + /* Set up the print ticket */ + private PrintTicket SetUpTicket(PrintQueue queue, PrintControl printcontrol, FixedDocumentSequence fixdoc) + { + PrintTicket Ticket = new PrintTicket(); + + PageMediaSizeName name = PaperKindToPageMediaSize(printcontrol.m_pagedetails.PaperSize.Kind); + PageMediaSize mediasize = new PageMediaSize(name, printcontrol.m_pagedetails.PaperSize.Width, printcontrol.m_pagedetails.PaperSize.Height); + + /* Media size */ + Ticket.PageMediaSize = mediasize; + /* Scale to fit */ + Ticket.PageScalingFactor = (int)Math.Round(printcontrol.m_page_scale * 100.0); + + System.Windows.Size page_size = new System.Windows.Size(mediasize.Width.Value, mediasize.Height.Value); + DocumentPaginator paginator = fixdoc.DocumentPaginator; + paginator.PageSize = page_size; + + /* Copy Count */ + Ticket.CopyCount = printcontrol.m_numcopies; + + /* Orientation */ + if (printcontrol.m_isrotated) + if (printcontrol.m_pagedetails.Landscape) + Ticket.PageOrientation = PageOrientation.Portrait; + else + Ticket.PageOrientation = PageOrientation.Landscape; + else + if (printcontrol.m_pagedetails.Landscape) + Ticket.PageOrientation = PageOrientation.Landscape; + else + Ticket.PageOrientation = PageOrientation.Portrait; + + System.Printing.ValidationResult result = queue.MergeAndValidatePrintTicket(queue.UserPrintTicket, Ticket); + queue.UserPrintTicket = result.ValidatedPrintTicket; + queue.Commit(); + return result.ValidatedPrintTicket; } /* Send it */ - private void PrintPages(XpsDocumentWriter xpsdw, FixedDocumentSequence fixdoc) + private void PrintPages(XpsDocumentWriter xpsdw, FixedDocumentSequence fixdoc, PrintTicket Ticket) { m_docWriter = xpsdw; xpsdw.WritingCompleted += new WritingCompletedEventHandler(AsyncCompleted); xpsdw.WritingProgressChanged += new WritingProgressChangedEventHandler(AsyncProgress); - xpsdw.WriteAsync(fixdoc); + xpsdw.WriteAsync(fixdoc, Ticket); } public void CancelAsync() { - /* ick. This does not work in windows 8. causes crash */ + /* ick. This does not work in windows 8. causes crash. */ /* https://connect.microsoft.com/VisualStudio/feedback/details/778145/xpsdocumentwriter-cancelasync-cause-crash-in-win8 */ m_docWriter.CancelAsync(); } @@ -142,26 +184,269 @@ namespace gsview PrintUpdate(this, info); } } - +#if DISABLED_FOR_NOW /* Print ticket handling. You can customize for PrintTicketLevel at - FixedDocumentSequencePrintTicket, FixedDocumentPrintTicket, - or FixedPagePrintTicket. We may want to play around with this some */ + FixedDocumentSequencePrintTicket, FixedDocumentPrintTicket, + or FixedPagePrintTicket. We may want to play around with this some */ private void PrintTicket(Object sender, WritingPrintTicketRequiredEventArgs e) { if (e.CurrentPrintTicketLevel == PrintTicketLevel.FixedDocumentSequencePrintTicket) { PrintTicket pts = new PrintTicket(); - pts.PageOrientation = PageOrientation.Portrait; e.CurrentPrintTicket = pts; } } - +#endif /* Create the document write */ private XpsDocumentWriter GetDocWriter(PrintQueue pq) { XpsDocumentWriter xpsdw = PrintQueue.CreateXpsDocumentWriter(pq); return xpsdw; } + + /* Two paths for designating printing = a pain in the ass.*/ + static PageMediaSizeName PaperKindToPageMediaSize(PaperKind paperKind) + { + switch (paperKind) + { + case PaperKind.Custom: + return PageMediaSizeName.Unknown; + case PaperKind.Letter: + return PageMediaSizeName.NorthAmericaLetter; + case PaperKind.Legal: + return PageMediaSizeName.NorthAmericaLegal; + case PaperKind.A4: + return PageMediaSizeName.ISOA4; + case PaperKind.CSheet: + return PageMediaSizeName.NorthAmericaCSheet; + case PaperKind.DSheet: + return PageMediaSizeName.NorthAmericaDSheet; + case PaperKind.ESheet: + return PageMediaSizeName.NorthAmericaESheet; + case PaperKind.LetterSmall: + return PageMediaSizeName.Unknown; + case PaperKind.Tabloid: + return PageMediaSizeName.NorthAmericaTabloid; + case PaperKind.Ledger: + return PageMediaSizeName.Unknown; + case PaperKind.Statement: + return PageMediaSizeName.NorthAmericaStatement; + case PaperKind.Executive: + return PageMediaSizeName.NorthAmericaExecutive; + case PaperKind.A3: + return PageMediaSizeName.ISOA3; + case PaperKind.A4Small: + return PageMediaSizeName.Unknown; + case PaperKind.A5: + return PageMediaSizeName.ISOA5; + case PaperKind.B4: + return PageMediaSizeName.ISOB4; + case PaperKind.B5: + return PageMediaSizeName.Unknown; + case PaperKind.Folio: + return PageMediaSizeName.OtherMetricFolio; + case PaperKind.Quarto: + return PageMediaSizeName.NorthAmericaQuarto; + case PaperKind.Standard10x14: + return PageMediaSizeName.Unknown; + case PaperKind.Standard11x17: + return PageMediaSizeName.Unknown; + case PaperKind.Note: + return PageMediaSizeName.NorthAmericaNote; + case PaperKind.Number9Envelope: + return PageMediaSizeName.NorthAmericaNumber9Envelope; + case PaperKind.Number10Envelope: + return PageMediaSizeName.NorthAmericaNumber10Envelope; + case PaperKind.Number11Envelope: + return PageMediaSizeName.NorthAmericaNumber11Envelope; + case PaperKind.Number12Envelope: + return PageMediaSizeName.NorthAmericaNumber12Envelope; + case PaperKind.Number14Envelope: + return PageMediaSizeName.NorthAmericaNumber14Envelope; + case PaperKind.DLEnvelope: + return PageMediaSizeName.ISODLEnvelope; + case PaperKind.C5Envelope: + return PageMediaSizeName.ISOC5Envelope; + case PaperKind.C3Envelope: + return PageMediaSizeName.ISOC3Envelope; + case PaperKind.C4Envelope: + return PageMediaSizeName.ISOC4Envelope; + case PaperKind.C6Envelope: + return PageMediaSizeName.ISOC6Envelope; + case PaperKind.C65Envelope: + return PageMediaSizeName.ISOC6C5Envelope; + case PaperKind.B4Envelope: + return PageMediaSizeName.ISOB4Envelope; + case PaperKind.B5Envelope: + return PageMediaSizeName.ISOB5Envelope; + case PaperKind.B6Envelope: + return PageMediaSizeName.Unknown; + case PaperKind.ItalyEnvelope: + return PageMediaSizeName.OtherMetricItalianEnvelope; + case PaperKind.MonarchEnvelope: + return PageMediaSizeName.NorthAmericaMonarchEnvelope; + case PaperKind.PersonalEnvelope: + return PageMediaSizeName.NorthAmericaPersonalEnvelope; + case PaperKind.USStandardFanfold: + return PageMediaSizeName.Unknown; + case PaperKind.GermanStandardFanfold: + return PageMediaSizeName.NorthAmericaGermanStandardFanfold; + case PaperKind.GermanLegalFanfold: + return PageMediaSizeName.NorthAmericaGermanLegalFanfold; + case PaperKind.IsoB4: + return PageMediaSizeName.ISOB4; + case PaperKind.JapanesePostcard: + return PageMediaSizeName.JapanHagakiPostcard; + case PaperKind.Standard9x11: + return PageMediaSizeName.Unknown; + case PaperKind.Standard10x11: + return PageMediaSizeName.Unknown; + case PaperKind.Standard15x11: + return PageMediaSizeName.Unknown; + case PaperKind.InviteEnvelope: + return PageMediaSizeName.OtherMetricInviteEnvelope; + case PaperKind.LetterExtra: + return PageMediaSizeName.NorthAmericaLetterExtra; + case PaperKind.LegalExtra: + return PageMediaSizeName.NorthAmericaLegalExtra; + case PaperKind.TabloidExtra: + return PageMediaSizeName.NorthAmericaTabloidExtra; + case PaperKind.A4Extra: + return PageMediaSizeName.ISOA4Extra; + case PaperKind.LetterTransverse: + return PageMediaSizeName.Unknown; + case PaperKind.A4Transverse: + return PageMediaSizeName.Unknown; + case PaperKind.LetterExtraTransverse: + return PageMediaSizeName.Unknown; + case PaperKind.APlus: + return PageMediaSizeName.Unknown; + case PaperKind.BPlus: + return PageMediaSizeName.Unknown; + case PaperKind.LetterPlus: + return PageMediaSizeName.NorthAmericaLetterPlus; + case PaperKind.A4Plus: + return PageMediaSizeName.OtherMetricA4Plus; + case PaperKind.A5Transverse: + return PageMediaSizeName.Unknown; + case PaperKind.B5Transverse: + return PageMediaSizeName.Unknown; + case PaperKind.A3Extra: + return PageMediaSizeName.ISOA3Extra; + case PaperKind.A5Extra: + return PageMediaSizeName.ISOA5Extra; + case PaperKind.B5Extra: + return PageMediaSizeName.ISOB5Extra; + case PaperKind.A2: + return PageMediaSizeName.ISOA2; + case PaperKind.A3Transverse: + return PageMediaSizeName.Unknown; + case PaperKind.A3ExtraTransverse: + return PageMediaSizeName.Unknown; + case PaperKind.JapaneseDoublePostcard: + return PageMediaSizeName.JapanDoubleHagakiPostcard; + case PaperKind.A6: + return PageMediaSizeName.ISOA6; + case PaperKind.JapaneseEnvelopeKakuNumber2: + return PageMediaSizeName.JapanKaku2Envelope; + case PaperKind.JapaneseEnvelopeKakuNumber3: + return PageMediaSizeName.JapanKaku3Envelope; + case PaperKind.JapaneseEnvelopeChouNumber3: + return PageMediaSizeName.JapanChou3Envelope; + case PaperKind.JapaneseEnvelopeChouNumber4: + return PageMediaSizeName.JapanChou4Envelope; + case PaperKind.LetterRotated: + return PageMediaSizeName.NorthAmericaLetterRotated; + case PaperKind.A3Rotated: + return PageMediaSizeName.ISOA3Rotated; + case PaperKind.A4Rotated: + return PageMediaSizeName.ISOA4Rotated; + case PaperKind.A5Rotated: + return PageMediaSizeName.ISOA5Rotated; + case PaperKind.B4JisRotated: + return PageMediaSizeName.JISB4Rotated; + case PaperKind.B5JisRotated: + return PageMediaSizeName.JISB5Rotated; + case PaperKind.JapanesePostcardRotated: + return PageMediaSizeName.JapanHagakiPostcardRotated; + case PaperKind.JapaneseDoublePostcardRotated: + return PageMediaSizeName.JapanHagakiPostcardRotated; + case PaperKind.A6Rotated: + return PageMediaSizeName.ISOA6Rotated; + case PaperKind.JapaneseEnvelopeKakuNumber2Rotated: + return PageMediaSizeName.JapanKaku2EnvelopeRotated; + case PaperKind.JapaneseEnvelopeKakuNumber3Rotated: + return PageMediaSizeName.JapanKaku3EnvelopeRotated; + case PaperKind.JapaneseEnvelopeChouNumber3Rotated: + return PageMediaSizeName.JapanChou3EnvelopeRotated; + case PaperKind.JapaneseEnvelopeChouNumber4Rotated: + return PageMediaSizeName.JapanChou4EnvelopeRotated; + case PaperKind.B6Jis: + return PageMediaSizeName.JISB6; + case PaperKind.B6JisRotated: + return PageMediaSizeName.JISB6Rotated; + case PaperKind.Standard12x11: + return PageMediaSizeName.Unknown; + case PaperKind.JapaneseEnvelopeYouNumber4: + return PageMediaSizeName.JapanYou4Envelope; + case PaperKind.JapaneseEnvelopeYouNumber4Rotated: + return PageMediaSizeName.JapanYou4EnvelopeRotated; + case PaperKind.Prc16K: + return PageMediaSizeName.PRC16K; + case PaperKind.Prc32K: + return PageMediaSizeName.PRC32K; + case PaperKind.Prc32KBig: + return PageMediaSizeName.PRC32KBig; + case PaperKind.PrcEnvelopeNumber1: + return PageMediaSizeName.PRC1Envelope; + case PaperKind.PrcEnvelopeNumber2: + return PageMediaSizeName.PRC2Envelope; + case PaperKind.PrcEnvelopeNumber3: + return PageMediaSizeName.PRC3Envelope; + case PaperKind.PrcEnvelopeNumber4: + return PageMediaSizeName.PRC4Envelope; + case PaperKind.PrcEnvelopeNumber5: + return PageMediaSizeName.PRC5Envelope; + case PaperKind.PrcEnvelopeNumber6: + return PageMediaSizeName.PRC6Envelope; + case PaperKind.PrcEnvelopeNumber7: + return PageMediaSizeName.PRC7Envelope; + case PaperKind.PrcEnvelopeNumber8: + return PageMediaSizeName.PRC8Envelope; + case PaperKind.PrcEnvelopeNumber9: + return PageMediaSizeName.PRC9Envelope; + case PaperKind.PrcEnvelopeNumber10: + return PageMediaSizeName.PRC10Envelope; + case PaperKind.Prc16KRotated: + return PageMediaSizeName.PRC16KRotated; + case PaperKind.Prc32KRotated: + return PageMediaSizeName.PRC32KRotated; + case PaperKind.Prc32KBigRotated: + return PageMediaSizeName.Unknown; + case PaperKind.PrcEnvelopeNumber1Rotated: + return PageMediaSizeName.PRC1EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber2Rotated: + return PageMediaSizeName.PRC2EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber3Rotated: + return PageMediaSizeName.PRC3EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber4Rotated: + return PageMediaSizeName.PRC4EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber5Rotated: + return PageMediaSizeName.PRC5EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber6Rotated: + return PageMediaSizeName.PRC6EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber7Rotated: + return PageMediaSizeName.PRC7EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber8Rotated: + return PageMediaSizeName.PRC8EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber9Rotated: + return PageMediaSizeName.PRC9EnvelopeRotated; + case PaperKind.PrcEnvelopeNumber10Rotated: + return PageMediaSizeName.PRC10EnvelopeRotated; + default: + throw new ArgumentOutOfRangeException("paperKind"); + } + } } } diff --git a/platform/windows/gsview/gsview.csproj b/platform/windows/gsview/gsview.csproj index 31f40f51..b57c86f0 100644 --- a/platform/windows/gsview/gsview.csproj +++ b/platform/windows/gsview/gsview.csproj @@ -111,6 +111,9 @@ <Compile Include="Password.xaml.cs"> <DependentUpon>Password.xaml</DependentUpon> </Compile> + <Compile Include="PrintControl.xaml.cs"> + <DependentUpon>PrintControl.xaml</DependentUpon> + </Compile> <Compile Include="RectList.cs" /> <Compile Include="Selection.xaml.cs"> <DependentUpon>Selection.xaml</DependentUpon> @@ -163,6 +166,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="PrintControl.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Selection.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/platform/windows/gsview/mudocument.cs b/platform/windows/gsview/mudocument.cs index 291a424e..e41de6e3 100644 --- a/platform/windows/gsview/mudocument.cs +++ b/platform/windows/gsview/mudocument.cs @@ -159,6 +159,11 @@ namespace gsview private static extern IntPtr mCreateDisplayListText64(IntPtr ctx, int page_num, ref int page_width, ref int page_height, ref IntPtr text, ref int length); + [DllImport("mupdfnet64.dll", EntryPoint = "mReleaseLists", CharSet = CharSet.Auto, + CallingConvention = CallingConvention.StdCall)] + private static extern void mReleaseLists64(IntPtr ctx, IntPtr dlist, + IntPtr annot_dlist); + [DllImport("mupdfnet64.dll", EntryPoint = "mRenderPageMT", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] private static extern int mRenderPageMT64(IntPtr ctx, IntPtr dlist, @@ -308,6 +313,11 @@ namespace gsview private static extern IntPtr mCreateDisplayListText32(IntPtr ctx, int page_num, ref int page_width, ref int page_height, ref IntPtr text, ref int length); + [DllImport("mupdfnet32.dll", EntryPoint = "mReleaseLists", CharSet = CharSet.Auto, + CallingConvention = CallingConvention.StdCall)] + private static extern void mReleaseLists32(IntPtr ctx, IntPtr dlist, + IntPtr annot_dlist); + [DllImport("mupdfnet32.dll", EntryPoint = "mRenderPageMT", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] private static extern int mRenderPageMT32(IntPtr ctx, IntPtr dlist, @@ -805,6 +815,33 @@ namespace gsview return output; } + private void tc_mReleaseLists(IntPtr ctx, IntPtr dlist, IntPtr annot_dlist) + { + int output; + try + { + if (is64bit) + mReleaseLists64(ctx, dlist, annot_dlist); + else + mReleaseLists32(ctx, dlist, annot_dlist); + } + catch (DllNotFoundException) + { + /* DLL not found */ + String err = "DllNotFoundException: MuPDF DLL not found 16"; + mupdfDLLProblemMain(this, err); + return; + } + catch (BadImageFormatException) + { + /* Using 32 bit with 64 or vice versa */ + String err = "BadImageFormatException: Incorrect MuPDF DLL"; + mupdfDLLProblemMain(this, err); + return; + } + return; + } + private int tc_mRenderPageMT(IntPtr ctx, IntPtr dlist, IntPtr annot_dlist, int page_width, int page_height, Byte[] bmp_data, int bmp_width, int bmp_height, double scale, bool flipy) @@ -1375,7 +1412,15 @@ namespace gsview textchars.Height = height; textchars.Scale = 1.0; textchars.Color = linecolor; - textchars.character = System.Convert.ToChar(character).ToString(); + try + { + textchars.character = System.Convert.ToChar(character).ToString(); + } + catch (OverflowException) + { + textchars.character = " "; /* Something went wrong here. Use blank space */ + Console.WriteLine("{0} is outside the range of the Char data type.", character); + } blocks[kk].TextLines[jj].TextCharacters.Add(textchars); } } @@ -1409,6 +1454,8 @@ namespace gsview } code = tc_mRenderPageMT(mu_object, dlist, annot_dlist, page_width, page_height, bmp_data, bmp_width, bmp_height, scale, flipy); + /* We are done with the display lists */ + tc_mReleaseLists(mu_object, dlist, annot_dlist); } else { diff --git a/platform/windows/gsview/nsis/gsview.nsi b/platform/windows/gsview/nsis/gsview.nsi new file mode 100644 index 00000000..f2bba6e9 --- /dev/null +++ b/platform/windows/gsview/nsis/gsview.nsi @@ -0,0 +1,552 @@ +; Copyright (C) 2015 Artifex Software, Inc. +; All Rights Reserved. +; +; This software is provided AS-IS with no warranty, either express or +; implied. +; +; This software is distributed under license and may not be copied, +; modified or distributed except as expressly authorized under the terms +; of the license contained in the file LICENSE in this distribution. +; +; Refer to licensing information at http://www.artifex.com or contact +; Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, +; CA 94903, U.S.A., +1(415)492-9861, for further information. +; + +; This script should be compiled with : +; makensis -NOCD nsis/gsview.nsi + +!ifndef TARGET +!define TARGET gsview_setup +!endif + +!ifndef VERSION +!define VERSION 6.0 +!endif + +!ifndef PRODUCT_NAME +!define PRODUCT_NAME gsview +!endif + +SetCompressor /SOLID /FINAL lzma +XPStyle on +CRCCheck on + +!include "nsDialogs.nsh" +; modern user interface +!include "MUI2.nsh" +; for logic marcos that occur at run time. Not compile time +!include "LogicLib.nsh" +; for detecting if running on x64 machine. +!include "x64.nsh" + +; Macros for file association. +; to make sure that we update the proper locations (user vs root for example +; as well as changes needed for Windows 8.x) +!macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND TOAST SETDEFAULT + ; Backup the previously associated file class + + ${If} ${SETDEFAULT} == "1" + ;DetailPrint "ReadRegStr HKCU Software\Classes\ $R0" + ReadRegStr $R0 HKCU "Software\Classes\.${EXT}" "" + + ;DetailPrint "WriteRegStr of backup in HKCU" + WriteRegStr HKCU "Software\Classes\.${EXT}" "${FILECLASS}_backup" "$R0" + + ;DetailPrint "WriteRegStr of fileclass in HKCU" + WriteRegStr HKCU "Software\Classes\.${EXT}" "" "${FILECLASS}" + + ; If this key is present (as it in windows 8) then we need to do this to get the + ; proper file type icon rather than just the application icon for the file type. + ${If} ${TOAST} == '1' + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts\" "${FILECLASS}_" 0 + ${EndIf} + ${EndIf} + + ; The icon mapping should not go in HKCR but in HKLM per MS best practices + WriteRegStr HKLM "Software\Classes\${FILECLASS}" "" `${DESCRIPTION}` + WriteRegStr HKLM "Software\Classes\${FILECLASS}\DefaultIcon" "" `${ICON}` + WriteRegStr HKLM "Software\Classes\${FILECLASS}\shell" "" "open" + WriteRegStr HKLM "Software\Classes\${FILECLASS}\shell\open" "" `${COMMANDTEXT}` + WriteRegStr HKLM "Software\Classes\${FILECLASS}\shell\open\command" "" `${COMMAND}` +!macroend + +!macro APP_UNASSOCIATE EXT FILECLASS TOAST + ; Get the previously associated file class + ReadRegStr $R0 HKCU "Software\Classes\.${EXT}" `${FILECLASS}_backup` + WriteRegStr HKCU "Software\Classes\.${EXT}" "" "$R0" + + ; Delete backup value + DeleteRegValue HKCU "Software\Classes\.${EXT}" "${FILECLASS}_backup" + + ; If this key is present (as it in windows 8) then attempt to clean up. System + ; seems to add in other entries here that I did not do depending upon what the + ; type of associations the user has done. + ${If} ${TOAST} == '1' + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts\" "${FILECLASS}_" + ${EndIf} + + ; Remove icon mapping + DeleteRegKey HKLM `Software\Classes\${FILECLASS}` +!macroend + +; defines for use with SHChangeNotify +!ifdef SHCNE_ASSOCCHANGED +!undef SHCNE_ASSOCCHANGED +!endif +!define SHCNE_ASSOCCHANGED 0x08000000 +!ifdef SHCNF_FLUSH +!undef SHCNF_FLUSH +!endif +!define SHCNF_FLUSH 0x1000 + +!macro UPDATEFILEASSOC + System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)" +!macroend + +!define MUI_FINISHPAGE_RUN "$INSTDIR\bin\gsview.exe" +!define MUI_FINISHPAGE_LINK "Visit the Ghostscript web site" +!define MUI_FINISHPAGE_LINK_LOCATION http://www.ghostscript.com/ + +; Order of page appearance +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "LICENSE" +!insertmacro MUI_PAGE_DIRECTORY +Page custom fnc_association_Show fnc_association_Done +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_LANGUAGE "English" + +!searchparse /ignorecase /noerrors "${TARGET}" w WINTYPE +!echo "Building ${WINTYPE}-bit installer" + +Name "gsview" +OutFile "${TARGET}_${VERSION}.exe" +Icon Resources\gsview_app.ico +UninstallIcon Resources\gsview_app.ico + +; We need to have then run this as an adminstrator. Otherwise there are +; issues with the icons for the various file types and getting the "Open With.." +; items populated + +RequestExecutionLevel admin + +; Some default compiler settings (uncomment and change at will): +; SetCompress auto ; (can be off or force) +; SetDatablockOptimize on ; (can be off) +; CRCCheck on ; (can be off) +; AutoCloseWindow false ; (can be true for the window go away automatically at end) +; ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable) +; SetDateSave off ; (can be on to have files restored to their orginal date) + +BrandingText "Artifex Software Inc." +LicenseText "You must agree to this license before installing." +LicenseData "LICENSE" + +; It is OK to use $PROGRAMFILES64 on x86 +; you can use $PROGRAMFILES64 for all platforms. It will go to default +InstallDir "$PROGRAMFILES64\Artifex Software\gsview${VERSION}" + +DirText "Select the directory to install gsview in:" + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Association dialog: Partially created with CoolSoft NSIS Dialog Designer. +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +Var hCtl_association +Var hCtl_association_jpg +Var hCtl_association_png +Var hCtl_association_xps +Var hCtl_association_oxps +Var hCtl_association_eps +Var hCtl_association_ps +Var hCtl_association_cbz +Var hCtl_association_pdf +Var jpg +Var png +Var xps +Var oxps +Var eps +Var ps +Var cbz +Var pdf + +; dialog create function +Function fnc_association_Create + + ; === association (type: Dialog) === + nsDialogs::Create 1018 + Pop $hCtl_association + ${If} $hCtl_association == error + Abort + ${EndIf} + !insertmacro MUI_HEADER_TEXT "File Type Associations" "Select.." + + ; === jpg (type: Checkbox) === + ${NSD_CreateCheckbox} 192.2u 57.85u 78.99u 23.38u "jpg" + Pop $hCtl_association_jpg + ${NSD_Check} $hCtl_association_jpg + + ; === png (type: Checkbox) === + ${NSD_CreateCheckbox} 192.2u 43.69u 68.46u 14.77u "png" + Pop $hCtl_association_png + ${NSD_Check} $hCtl_association_png + + ; === xps (type: Checkbox) === + ${NSD_CreateCheckbox} 123.09u 45.54u 70.43u 11.69u "xps" + Pop $hCtl_association_xps + ${NSD_Check} $hCtl_association_xps + + ; === oxps (type: Checkbox) === + ${NSD_CreateCheckbox} 123.09u 57.85u 73.06u 23.38u "oxps" + Pop $hCtl_association_oxps + ${NSD_Check} $hCtl_association_oxps + + ; === eps (type: Checkbox) === + ${NSD_CreateCheckbox} 50.68u 80.62u 68.46u 14.77u "eps" + Pop $hCtl_association_eps + ${NSD_Check} $hCtl_association_eps + + ; === ps (type: Checkbox) === + ${NSD_CreateCheckbox} 50.68u 62.15u 62.53u 14.77u "ps" + Pop $hCtl_association_ps + ${NSD_Check} $hCtl_association_ps + + ; === cbz (type: Checkbox) === + ${NSD_CreateCheckbox} 192.2u 80.62u 68.46u 14.77u "cbz" + Pop $hCtl_association_cbz + ${NSD_Check} $hCtl_association_cbz + + ; === pdf (type: Checkbox) === + ${NSD_CreateCheckbox} 50.68u 43.69u 68.46u 14.77u "pdf" + Pop $hCtl_association_pdf + ${NSD_Check} $hCtl_association_pdf + +FunctionEnd + +; Association dialog show function +Function fnc_association_Show + Call fnc_association_Create + nsDialogs::Show $hCtl_association +FunctionEnd + +; Association dialog done function +Function fnc_association_Done + ${NSD_GetState} $hCtl_association_jpg $0 + ${If} $0 <> 0 + StrCpy $jpg "1" + ${Else} + StrCpy $jpg "0" + ${EndIf} + + ${NSD_GetState} $hCtl_association_xps $0 + ${If} $0 <> 0 + StrCpy $xps "1" + ${Else} + StrCpy $xps "0" + ${EndIf} + + ${NSD_GetState} $hCtl_association_oxps $0 + ${If} $0 <> 0 + StrCpy $oxps "1" + ${Else} + StrCpy $oxps "0" + ${EndIf} + + ${NSD_GetState} $hCtl_association_png $0 + ${If} $0 <> 0 + StrCpy $png "1" + ${Else} + StrCpy $png "0" + ${EndIf} + + ${NSD_GetState} $hCtl_association_eps $0 + ${If} $0 <> 0 + StrCpy $eps "1" + ${Else} + StrCpy $eps "0" + ${EndIf} + + ${NSD_GetState} $hCtl_association_ps $0 + ${If} $0 <> 0 + StrCpy $ps "1" + ${Else} + StrCpy $ps "0" + ${EndIf} + + ${NSD_GetState} $hCtl_association_cbz $0 + ${If} $0 <> 0 + StrCpy $cbz "1" + ${Else} + StrCpy $cbz "0" + ${EndIf} + + ${NSD_GetState} $hCtl_association_pdf $0 + ${If} $0 <> 0 + StrCpy $pdf "1" + ${Else} + StrCpy $pdf "0" + ${EndIf} + +FunctionEnd + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Main Install Section +; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +Section "" ; (default section) + + ; First check if we have the proper .net installed + Call CheckAndDownloadDotNet45 + + SetOutPath "$INSTDIR" + CreateDirectory "$INSTDIR\bin" + CreateDirectory "$INSTDIR\resources" + ; add files / whatever that need to be installed here. + ${If} ${RunningX64} + File /oname=bin\gsprint64.dll .\bin\Release\gsprint64.dll + File /oname=bin\mupdfnet64.dll .\bin\Release\mupdfnet64.dll + File /oname=bin\gsdll64.dll .\gslib\gsdll64.dll + ${Else} + File /oname=bin\gsprint32.dll .\bin\Release\gsprint32.dll + File /oname=bin\mupdfnet32.dll .\bin\Release\mupdfnet32.dll + File /oname=bin\gsdll32.dll .\gslib\gsdll32.dll + ${EndIf} + File /oname=bin\gsview.exe .\bin\Release\gsview.exe + File /oname=resources\pageCBZ.ico .\Resources\pageCBZ.ico + File /oname=resources\pageEPS.ico .\Resources\pageEPS.ico + File /oname=resources\pagePS.ico .\Resources\pagePS.ico + File /oname=resources\pagePDF.ico .\Resources\pagePDF.ico + File /oname=resources\pageXPS.ico .\Resources\pageXPS.ico + File /oname=resources\pageOXPS.ico .\Resources\pageOXPS.ico + File /oname=resources\pagePNG.ico .\Resources\pagePNG.ico + File /oname=resources\pageJPG.ico .\Resources\pageJPG.ico + + ${If} ${RunningX64} + SetRegView 64 + ${EndIf} + WriteRegStr HKEY_LOCAL_MACHINE "Software\Artifex Software\gsview\${VERSION}" "" "$INSTDIR" + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\gsview ${VERSION}" "DisplayName" "gsview" + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\gsview ${VERSION}" "UninstallString" '"$INSTDIR\uninstgsview.exe"' + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\gsview ${VERSION}" "Publisher" "Artifex Software Inc." + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\gsview ${VERSION}" "HelpLink" "http://www.ghostscript.com/" + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\gsview ${VERSION}" "URLInfoAbout" "http://www.ghostscript.com/" + WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\gsview ${VERSION}" "DisplayVersion" "${VERSION}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gsview ${VERSION}" "NoRepair" "1" + + ; Check if Toast directory is present before doing the associations + StrCpy $0 0 + StrCpy $2 0 + ${Do} + EnumRegKey $1 HKCU Software\Microsoft\Windows\CurrentVersion $0 + ${If} $1 == 'ApplicationAssociationToasts' + StrCpy $2 1 + StrCpy $1 "" ; End it now as we have found the entry + ${EndIf} + IntOp $0 $0 + 1 + ${LoopUntil} $1 == "" + + ; The file associations + !insertmacro APP_ASSOCIATE "pdf" "gsview.pdf" "PDF Document" "$INSTDIR\resources\pagePDF.ico" "Open" "$INSTDIR\bin\gsview.exe $\"%1$\"" $2 $pdf + !insertmacro APP_ASSOCIATE "ps" "gsview.ps" "Postscript Document" "$INSTDIR\resources\pagePS.ico" "Open" "$INSTDIR\bin\gsview.exe $\"%1$\"" $2 $ps + !insertmacro APP_ASSOCIATE "xps" "gsview.xps" "XPS Document" "$INSTDIR\resources\pageXPS.ico" "Open" "$INSTDIR\bin\gsview.exe $\"%1$\"" $2 $xps + !insertmacro APP_ASSOCIATE "oxps" "gsview.oxps" "Open XPS Document" "$INSTDIR\resources\pageOXPS.ico" "Open" "$INSTDIR\bin\gsview.exe $\"%1$\"" $2 $oxps + !insertmacro APP_ASSOCIATE "cbz" "gsview.cbz" "CBZ Document" "$INSTDIR\resources\pageCBZ.ico" "Open" "$INSTDIR\bin\gsview.exe $\"%1$\"" $2 $cbz + !insertmacro APP_ASSOCIATE "jpg" "gsview.jpg" "JPG Image" "$INSTDIR\resources\pageJPG.ico" "Open" "$INSTDIR\bin\gsview.exe $\"%1$\"" $2 $jpg + !insertmacro APP_ASSOCIATE "png" "gsview.png" "PNG Image" "$INSTDIR\resources\pagePNG.ico" "Open" "$INSTDIR\bin\gsview.exe $\"%1$\"" $2 $png + !insertmacro APP_ASSOCIATE "eps" "gsview.eps" "Encapsulated Postscript" "$INSTDIR\resources\pageEPS.ico" "Open" "$INSTDIR\bin\gsview.exe $\"%1$\"" $2 $eps + !insertmacro UPDATEFILEASSOC + + ; write out uninstaller + WriteUninstaller "$INSTDIR\uninstgsview.exe" +SectionEnd ; end of default section + +Function .onInstSuccess + SetShellVarContext all + CreateDirectory "$SMPROGRAMS\gsview" + CreateShortCut "$SMPROGRAMS\gsview\gsview ${VERSION}.LNK" "$INSTDIR\bin\gsview.exe" + CreateShortCut "$SMPROGRAMS\gsview\Uninstall gsview ${VERSION}.LNK" "$INSTDIR\uninstgsview.exe" +FunctionEnd + +Function .onInit + ; Again, check that we they are doing a run as administrator + UserInfo::GetAccountType + pop $0 + ${If} $0 != "admin" ;Require admin rights + MessageBox mb_iconstop "Administrator rights required!" + SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + Quit + ${EndIf} + + System::Call 'kernel32::CreateMutexA(i 0, i 0, t "GhostscriptInstaller") i .r1 ?e' + Pop $R0 + StrCmp $R0 0 +3 + MessageBox MB_OK "The gsview installer is already running." /SD IDOK + Abort +FunctionEnd + +Function Un.onInit + ${If} ${RunningX64} + SetRegView 64 + ${EndIf} +FunctionEnd + +; begin uninstall settings/section +UninstallText "This will uninstall gsview from your system" + +Section Uninstall + ; add delete commands to delete whatever files/registry keys/etc you installed here. + SetShellVarContext all + Delete "$SMPROGRAMS\gsview\gsview ${VERSION}.LNK" + Delete "$SMPROGRAMS\gsview\Uninstall gsview ${VERSION}.LNK" + RMDir "$SMPROGRAMS\gsview" + Delete "$INSTDIR\uninstgsview.exe" + + ${If} ${RunningX64} + SetRegView 64 + ${EndIf} + ; Check if Toast directory is present before doing the unassociations + StrCpy $0 0 + StrCpy $2 0 + ${Do} + EnumRegKey $1 HKCU Software\Microsoft\Windows\CurrentVersion $0 + ${If} $1 == 'ApplicationAssociationToasts' + StrCpy $2 1 + StrCpy $1 "" + ${EndIf} + IntOp $0 $0 + 1 + ${LoopUntil} $1 == "" + + !insertmacro APP_UNASSOCIATE "pdf" "gsview.pdf" $2 + !insertmacro APP_UNASSOCIATE "ps" "gsview.ps" $2 + !insertmacro APP_UNASSOCIATE "xps" "gsview.xps" $2 + !insertmacro APP_UNASSOCIATE "oxps" "gsview.oxps" $2 + !insertmacro APP_UNASSOCIATE "cbz" "gsview.cbz" $2 + !insertmacro APP_UNASSOCIATE "jpg" "gsview.jpg" $2 + !insertmacro APP_UNASSOCIATE "png" "gsview.png" $2 + + DeleteRegKey HKEY_CURRENT_USER "Software\Artifex Software\GSview ${Version}" + + DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Artifex Software\gsview\${VERSION}" + DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\gsview ${VERSION}" + DeleteRegKey HKEY_LOCAL_MACHINE "Software\gsview\${VERSION}" + RMDir /r "$INSTDIR\doc" + Delete "$INSTDIR\bin\gsprint${WINTYPE}.dll" + Delete "$INSTDIR\bin\mupdfnet{WINTYPE}.dll" + Delete "$INSTDIR\bin\gsdll${WINTYPE}.dll" + Delete "$INSTDIR\bin\gsview.exe" + Delete "$INSTDIR\resources\pageCBZ.ico" + Delete "$INSTDIR\resources\pageEPS.ico" + Delete "$INSTDIR\resources\pageJPG.ico" + Delete "$INSTDIR\resources\pageOXPS.ico" + Delete "$INSTDIR\resources\pagePDF.ico" + Delete "$INSTDIR\resources\pagePS.ico" + Delete "$INSTDIR\resources\pageXPS.ico" + Delete "$INSTDIR\resources\pagePNG.ico" + RMDir "$INSTDIR\resources" + RMDir "$INSTDIR\bin" + RMDir "$INSTDIR" +SectionEnd ; end of uninstall section + +; From http://nsis.sourceforge.net/Download_and_Install_dotNET_45 +Function CheckAndDownloadDotNet45 + # Let's see if the user has the .NET Framework 4.5 installed on their system or not + # Remember: you need Vista SP2 or 7 SP1. It is built in to Windows 8, and not needed + # In case you're wondering, running this code on Windows 8 will correctly return is_equal + # or is_greater (maybe Microsoft releases .NET 4.5 SP1 for example) + + # Set up our Variables + Var /GLOBAL dotNET45IsThere + Var /GLOBAL dotNET_CMD_LINE + Var /GLOBAL EXIT_CODE + + # We are reading a version release DWORD that Microsoft says is the documented + # way to determine if .NET Framework 4.5 is installed + ReadRegDWORD $dotNET45IsThere HKLM "SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" "Release" + IntCmp $dotNET45IsThere 378389 is_equal is_less is_greater + + is_equal: + Goto done_compare_not_needed + is_greater: + # Useful if, for example, Microsoft releases .NET 4.5 SP1 + # We want to be able to simply skip install since it's not + # needed on this system + Goto done_compare_not_needed + is_less: + Goto done_compare_needed + + done_compare_needed: + #.NET Framework 4.5 install is *NEEDED* + + # Microsoft Download Center EXE: + # Web Bootstrapper: http://go.microsoft.com/fwlink/?LinkId=225704 + # Full Download: http://go.microsoft.com/fwlink/?LinkId=225702 + + # Setup looks for components\dotNET45Full.exe relative to the install EXE location + # This allows the installer to be placed on a USB stick (for computers without internet connections) + # If the .NET Framework 4.5 installer is *NOT* found, Setup will connect to Microsoft's website + # and download it for you + + # Reboot Required with these Exit Codes: + # 1641 or 3010 + + # Command Line Switches: + # /showrmui /passive /norestart + + # Silent Command Line Switches: + # /q /norestart + + # Let's see if the user is doing a Silent install or not + IfSilent is_quiet is_not_quiet + + is_quiet: + StrCpy $dotNET_CMD_LINE "/q /norestart" + Goto LookForLocalFile + is_not_quiet: + StrCpy $dotNET_CMD_LINE "/showrmui /passive /norestart" + Goto LookForLocalFile + + LookForLocalFile: + # Let's see if the user stored the Full Installer + IfFileExists "$EXEPATH\components\dotNET45Full.exe" do_local_install do_network_install + + do_local_install: + # .NET Framework found on the local disk. Use this copy + ExecWait '"$EXEPATH\components\dotNET45Full.exe" $dotNET_CMD_LINE' $EXIT_CODE + Goto is_reboot_requested + # Now, let's Download the .NET + + do_network_install: + Var /GLOBAL dotNetDidDownload + NSISdl::download "http://go.microsoft.com/fwlink/?LinkId=225704" "$TEMP\dotNET45Web.exe" $dotNetDidDownload + StrCmp $dotNetDidDownload success fail + + success: + ExecWait '"$TEMP\dotNET45Web.exe" $dotNET_CMD_LINE' $EXIT_CODE + Goto is_reboot_requested + + fail: + MessageBox MB_OK|MB_ICONEXCLAMATION "Unable to download .NET Framework. ${PRODUCT_NAME} will be installed, but will not function without the Framework!" + Goto done_dotNET_function + + # $EXIT_CODE contains the return codes. 1641 and 3010 means a Reboot has been requested + is_reboot_requested: + ${If} $EXIT_CODE = 1641 + ${OrIf} $EXIT_CODE = 3010 + SetRebootFlag true + ${EndIf} + + done_compare_not_needed: + # Done dotNET Install + Goto done_dotNET_function + + #exit the function + done_dotNET_function: + + FunctionEnd +; eof diff --git a/platform/windows/libmupdf/libmupdf.vcxproj b/platform/windows/libmupdf/libmupdf.vcxproj index bb4ef639..78df5e8d 100644 --- a/platform/windows/libmupdf/libmupdf.vcxproj +++ b/platform/windows/libmupdf/libmupdf.vcxproj @@ -115,7 +115,6 @@ <ClCompile Include="..\..\..\source\fitz\draw-path.c" /> <ClCompile Include="..\..\..\source\fitz\draw-scale-simple.c" /> <ClCompile Include="..\..\..\source\fitz\draw-unpack.c" /> - <ClCompile Include="..\..\..\source\fitz\dtoa.c" /> <ClCompile Include="..\..\..\source\fitz\error.c" /> <ClCompile Include="..\..\..\source\fitz\filter-basic.c" /> <ClCompile Include="..\..\..\source\fitz\filter-dct.c" /> @@ -126,6 +125,7 @@ <ClCompile Include="..\..\..\source\fitz\filter-lzw.c" /> <ClCompile Include="..\..\..\source\fitz\filter-predict.c" /> <ClCompile Include="..\..\..\source\fitz\font.c" /> + <ClCompile Include="..\..\..\source\fitz\ftoa.c" /> <ClCompile Include="..\..\..\source\fitz\function.c" /> <ClCompile Include="..\..\..\source\fitz\geometry.c" /> <ClCompile Include="..\..\..\source\fitz\getopt.c" /> @@ -159,12 +159,14 @@ <ClCompile Include="..\..\..\source\fitz\stream-open.c" /> <ClCompile Include="..\..\..\source\fitz\stream-read.c" /> <ClCompile Include="..\..\..\source\fitz\string.c" /> + <ClCompile Include="..\..\..\source\fitz\strtod.c" /> <ClCompile Include="..\..\..\source\fitz\svg-device.c" /> <ClCompile Include="..\..\..\source\fitz\text.c" /> <ClCompile Include="..\..\..\source\fitz\time.c" /> <ClCompile Include="..\..\..\source\fitz\trace-device.c" /> <ClCompile Include="..\..\..\source\fitz\transition.c" /> <ClCompile Include="..\..\..\source\fitz\ucdn.c" /> + <ClCompile Include="..\..\..\source\fitz\unzip.c" /> <ClCompile Include="..\..\..\source\fitz\xml.c" /> <ClCompile Include="..\..\..\source\img\muimage.c" /> <ClCompile Include="..\..\..\source\pdf\pdf-annot.c" /> diff --git a/platform/windows/libmupdf/libmupdf.vcxproj.filters b/platform/windows/libmupdf/libmupdf.vcxproj.filters index d90eb1d5..62f050df 100644 --- a/platform/windows/libmupdf/libmupdf.vcxproj.filters +++ b/platform/windows/libmupdf/libmupdf.vcxproj.filters @@ -635,7 +635,13 @@ <ClCompile Include="..\..\..\source\xps\xps-zip.c"> <Filter>xps</Filter> </ClCompile> - <ClCompile Include="..\..\..\source\fitz\dtoa.c"> + <ClCompile Include="..\..\..\source\fitz\unzip.c"> + <Filter>fitz</Filter> + </ClCompile> + <ClCompile Include="..\..\..\source\fitz\ftoa.c"> + <Filter>fitz</Filter> + </ClCompile> + <ClCompile Include="..\..\..\source\fitz\strtod.c"> <Filter>fitz</Filter> </ClCompile> </ItemGroup> diff --git a/platform/windows/libmupdf_winRT.vcxproj b/platform/windows/libmupdf_winRT.vcxproj index 51037897..525a59d1 100644 --- a/platform/windows/libmupdf_winRT.vcxproj +++ b/platform/windows/libmupdf_winRT.vcxproj @@ -64,7 +64,6 @@ <ClCompile Include="..\..\source\fitz\draw-path.c" /> <ClCompile Include="..\..\source\fitz\draw-scale-simple.c" /> <ClCompile Include="..\..\source\fitz\draw-unpack.c" /> - <ClCompile Include="..\..\source\fitz\dtoa.c" /> <ClCompile Include="..\..\source\fitz\error.c" /> <ClCompile Include="..\..\source\fitz\filter-basic.c" /> <ClCompile Include="..\..\source\fitz\filter-dct.c" /> @@ -75,6 +74,7 @@ <ClCompile Include="..\..\source\fitz\filter-lzw.c" /> <ClCompile Include="..\..\source\fitz\filter-predict.c" /> <ClCompile Include="..\..\source\fitz\font.c" /> + <ClCompile Include="..\..\source\fitz\ftoa.c" /> <ClCompile Include="..\..\source\fitz\function.c" /> <ClCompile Include="..\..\source\fitz\geometry.c" /> <ClCompile Include="..\..\source\fitz\getopt.c" /> @@ -108,12 +108,14 @@ <ClCompile Include="..\..\source\fitz\stream-open.c" /> <ClCompile Include="..\..\source\fitz\stream-read.c" /> <ClCompile Include="..\..\source\fitz\string.c" /> + <ClCompile Include="..\..\source\fitz\strtod.c" /> <ClCompile Include="..\..\source\fitz\svg-device.c" /> <ClCompile Include="..\..\source\fitz\text.c" /> <ClCompile Include="..\..\source\fitz\time.c" /> <ClCompile Include="..\..\source\fitz\trace-device.c" /> <ClCompile Include="..\..\source\fitz\transition.c" /> <ClCompile Include="..\..\source\fitz\ucdn.c" /> + <ClCompile Include="..\..\source\fitz\unzip.c" /> <ClCompile Include="..\..\source\fitz\xml.c" /> <ClCompile Include="..\..\source\img\muimage.c" /> <ClCompile Include="..\..\source\pdf\pdf-annot.c" /> diff --git a/platform/windows/libmupdf_winRT.vcxproj.filters b/platform/windows/libmupdf_winRT.vcxproj.filters index b65301f4..86036ee8 100644 --- a/platform/windows/libmupdf_winRT.vcxproj.filters +++ b/platform/windows/libmupdf_winRT.vcxproj.filters @@ -429,10 +429,13 @@ <ClCompile Include="..\..\source\xps\xps-zip.c"> <Filter>xps</Filter> </ClCompile> + <ClCompile Include="..\..\source\fitz\ftoa.c"> + <Filter>fitz</Filter> + </ClCompile> <ClCompile Include="..\..\source\fitz\strtod.c"> <Filter>fitz</Filter> </ClCompile> - <ClCompile Include="..\..\source\fitz\ftoa.c"> + <ClCompile Include="..\..\source\fitz\unzip.c"> <Filter>fitz</Filter> </ClCompile> </ItemGroup> diff --git a/platform/windows/mupdf.sln b/platform/windows/mupdf.sln index 65818c0e..c38cde4c 100644 --- a/platform/windows/mupdf.sln +++ b/platform/windows/mupdf.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 +VisualStudioVersion = 12.0.31101.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generated", "generated.vcxproj", "{A5053AA7-02E5-4903-B596-04F17AEB1526}" EndProject @@ -25,6 +25,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupdf_cpp", "mupdf_cpp\mupd EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gsview", "gsview\gsview.csproj", "{5DA0ECC9-4026-4427-862F-E3226EFEFEB1}" ProjectSection(ProjectDependencies) = postProject + {09FE8E75-9952-44E7-95F8-E8D74707FBA1} = {09FE8E75-9952-44E7-95F8-E8D74707FBA1} {4468C2E0-6C90-4FA5-8A48-0A9629776167} = {4468C2E0-6C90-4FA5-8A48-0A9629776167} EndProjectSection EndProject @@ -34,18 +35,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupdfnet", "mupdfnet\mupdfn {4D5C4349-480D-4CD6-9D3B-09C50BA35FA2} = {4D5C4349-480D-4CD6-9D3B-09C50BA35FA2} EndProjectSection EndProject -Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Install64", "gsview\Install64\Install64.vdproj", "{76633D68-1082-4040-B943-362B02811577}" - ProjectSection(ProjectDependencies) = postProject - {5DA0ECC9-4026-4427-862F-E3226EFEFEB1} = {5DA0ECC9-4026-4427-862F-E3226EFEFEB1} - {4468C2E0-6C90-4FA5-8A48-0A9629776167} = {4468C2E0-6C90-4FA5-8A48-0A9629776167} - EndProjectSection -EndProject -Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Install32", "gsview\Install32\Install32.vdproj", "{FA5C8A67-3783-4096-B2E8-34BCF88F07EB}" - ProjectSection(ProjectDependencies) = postProject - {5DA0ECC9-4026-4427-862F-E3226EFEFEB1} = {5DA0ECC9-4026-4427-862F-E3226EFEFEB1} - {4468C2E0-6C90-4FA5-8A48-0A9629776167} = {4468C2E0-6C90-4FA5-8A48-0A9629776167} - EndProjectSection -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmupdf", "libmupdf\libmupdf.vcxproj", "{4D5C4349-480D-4CD6-9D3B-09C50BA35FA2}" ProjectSection(ProjectDependencies) = postProject {A5053AA7-02E5-4903-B596-04F17AEB1526} = {A5053AA7-02E5-4903-B596-04F17AEB1526} @@ -53,6 +42,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmupdf", "libmupdf\libmup EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libthirdparty", "libthirdparty\libthirdparty.vcxproj", "{DF87E242-8B2C-4F04-9A7E-61C578FD994C}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsprint", "gsprint.vcxproj", "{09FE8E75-9952-44E7-95F8-E8D74707FBA1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CD_ROM|Any CPU = CD_ROM|Any CPU @@ -560,81 +551,6 @@ Global {4468C2E0-6C90-4FA5-8A48-0A9629776167}.SingleImage|x64.Build.0 = Release|x64 {4468C2E0-6C90-4FA5-8A48-0A9629776167}.SingleImage|x86.ActiveCfg = Release|Win32 {4468C2E0-6C90-4FA5-8A48-0A9629776167}.SingleImage|x86.Build.0 = Release|Win32 - {76633D68-1082-4040-B943-362B02811577}.CD_ROM|Any CPU.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.CD_ROM|ARM.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.CD_ROM|Mixed Platforms.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.CD_ROM|Win32.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.CD_ROM|x64.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.CD_ROM|x86.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Debug|Any CPU.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.Debug|ARM.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.Debug|Mixed Platforms.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.Debug|Win32.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.Debug|x64.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.Debug|x86.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.DVD-5|Any CPU.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.DVD-5|ARM.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.DVD-5|Mixed Platforms.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.DVD-5|Win32.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.DVD-5|x64.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.DVD-5|x86.ActiveCfg = Debug - {76633D68-1082-4040-B943-362B02811577}.Memento|Any CPU.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Memento|ARM.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Memento|Mixed Platforms.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Memento|Win32.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Memento|x64.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Memento|x86.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Release|Any CPU.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Release|ARM.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Release|Mixed Platforms.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Release|Win32.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Release|x64.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.Release|x64.Build.0 = Release - {76633D68-1082-4040-B943-362B02811577}.Release|x86.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.SingleImage|Any CPU.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.SingleImage|ARM.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.SingleImage|Mixed Platforms.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.SingleImage|Win32.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.SingleImage|x64.ActiveCfg = Release - {76633D68-1082-4040-B943-362B02811577}.SingleImage|x86.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.CD_ROM|Any CPU.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.CD_ROM|ARM.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.CD_ROM|Mixed Platforms.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.CD_ROM|Win32.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.CD_ROM|x64.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.CD_ROM|x86.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Debug|Any CPU.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Debug|ARM.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Debug|Mixed Platforms.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Debug|Win32.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Debug|x64.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Debug|x86.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.DVD-5|Any CPU.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.DVD-5|ARM.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.DVD-5|Mixed Platforms.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.DVD-5|Win32.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.DVD-5|x64.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.DVD-5|x86.ActiveCfg = Debug - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Memento|Any CPU.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Memento|ARM.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Memento|Mixed Platforms.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Memento|Win32.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Memento|x64.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Memento|x86.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Release|Any CPU.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Release|ARM.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Release|Mixed Platforms.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Release|Win32.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Release|Win32.Build.0 = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Release|x64.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Release|x86.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.Release|x86.Build.0 = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.SingleImage|Any CPU.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.SingleImage|ARM.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.SingleImage|Mixed Platforms.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.SingleImage|Win32.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.SingleImage|x64.ActiveCfg = Release - {FA5C8A67-3783-4096-B2E8-34BCF88F07EB}.SingleImage|x86.ActiveCfg = Release {4D5C4349-480D-4CD6-9D3B-09C50BA35FA2}.CD_ROM|Any CPU.ActiveCfg = Release|Win32 {4D5C4349-480D-4CD6-9D3B-09C50BA35FA2}.CD_ROM|ARM.ActiveCfg = Release|Win32 {4D5C4349-480D-4CD6-9D3B-09C50BA35FA2}.CD_ROM|Mixed Platforms.ActiveCfg = Release|Win32 @@ -755,6 +671,66 @@ Global {DF87E242-8B2C-4F04-9A7E-61C578FD994C}.SingleImage|x64.Build.0 = Release|x64 {DF87E242-8B2C-4F04-9A7E-61C578FD994C}.SingleImage|x86.ActiveCfg = Release|Win32 {DF87E242-8B2C-4F04-9A7E-61C578FD994C}.SingleImage|x86.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|Any CPU.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|ARM.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|Mixed Platforms.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|Mixed Platforms.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|Win32.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|Win32.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|x64.ActiveCfg = Release|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|x64.Build.0 = Release|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|x86.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.CD_ROM|x86.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|ARM.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|Win32.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|Win32.Build.0 = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|x64.ActiveCfg = Debug|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|x64.Build.0 = Debug|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|x86.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Debug|x86.Build.0 = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|Any CPU.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|ARM.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|Mixed Platforms.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|Mixed Platforms.Build.0 = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|Win32.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|Win32.Build.0 = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|x64.ActiveCfg = Debug|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|x64.Build.0 = Debug|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|x86.ActiveCfg = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.DVD-5|x86.Build.0 = Debug|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|Any CPU.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|ARM.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|Mixed Platforms.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|Mixed Platforms.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|Win32.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|Win32.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|x64.ActiveCfg = Release|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|x64.Build.0 = Release|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|x86.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Memento|x86.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|Any CPU.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|ARM.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|Mixed Platforms.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|Win32.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|Win32.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|x64.ActiveCfg = Release|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|x64.Build.0 = Release|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|x86.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.Release|x86.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|Any CPU.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|ARM.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|Mixed Platforms.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|Mixed Platforms.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|Win32.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|Win32.Build.0 = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|x64.ActiveCfg = Release|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|x64.Build.0 = Release|x64 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|x86.ActiveCfg = Release|Win32 + {09FE8E75-9952-44E7-95F8-E8D74707FBA1}.SingleImage|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/platform/windows/mupdfnet/mupdfnet.cpp b/platform/windows/mupdfnet/mupdfnet.cpp index 6a59aec9..a778537a 100644 --- a/platform/windows/mupdfnet/mupdfnet.cpp +++ b/platform/windows/mupdfnet/mupdfnet.cpp @@ -287,6 +287,14 @@ SYMBOL_DECLSPEC void* __stdcall mCreateDisplayListText(void *ctx, int page_num, return text_ptr; } +SYMBOL_DECLSPEC void __stdcall mReleaseLists(void *ctx, void *dlist, + void *annot_dlist) +{ + muctx *mu_ctx = static_cast<muctx*>(ctx); + mu_ctx->ReleaseDisplayLists(dlist, annot_dlist); + return; +} + SYMBOL_DECLSPEC int __stdcall mRenderPageMT(void *ctx, void *dlist, void *annot_dlist, int page_width, int page_height, byte *bmp_data, int bmp_width, int bmp_height, double scale, bool flipy) @@ -444,13 +452,13 @@ SYMBOL_DECLSPEC int __stdcall mExtractPages(PCWSTR infile, PCWSTR outfile, fz_optind = 1; result = pdfclean_main(argc, argv); - delete(num); + delete[] num; delete(infilechar); delete(outfilechar); if (has_password) delete(passchar); if (num_pages > 0) - delete(pagenums); + delete[] pagenums; delete(argv); return result; } diff --git a/platform/windows/mupdfnet/mupdfnet.h b/platform/windows/mupdfnet/mupdfnet.h index 99d23062..44a4382b 100644 --- a/platform/windows/mupdfnet/mupdfnet.h +++ b/platform/windows/mupdfnet/mupdfnet.h @@ -50,6 +50,8 @@ EXTERN_C SYMBOL_DECLSPEC void* __stdcall mCreateDisplayListText(void *ctx, int p int *page_width, int *page_height, void **textptr, int *length); EXTERN_C SYMBOL_DECLSPEC void* __stdcall mCreateDisplayListAnnot(void *ctx, int page_num); +EXTERN_C SYMBOL_DECLSPEC void __stdcall mReleaseLists(void *ctx, void *dlist, + void *annot_dlist); EXTERN_C SYMBOL_DECLSPEC int __stdcall mRenderPageMT(void *ctx, void *dlist, void *annot_dlist, int page_width, int page_height, byte *bmp_data, int bmp_width, diff --git a/platform/windows/mupdfwinrt/Cache.cpp b/platform/windows/mupdfwinrt/Cache.cpp index b129710f..d5108a7c 100644 --- a/platform/windows/mupdfwinrt/Cache.cpp +++ b/platform/windows/mupdfwinrt/Cache.cpp @@ -22,7 +22,6 @@ void Cache::Empty(fz_context *mu_ctx) cache_entry_t *old_entry = curr_entry; curr_entry = old_entry->next; fz_drop_display_list(mu_ctx, old_entry->dlist); - delete old_entry; } this->size = 0; @@ -49,7 +48,10 @@ void Cache::Add(int value, int width_in, int height_in, fz_display_list *dlist, tail = prev_entry; - /* Decrement the caches rc of this list */ + /* Decrement the caches rc of this list. It is gone from cache but + may still be in use by other threads, when threads are done they + should decrement and it should be freed at that time. See + ReleaseDisplayLists in muctx class */ fz_drop_display_list(mu_ctx, curr_entry->dlist); delete curr_entry; size--; @@ -76,8 +78,8 @@ void Cache::Add(int value, int width_in, int height_in, fz_display_list *dlist, head = new_entry; } size++; - /* We are going to use this item now */ - fz_keep_display_list(mu_ctx, new_entry->dlist); + /* Everytime we add an entry, we are also using it. Increment rc. See above */ + fz_keep_display_list(mu_ctx, dlist); } fz_display_list* Cache::Use(int value, int *width_out, int *height_out, fz_context *mu_ctx) @@ -93,7 +95,6 @@ fz_display_list* Cache::Use(int value, int *width_out, int *height_out, fz_conte } if (curr_entry != NULL) { - fz_keep_display_list(mu_ctx, curr_entry->dlist); /* Move this to the front */ if (curr_entry != head) { @@ -113,6 +114,9 @@ fz_display_list* Cache::Use(int value, int *width_out, int *height_out, fz_conte } *width_out = curr_entry->width; *height_out = curr_entry->height; + /* We must increment our reference to this one to ensure it is not + freed when removed from the cache. See above comments */ + fz_keep_display_list(mu_ctx, curr_entry->dlist); return curr_entry->dlist; } else diff --git a/platform/windows/mupdfwinrt/muctx.cpp b/platform/windows/mupdfwinrt/muctx.cpp index d5c34c80..e51ea403 100644 --- a/platform/windows/mupdfwinrt/muctx.cpp +++ b/platform/windows/mupdfwinrt/muctx.cpp @@ -531,6 +531,21 @@ fz_display_list * muctx::CreateDisplayList(int page_num, int *width, int *height return dlist; } +void muctx::ReleaseDisplayLists(void *opdlist, void *opannotlist) +{ + fz_display_list *dlist = (fz_display_list*) opdlist; + fz_display_list *annotlist = (fz_display_list*) opannotlist; + + if (dlist != NULL) + { + fz_drop_display_list(mu_ctx, dlist); + } + if (annotlist != NULL) + { + fz_drop_display_list(mu_ctx, annotlist); + } +} + /* A special version which will create the display list AND get the information that we need for various text selection tasks */ fz_display_list * muctx::CreateDisplayListText(int page_num, int *width, int *height, @@ -648,8 +663,6 @@ status_t muctx::RenderPageMT(void *dlist, void *a_dlist, int page_width, int pag { fz_free_device(dev); fz_drop_pixmap(ctx_clone, pix); - fz_drop_display_list(ctx_clone, display_list); - fz_drop_display_list(ctx_clone, annot_displaylist); } fz_catch(ctx_clone) { @@ -689,11 +702,11 @@ status_t muctx::RenderPage(int page_num, unsigned char *bmp_data, int bmp_width, bmp_height, bmp_data); fz_clear_pixmap_with_value(mu_ctx, pix, 255); dev = fz_new_draw_device(mu_ctx, pix); - fz_run_page(mu_doc, page, dev, pctm, NULL); + fz_run_page_contents(mu_doc, page, dev, pctm, NULL); fz_annot *annot; for (annot = fz_first_annot(mu_doc, page); annot; annot = fz_next_annot(mu_doc, annot)) - fz_run_annot(mu_doc, page, annot, dev, &fz_identity, NULL); + fz_run_annot(mu_doc, page, annot, dev, pctm, NULL); } fz_always(mu_ctx) { @@ -879,8 +892,6 @@ status_t muctx::SavePage(char *filename, int page_num, int resolution, int type, fz_drop_pixmap(mu_ctx, pix); fz_free_device(dev); fz_free_page(mu_doc, page); - if (dlist != NULL) - fz_drop_display_list(mu_ctx, dlist); if (out != NULL) { fz_close_output(out); diff --git a/platform/windows/mupdfwinrt/muctx.h b/platform/windows/mupdfwinrt/muctx.h index 16c44cd1..5b870543 100644 --- a/platform/windows/mupdfwinrt/muctx.h +++ b/platform/windows/mupdfwinrt/muctx.h @@ -101,6 +101,7 @@ public: fz_display_list * CreateDisplayListText(int page_num, int *width, int *height, fz_text_page **text, int *length); fz_display_list * CreateAnnotationList(int page_num); + void ReleaseDisplayLists(void *dlist, void *annotlist); int MeasurePage(int page_num, point_t *size); point_t MeasurePage(fz_page *page); unsigned int GetLinks(int page_num, sh_vector_link links_vec); diff --git a/platform/windows/mupdfwinrt/mudocument.cpp b/platform/windows/mupdfwinrt/mudocument.cpp index 060144b3..29df67c3 100644 --- a/platform/windows/mupdfwinrt/mudocument.cpp +++ b/platform/windows/mupdfwinrt/mudocument.cpp @@ -217,6 +217,8 @@ int mudocument::RenderPageBitmapSync(int page_num, int bmp_width, int bmp_height &(bmp_data[0]), bmp_width, bmp_height, scale, flipy, tile, { top_left.X, top_left.Y }, { bottom_right.X, bottom_right.Y }); + /* Done with lists */ + mu_object.ReleaseDisplayLists(dlist, annotlist); } else { @@ -290,7 +292,9 @@ Windows::Foundation::IAsyncOperation<InMemoryRandomAccessStream^>^ &(bmp_data[0]), bmp_width, bmp_height, scale, true, false, { 0.0, 0.0 }, { (float) bmp_width, (float) bmp_height }); - } + /* Done with lists */ + mu_object.ReleaseDisplayLists(dlist, annotlist); + } else { /* Rendering in immediate mode. Keep lock in place */ diff --git a/platform/x11/curl_stream.c b/platform/x11/curl_stream.c index 9b806b79..07464d27 100644 --- a/platform/x11/curl_stream.c +++ b/platform/x11/curl_stream.c @@ -317,7 +317,7 @@ fetcher_thread(curl_stream_state *state) } static int -stream_next(fz_stream *stream, int len) +stream_next(fz_context *ctx, fz_stream *stream, int len) { curl_stream_state *state = (curl_stream_state *)stream->state; int len_read = 0; @@ -327,13 +327,13 @@ stream_next(fz_stream *stream, int len) unsigned char *buf = state->public_buffer; if (state->error != NULL) - fz_throw(stream->ctx, FZ_ERROR_GENERIC, "cannot fetch data: %s", state->error); + fz_throw(ctx, FZ_ERROR_GENERIC, "cannot fetch data: %s", state->error); if (len > sizeof(state->public_buffer)) len = sizeof(state->public_buffer); if (state->content_length == 0) - fz_throw(stream->ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (A) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (A) (offset=%d)", read_point); if (state->map == NULL) { @@ -342,7 +342,7 @@ stream_next(fz_stream *stream, int len) if (read_point + len > state->current_fill_point) { stream->rp = stream->wp; - fz_throw(stream->ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (B) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (B) (offset=%d)", read_point); } memcpy(buf, state->buffer + read_point, len); stream->rp = buf; @@ -367,7 +367,7 @@ stream_next(fz_stream *stream, int len) state->fill_point = block; unlock(state); stream->rp = stream->wp; - fz_throw(stream->ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (C) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (C) (offset=%d)", read_point); } block++; if (left_over > len) @@ -388,7 +388,7 @@ stream_next(fz_stream *stream, int len) state->fill_point = block; unlock(state); stream->rp = stream->wp; - fz_throw(stream->ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (D) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (D) (offset=%d)", read_point); } block++; memcpy(buf, state->buffer + read_point, BLOCK_SIZE); @@ -407,7 +407,7 @@ stream_next(fz_stream *stream, int len) state->fill_point = block; unlock(state); stream->rp = stream->wp; - fz_throw(stream->ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (E) (offset=%d)", read_point); + fz_throw(ctx, FZ_ERROR_TRYLATER, "read of a block we don't have (E) (offset=%d)", read_point); } memcpy(buf, state->buffer + read_point, len); len_read += len; @@ -441,9 +441,9 @@ stream_close(fz_context *ctx, void *state_) pthread_mutex_destroy(&state->mutex); #endif - fz_free(state->ctx, state->buffer); - fz_free(state->ctx, state->map); - fz_free(state->ctx, state); + fz_free(ctx, state->buffer); + fz_free(ctx, state->map); + fz_free(ctx, state); } static fz_stream hack_stream; @@ -451,7 +451,7 @@ static curl_stream_state hack; static int hack_pos; static void -stream_seek(fz_stream *stream, int offset, int whence) +stream_seek(fz_context *ctx, fz_stream *stream, int offset, int whence) { curl_stream_state *state = (curl_stream_state *)stream->state; @@ -479,7 +479,7 @@ stream_seek(fz_stream *stream, int offset, int whence) } static int -stream_meta(fz_stream *stream, int key, int size, void *ptr) +stream_meta(fz_context *ctx, fz_stream *stream, int key, int size, void *ptr) { curl_stream_state *state = (curl_stream_state *)stream->state; @@ -487,7 +487,7 @@ stream_meta(fz_stream *stream, int key, int size, void *ptr) { case FZ_STREAM_META_LENGTH: if (!state->data_arrived) - fz_throw(stream->ctx, FZ_ERROR_TRYLATER, "still awaiting file length"); + fz_throw(ctx, FZ_ERROR_TRYLATER, "still awaiting file length"); return state->content_length; case FZ_STREAM_META_PROGRESSIVE: return 1; @@ -540,7 +540,7 @@ fz_stream *fz_stream_from_curl(fz_context *ctx, char *filename, void (*more_data #endif - stream = fz_new_stream(ctx, state, stream_next, stream_close, NULL); + stream = fz_new_stream(ctx, state, stream_next, stream_close); stream->seek = stream_seek; stream->meta = stream_meta; return stream; diff --git a/platform/x11/jstest_main.c b/platform/x11/jstest_main.c index 2188855d..98fec194 100644 --- a/platform/x11/jstest_main.c +++ b/platform/x11/jstest_main.c @@ -426,7 +426,7 @@ main(int argc, char *argv[]) if (file_open) pdfapp_close(&gapp); - fz_free_context(ctx); + fz_drop_context(ctx); return 0; } diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index 4f05a496..90e10f83 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -130,10 +130,10 @@ void pdfapp_init(fz_context *ctx, pdfapp_t *app) void pdfapp_invert(pdfapp_t *app, const fz_rect *rect) { fz_irect b; - fz_invert_pixmap_rect(app->image, fz_round_rect(&b, rect)); + fz_invert_pixmap_rect(app->ctx, app->image, fz_round_rect(&b, rect)); } -static void event_cb(pdf_doc_event *event, void *data) +static void event_cb(fz_context *ctx, pdf_document *doc, pdf_doc_event *event, void *data) { pdfapp_t *app = (pdfapp_t *)data; @@ -141,7 +141,7 @@ static void event_cb(pdf_doc_event *event, void *data) { case PDF_DOCUMENT_EVENT_ALERT: { - pdf_alert_event *alert = pdf_access_alert_event(event); + pdf_alert_event *alert = pdf_access_alert_event(ctx, event); winalert(app, alert); } break; @@ -152,7 +152,7 @@ static void event_cb(pdf_doc_event *event, void *data) case PDF_DOCUMENT_EVENT_EXEC_MENU_ITEM: { - char *item = pdf_access_exec_menu_item_event(event); + char *item = pdf_access_exec_menu_item_event(ctx, event); if (!strcmp(item, "Print")) winprint(app); @@ -167,7 +167,7 @@ static void event_cb(pdf_doc_event *event, void *data) case PDF_DOCUMENT_EVENT_LAUNCH_URL: { - pdf_launch_url_event *launch_url = pdf_access_launch_url_event(event); + pdf_launch_url_event *launch_url = pdf_access_launch_url_event(ctx, event); pdfapp_warn(app, "The document attempted to open url: %s. (Not supported by app)", launch_url->url); } @@ -175,7 +175,7 @@ static void event_cb(pdf_doc_event *event, void *data) case PDF_DOCUMENT_EVENT_MAIL_DOC: { - pdf_mail_doc_event *mail_doc = pdf_access_mail_doc_event(event); + pdf_mail_doc_event *mail_doc = pdf_access_mail_doc_event(ctx, event); pdfapp_warn(app, "The document attmepted to mail the document%s%s%s%s%s%s%s%s (Not supported)", mail_doc->to[0]?", To: ":"", mail_doc->to, @@ -227,7 +227,7 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps) { fz_try(ctx) { - fz_seek(app->stream, 0, SEEK_SET); + fz_seek(ctx, app->stream, 0, SEEK_SET); app->doc = fz_open_document_with_stream(ctx, filename, app->stream); } fz_catch(ctx) @@ -255,7 +255,7 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps) { fz_try(ctx) { - fz_seek(stream, 0, SEEK_SET); + fz_seek(ctx, stream, 0, SEEK_SET); app->doc = fz_open_document_with_stream(ctx, filename, stream); } fz_catch(ctx) @@ -271,23 +271,23 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps) } } - idoc = pdf_specifics(app->doc); + idoc = pdf_specifics(app->ctx, app->doc); if (idoc) { - pdf_enable_js(idoc); - pdf_set_doc_event_callback(idoc, event_cb, app); + pdf_enable_js(ctx, idoc); + pdf_set_doc_event_callback(ctx, idoc, event_cb, app); } - if (fz_needs_password(app->doc)) + if (fz_needs_password(app->ctx, app->doc)) { - int okay = fz_authenticate_password(app->doc, password); + int okay = fz_authenticate_password(app->ctx, app->doc, password); while (!okay) { password = winpassword(app, filename); if (!password) fz_throw(ctx, FZ_ERROR_GENERIC, "Needs a password"); - okay = fz_authenticate_password(app->doc, password); + okay = fz_authenticate_password(app->ctx, app->doc, password); if (!okay) pdfapp_warn(app, "Invalid password."); } @@ -305,7 +305,7 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps) { fz_try(ctx) { - app->pagecount = fz_count_pages(app->doc); + app->pagecount = fz_count_pages(app->ctx, app->doc); if (app->pagecount <= 0) fz_throw(ctx, FZ_ERROR_GENERIC, "No pages in document"); } @@ -324,7 +324,7 @@ void pdfapp_open_progressive(pdfapp_t *app, char *filename, int reload, int bps) { fz_try(ctx) { - app->outline = fz_load_outline(app->doc); + app->outline = fz_load_outline(app->ctx, app->doc); } fz_catch(ctx) { @@ -371,10 +371,10 @@ void pdfapp_close(pdfapp_t *app) fz_drop_display_list(app->ctx, app->annotations_list); app->annotations_list = NULL; - fz_free_text_page(app->ctx, app->page_text); + fz_drop_text_page(app->ctx, app->page_text); app->page_text = NULL; - fz_free_text_sheet(app->ctx, app->page_sheet); + fz_drop_text_sheet(app->ctx, app->page_sheet); app->page_sheet = NULL; fz_drop_link(app->ctx, app->page_links); @@ -395,17 +395,17 @@ void pdfapp_close(pdfapp_t *app) fz_drop_pixmap(app->ctx, app->old_image); app->old_image = NULL; - fz_free_outline(app->ctx, app->outline); + fz_drop_outline(app->ctx, app->outline); app->outline = NULL; - fz_free_page(app->doc, app->page); + fz_drop_page(app->ctx, app->page); app->page = NULL; - fz_close_document(app->doc); + fz_drop_document(app->ctx, app->doc); app->doc = NULL; #ifdef HAVE_CURL - fz_close(app->stream); + fz_drop_stream(app->ctx, app->stream); #endif fz_flush_warnings(app->ctx); @@ -454,7 +454,7 @@ static int pdfapp_save(pdfapp_t *app) if (strcmp(buf, app->docpath) != 0) { wincopyfile(app->docpath, buf); - fz_write_document(app->doc, buf, &opts); + fz_write_document(app->ctx, app->doc, buf, &opts); return 1; } @@ -465,7 +465,7 @@ static int pdfapp_save(pdfapp_t *app) fz_try(app->ctx) { wincopyfile(app->docpath, buf); - fz_write_document(app->doc, buf, &opts); + fz_write_document(app->ctx, app->doc, buf, &opts); written = 1; } fz_catch(app->ctx) @@ -490,9 +490,9 @@ static int pdfapp_save(pdfapp_t *app) int pdfapp_preclose(pdfapp_t *app) { - pdf_document *idoc = pdf_specifics(app->doc); + pdf_document *idoc = pdf_specifics(app->ctx, app->doc); - if (idoc && pdf_has_unsaved_changes(idoc)) + if (idoc && pdf_has_unsaved_changes(app->ctx, idoc)) { switch (winsavequery(app)) { @@ -552,10 +552,10 @@ static void pdfapp_loadpage(pdfapp_t *app, int no_cache) fz_drop_display_list(app->ctx, app->page_list); fz_drop_display_list(app->ctx, app->annotations_list); - fz_free_text_page(app->ctx, app->page_text); - fz_free_text_sheet(app->ctx, app->page_sheet); + fz_drop_text_page(app->ctx, app->page_text); + fz_drop_text_sheet(app->ctx, app->page_sheet); fz_drop_link(app->ctx, app->page_links); - fz_free_page(app->doc, app->page); + fz_drop_page(app->ctx, app->page); app->page_list = NULL; app->annotations_list = NULL; @@ -572,9 +572,9 @@ static void pdfapp_loadpage(pdfapp_t *app, int no_cache) fz_try(app->ctx) { - app->page = fz_load_page(app->doc, app->pageno - 1); + app->page = fz_load_page(app->ctx, app->doc, app->pageno - 1); - fz_bound_page(app->doc, app->page, &app->page_bbox); + fz_bound_page(app->ctx, app->page, &app->page_bbox); } fz_catch(app->ctx) { @@ -592,15 +592,15 @@ static void pdfapp_loadpage(pdfapp_t *app, int no_cache) app->page_list = fz_new_display_list(app->ctx); mdev = fz_new_list_device(app->ctx, app->page_list); if (no_cache) - fz_enable_device_hints(mdev, FZ_NO_CACHE); + fz_enable_device_hints(app->ctx, mdev, FZ_NO_CACHE); cookie.incomplete_ok = 1; - fz_run_page_contents(app->doc, app->page, mdev, &fz_identity, &cookie); - fz_free_device(mdev); + fz_run_page_contents(app->ctx, app->page, mdev, &fz_identity, &cookie); + fz_drop_device(app->ctx, mdev); mdev = NULL; app->annotations_list = fz_new_display_list(app->ctx); mdev = fz_new_list_device(app->ctx, app->annotations_list); - for (annot = fz_first_annot(app->doc, app->page); annot; annot = fz_next_annot(app->doc, annot)) - fz_run_annot(app->doc, app->page, annot, mdev, &fz_identity, &cookie); + for (annot = fz_first_annot(app->ctx, app->page); annot; annot = fz_next_annot(app->ctx, app->page, annot)) + fz_run_annot(app->ctx, app->page, annot, mdev, &fz_identity, &cookie); if (cookie.incomplete) { app->incomplete = 1; @@ -614,7 +614,7 @@ static void pdfapp_loadpage(pdfapp_t *app, int no_cache) } fz_always(app->ctx) { - fz_free_device(mdev); + fz_drop_device(app->ctx, mdev); } fz_catch(app->ctx) { @@ -629,7 +629,7 @@ static void pdfapp_loadpage(pdfapp_t *app, int no_cache) fz_try(app->ctx) { - app->page_links = fz_load_links(app->doc, app->page); + app->page_links = fz_load_links(app->ctx, app->page); } fz_catch(app->ctx) { @@ -659,8 +659,8 @@ static void pdfapp_recreate_annotationslist(pdfapp_t *app) /* Create display list */ app->annotations_list = fz_new_display_list(app->ctx); mdev = fz_new_list_device(app->ctx, app->annotations_list); - for (annot = fz_first_annot(app->doc, app->page); annot; annot = fz_next_annot(app->doc, annot)) - fz_run_annot(app->doc, app->page, annot, mdev, &fz_identity, &cookie); + for (annot = fz_first_annot(app->ctx, app->page); annot; annot = fz_next_annot(app->ctx, app->page, annot)) + fz_run_annot(app->ctx, app->page, annot, mdev, &fz_identity, &cookie); if (cookie.incomplete) { app->incomplete = 1; @@ -674,7 +674,7 @@ static void pdfapp_recreate_annotationslist(pdfapp_t *app) } fz_always(app->ctx) { - fz_free_device(mdev); + fz_drop_device(app->ctx, mdev); } fz_catch(app->ctx) { @@ -687,37 +687,37 @@ static void pdfapp_recreate_annotationslist(pdfapp_t *app) static void pdfapp_runpage(pdfapp_t *app, fz_device *dev, const fz_matrix *ctm, const fz_rect *rect, fz_cookie *cookie) { - fz_begin_page(dev, rect, ctm); + fz_begin_page(app->ctx, dev, rect, ctm); if (app->page_list) - fz_run_display_list(app->page_list, dev, ctm, rect, cookie); + fz_run_display_list(app->ctx, app->page_list, dev, ctm, rect, cookie); if (app->annotations_list) - fz_run_display_list(app->annotations_list, dev, ctm, rect, cookie); - fz_end_page(dev); + fz_run_display_list(app->ctx, app->annotations_list, dev, ctm, rect, cookie); + fz_end_page(app->ctx, dev); } #define MAX_TITLE 256 static void pdfapp_updatepage(pdfapp_t *app) { - pdf_document *idoc = pdf_specifics(app->doc); + pdf_document *idoc = pdf_specifics(app->ctx, app->doc); fz_device *idev; fz_matrix ctm; fz_annot *annot; pdfapp_viewctm(&ctm, app); - pdf_update_page(idoc, (pdf_page *)app->page); + pdf_update_page(app->ctx, idoc, (pdf_page *)app->page); pdfapp_recreate_annotationslist(app); - while ((annot = (fz_annot *)pdf_poll_changed_annot(idoc, (pdf_page *)app->page)) != NULL) + while ((annot = (fz_annot *)pdf_poll_changed_annot(app->ctx, idoc, (pdf_page *)app->page)) != NULL) { fz_rect bounds; fz_irect ibounds; - fz_transform_rect(fz_bound_annot(app->doc, annot, &bounds), &ctm); + fz_transform_rect(fz_bound_annot(app->ctx, app->page, annot, &bounds), &ctm); fz_rect_from_irect(&bounds, fz_round_rect(&ibounds, &bounds)); fz_clear_pixmap_rect_with_value(app->ctx, app->image, 255, &ibounds); idev = fz_new_draw_device_with_bbox(app->ctx, app->image, &ibounds); pdfapp_runpage(app, idev, &ctm, &bounds, NULL); - fz_free_device(idev); + fz_drop_device(app->ctx, idev); } pdfapp_showpage(app, 0, 0, 1, 0, 0); @@ -729,7 +729,7 @@ void pdfapp_reloadpage(pdfapp_t *app) { fz_try(app->ctx) { - app->outline = fz_load_outline(app->doc); + app->outline = fz_load_outline(app->ctx, app->doc); } fz_catch(app->ctx) { @@ -778,7 +778,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai { tdev = fz_new_text_device(app->ctx, app->page_sheet, app->page_text); pdfapp_runpage(app, tdev, &fz_identity, &fz_infinite_rect, &cookie); - fz_free_device(tdev); + fz_drop_device(app->ctx, tdev); } } @@ -819,7 +819,7 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai { idev = fz_new_draw_device(app->ctx, app->image); pdfapp_runpage(app, idev, &ctm, &bounds, &cookie); - fz_free_device(idev); + fz_drop_device(app->ctx, idev); } if (app->invert) fz_invert_pixmap(app->ctx, app->image); @@ -838,12 +838,12 @@ static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repai colorspace = app->colorspace; app->image = fz_new_pixmap_with_bbox(app->ctx, colorspace, &ibounds); app->duration = 0; - new_trans = fz_page_presentation(app->doc, app->page, &app->duration); + new_trans = fz_page_presentation(app->ctx, app->page, &app->duration); if (new_trans) app->transition = *new_trans; if (app->duration == 0) app->duration = 5; - app->in_transit = fz_generate_transition(app->image, app->old_image, app->new_image, 0, &app->transition); + app->in_transit = fz_generate_transition(app->ctx, app->image, app->old_image, app->new_image, 0, &app->transition); if (!app->in_transit) { if (app->duration != 0) @@ -1411,7 +1411,7 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta if (btn == 1 && (state == 1 || state == -1)) { pdf_ui_event event; - pdf_document *idoc = pdf_specifics(app->doc); + pdf_document *idoc = pdf_specifics(app->ctx, app->doc); event.etype = PDF_EVENT_TYPE_POINTER; event.event.pointer.pt = p; @@ -1420,22 +1420,22 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta else /* state == -1 */ event.event.pointer.ptype = PDF_POINTER_UP; - if (idoc && pdf_pass_event(idoc, (pdf_page *)app->page, &event)) + if (idoc && pdf_pass_event(ctx, idoc, (pdf_page *)app->page, &event)) { pdf_widget *widget; - widget = pdf_focused_widget(idoc); + widget = pdf_focused_widget(ctx, idoc); app->nowaitcursor = 1; pdfapp_updatepage(app); if (widget) { - switch (pdf_widget_get_type(widget)) + switch (pdf_widget_get_type(ctx, widget)) { case PDF_WIDGET_TYPE_TEXT: { - char *text = pdf_text_widget_text(idoc, widget); + char *text = pdf_text_widget_text(ctx, idoc, widget); char *current_text = text; int retry = 0; @@ -1444,7 +1444,7 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta current_text = wintextinput(app, current_text, retry); retry = 1; } - while (current_text && !pdf_text_widget_set_text(idoc, widget, current_text)); + while (current_text && !pdf_text_widget_set_text(ctx, idoc, widget, current_text)); fz_free(app->ctx, text); pdfapp_updatepage(app); @@ -1464,17 +1464,17 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta fz_try(ctx) { - nopts = pdf_choice_widget_options(idoc, widget, NULL); + nopts = pdf_choice_widget_options(ctx, idoc, widget, NULL); opts = fz_malloc(ctx, nopts * sizeof(*opts)); - (void)pdf_choice_widget_options(idoc, widget, opts); + (void)pdf_choice_widget_options(ctx, idoc, widget, opts); - nvals = pdf_choice_widget_value(idoc, widget, NULL); + nvals = pdf_choice_widget_value(ctx, idoc, widget, NULL); vals = fz_malloc(ctx, MAX(nvals,nopts) * sizeof(*vals)); - (void)pdf_choice_widget_value(idoc, widget, vals); + (void)pdf_choice_widget_value(ctx, idoc, widget, vals); if (winchoiceinput(app, nopts, opts, &nvals, vals)) { - pdf_choice_widget_set_value(idoc, widget, nvals, vals); + pdf_choice_widget_set_value(ctx, idoc, widget, nvals, vals); pdfapp_updatepage(app); } } @@ -1495,7 +1495,7 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta char ebuf[256]; ebuf[0] = 0; - if (pdf_check_signature(idoc, widget, app->docpath, ebuf, sizeof(ebuf))) + if (pdf_check_signature(ctx, idoc, widget, app->docpath, ebuf, sizeof(ebuf))) { winwarn(app, "Signature is valid"); } @@ -1538,10 +1538,10 @@ void pdfapp_onmouse(pdfapp_t *app, int x, int y, int btn, int modifiers, int sta else { fz_annot *annot; - for (annot = fz_first_annot(app->doc, app->page); annot; annot = fz_next_annot(app->doc, annot)) + for (annot = fz_first_annot(app->ctx, app->page); annot; annot = fz_next_annot(app->ctx, app->page, annot)) { fz_rect rect; - fz_bound_annot(app->doc, annot, &rect); + fz_bound_annot(app->ctx, app->page, annot, &rect); if (x >= rect.x0 && x < rect.x1) if (y >= rect.y0 && y < rect.y1) break; @@ -1729,7 +1729,7 @@ void pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen) { for (i = 0; i < span->len; i++) { - fz_text_char_bbox(&hitbox, span, i); + fz_text_char_bbox(app->ctx, &hitbox, span, i); fz_transform_rect(&hitbox, &ctm); c = span->text[i].c; if (c < 32) @@ -1787,7 +1787,7 @@ void pdfapp_postblit(pdfapp_t *app) winadvancetimer(app, app->duration); } else - fz_generate_transition(app->image, app->old_image, app->new_image, llama, &app->transition); + fz_generate_transition(app->ctx, app->image, app->old_image, app->new_image, llama, &app->transition); winrepaint(app); if (llama >= 256) { diff --git a/platform/x11/win_main.c b/platform/x11/win_main.c index 50cc7285..781e6892 100644 --- a/platform/x11/win_main.c +++ b/platform/x11/win_main.c @@ -443,6 +443,7 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { char buf[256]; wchar_t bufx[256]; + fz_context *ctx = gapp.ctx; fz_document *doc = gapp.doc; switch(message) @@ -451,7 +452,7 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SetDlgItemTextW(hwnd, 0x10, wbuf); - if (fz_meta(doc, FZ_META_FORMAT_INFO, buf, 256) < 0) + if (fz_meta(ctx, doc, FZ_META_FORMAT_INFO, buf, 256) < 0) { SetDlgItemTextA(hwnd, 0x11, "Unknown"); SetDlgItemTextA(hwnd, 0x12, "None"); @@ -461,7 +462,7 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SetDlgItemTextA(hwnd, 0x11, buf); - if (fz_meta(doc, FZ_META_CRYPT_INFO, buf, 256) == 0) + if (fz_meta(ctx, doc, FZ_META_CRYPT_INFO, buf, 256) == 0) { SetDlgItemTextA(hwnd, 0x12, buf); } @@ -470,13 +471,13 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) SetDlgItemTextA(hwnd, 0x12, "None"); } buf[0] = 0; - if (fz_meta(doc, FZ_META_HAS_PERMISSION, NULL, FZ_PERMISSION_PRINT) == 0) + if (fz_meta(ctx, doc, FZ_META_HAS_PERMISSION, NULL, FZ_PERMISSION_PRINT) == 0) strcat(buf, "print, "); - if (fz_meta(doc, FZ_META_HAS_PERMISSION, NULL, FZ_PERMISSION_CHANGE) == 0) + if (fz_meta(ctx, doc, FZ_META_HAS_PERMISSION, NULL, FZ_PERMISSION_CHANGE) == 0) strcat(buf, "modify, "); - if (fz_meta(doc, FZ_META_HAS_PERMISSION, NULL, FZ_PERMISSION_COPY) == 0) + if (fz_meta(ctx, doc, FZ_META_HAS_PERMISSION, NULL, FZ_PERMISSION_COPY) == 0) strcat(buf, "copy, "); - if (fz_meta(doc, FZ_META_HAS_PERMISSION, NULL, FZ_PERMISSION_NOTES) == 0) + if (fz_meta(ctx, doc, FZ_META_HAS_PERMISSION, NULL, FZ_PERMISSION_NOTES) == 0) strcat(buf, "annotate, "); if (strlen(buf) > 2) buf[strlen(buf)-2] = 0; @@ -487,7 +488,7 @@ dloginfoproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #define SETUTF8(ID, STRING) \ { \ *(char **)buf = STRING; \ - if (fz_meta(doc, FZ_META_INFO, buf, 256) <= 0) \ + if (fz_meta(ctx, doc, FZ_META_INFO, buf, 256) <= 0) \ buf[0] = 0; \ MultiByteToWideChar(CP_UTF8, 0, buf, -1, bufx, nelem(bufx)); \ SetDlgItemTextW(hwnd, ID, bufx); \ @@ -1220,7 +1221,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShow } do_close(&gapp); - fz_free_context(ctx); + fz_drop_context(ctx); return 0; } diff --git a/platform/x11/x11_main.c b/platform/x11/x11_main.c index b2413777..cb067ecc 100644 --- a/platform/x11/x11_main.c +++ b/platform/x11/x11_main.c @@ -344,7 +344,7 @@ void cleanup(pdfapp_t *app) XCloseDisplay(xdpy); - fz_free_context(ctx); + fz_drop_context(ctx); } static int winresolution() |