From 98510e7420362a7eeaa44185913d602aa48dce90 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 7 Dec 2012 15:11:57 +0100 Subject: [PATCH] Try printing to the cairo object first --- po/cs.po | 10 +++++----- po/de.po | 10 +++++----- po/eo.po | 10 +++++----- po/es.po | 10 +++++----- po/es_CL.po | 10 +++++----- po/et.po | 10 +++++----- po/fr.po | 14 +++++++------- po/it.po | 10 +++++----- po/pl.po | 10 +++++----- po/ru.po | 10 +++++----- po/ta_IN.po | 10 +++++----- po/tr.po | 10 +++++----- po/uk_UA.po | 10 +++++----- print.c | 17 ++++++++++++++++- 14 files changed, 83 insertions(+), 68 deletions(-) diff --git a/po/cs.po b/po/cs.po index 12025b1..c181e8d 100644 --- a/po/cs.po +++ b/po/cs.po @@ -4,8 +4,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-06-19 23:59+0200\n" "Last-Translator: Martin Pelikan \n" "Language-Team: pwmt.org \n" @@ -26,8 +26,8 @@ msgstr "Neplatný index: %s" #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Není otevřený žádný dokument." @@ -412,7 +412,7 @@ msgstr "Zkopíruj obrázek" msgid "Save image as" msgstr "Ulož obrázek jako" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Tenhle dokument neobsahuje žádné indexy" diff --git a/po/de.po b/po/de.po index 85a9364..2fbf3f2 100644 --- a/po/de.po +++ b/po/de.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-08-05 16:08+0100\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: pwmt.org \n" @@ -28,8 +28,8 @@ msgstr "Ungültiger Index '%s' angegeben." #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Kein Dokument geöffnet." @@ -417,7 +417,7 @@ msgstr "Bild kopieren" msgid "Save image as" msgstr "Bild speichern als" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Dieses Dokument beinhaltet kein Inhaltsverzeichnis." diff --git a/po/eo.po b/po/eo.po index 51da49a..3c8fa17 100644 --- a/po/eo.po +++ b/po/eo.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-08-09 13:21+0000\n" "Last-Translator: norbux \n" "Language-Team: Esperanto (http://www.transifex.com/projects/p/zathura/" @@ -30,8 +30,8 @@ msgstr "Nevalida indekso '%s' uzata." #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Neniu dokumento malfermita." @@ -416,7 +416,7 @@ msgstr "Kopiu bildon" msgid "Save image as" msgstr "Savi bildojn kiel" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Ĉi-tiu dokumento enhavas neniam indekson." diff --git a/po/es.po b/po/es.po index 870260e..1bdcbab 100644 --- a/po/es.po +++ b/po/es.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-04-03 15:25+0000\n" "Last-Translator: Moritz Lipp \n" "Language-Team: Spanish (Castilian) (http://www.transifex.net/projects/p/" @@ -29,8 +29,8 @@ msgstr "Índice invalido: '%s'." #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Ningún documento abierto." @@ -417,7 +417,7 @@ msgstr "Copiar imagen" msgid "Save image as" msgstr "Salvar imagen como" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Este documento no contiene ningún índice" diff --git a/po/es_CL.po b/po/es_CL.po index 91a9ba7..f03d46d 100644 --- a/po/es_CL.po +++ b/po/es_CL.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-04-03 15:26+0000\n" "Last-Translator: watsh1ken \n" "Language-Team: Spanish (Chile) (http://www.transifex.net/projects/p/zathura/" @@ -30,8 +30,8 @@ msgstr "Índice invalido: '%s'." #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Ningún documento abierto." @@ -417,7 +417,7 @@ msgstr "Copiar imagen" msgid "Save image as" msgstr "" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Este document no contiene índice" diff --git a/po/et.po b/po/et.po index 63d32a0..64fd190 100644 --- a/po/et.po +++ b/po/et.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-04-03 15:25+0000\n" "Last-Translator: Rivo Zängov \n" "Language-Team: Estonian (http://www.transifex.net/projects/p/zathura/" @@ -30,8 +30,8 @@ msgstr "" #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "" @@ -416,7 +416,7 @@ msgstr "Kopeeri pilt" msgid "Save image as" msgstr "" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "" diff --git a/po/fr.po b/po/fr.po index ece7dc0..ee0b777 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-12-06 11:48+0100\n" "Last-Translator: Benoît Knecht \n" "Language-Team: French (http://www.transifex.com/projects/p/zathura/language/" @@ -32,8 +32,8 @@ msgstr "Index invalide : '%s'" #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Aucun document ouvert." @@ -219,8 +219,8 @@ msgstr "Recoloriser les pages" #: ../config.c:172 msgid "When recoloring keep original hue and adjust lightness only" msgstr "" -"Lors de la recoloration garder la teinte d'origine et ajuster " -"seulement la luminosité" +"Lors de la recoloration garder la teinte d'origine et ajuster seulement la " +"luminosité" #: ../config.c:174 msgid "Wrap scrolling" @@ -420,7 +420,7 @@ msgstr "Copier l'image" msgid "Save image as" msgstr "Enregistrer l'image sous" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Ce document ne contient pas d'index" diff --git a/po/it.po b/po/it.po index 05c2d95..0e9b5ce 100644 --- a/po/it.po +++ b/po/it.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-06-20 14:58+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Italian (http://www.transifex.com/projects/p/zathura/language/" @@ -30,8 +30,8 @@ msgstr "Indice inserito '%s' non valido." #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Nessun documento aperto." @@ -416,7 +416,7 @@ msgstr "Copia immagine" msgid "Save image as" msgstr "" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Questo documento non contiene l' indice" diff --git a/po/pl.po b/po/pl.po index 4450650..9422f92 100644 --- a/po/pl.po +++ b/po/pl.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-04-03 16:07+0000\n" "Last-Translator: p \n" "Language-Team: Polish (http://www.transifex.net/projects/p/zathura/language/" @@ -31,8 +31,8 @@ msgstr "Nieprawidłowy indeks: %s" #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Nie otwarto żadnego pliku" @@ -417,7 +417,7 @@ msgstr "Skopiuj obrazek" msgid "Save image as" msgstr "Zapisz obrazek jako" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Dokument nie zawiera indeksu" diff --git a/po/ru.po b/po/ru.po index 875311b..82e63b8 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-06-20 14:58+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Russian (http://www.transifex.com/projects/p/zathura/language/" @@ -31,8 +31,8 @@ msgstr "Получен неверный индекс %s" #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Документ не открыт" @@ -417,7 +417,7 @@ msgstr "Скопировать изображение" msgid "Save image as" msgstr "" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "В документе нету индекса" diff --git a/po/ta_IN.po b/po/ta_IN.po index 529d853..9070b49 100644 --- a/po/ta_IN.po +++ b/po/ta_IN.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-04-03 15:25+0000\n" "Last-Translator: mankand007 \n" "Language-Team: Tamil (India) (http://www.transifex.net/projects/p/zathura/" @@ -30,8 +30,8 @@ msgstr "கொடுக்கப்பட்ட index '%s' தவறு" #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "எந்தக் ஆவணமும் திறக்கப்படவில்லை" @@ -416,7 +416,7 @@ msgstr "படத்தை ஒரு பிரதியெடு" msgid "Save image as" msgstr "" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "இந்த ஆவணத்தில் எந்த index-ம் இல்லை" diff --git a/po/tr.po b/po/tr.po index 879e777..7aa1524 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-05-01 20:38+0000\n" "Last-Translator: hsngrms \n" "Language-Team: Turkish (http://www.transifex.net/projects/p/zathura/language/" @@ -31,8 +31,8 @@ msgstr "Hatalı dizin '%s'" #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Açık belge yok." @@ -417,7 +417,7 @@ msgstr "Resim kopyala" msgid "Save image as" msgstr "" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Bu belge fihrist içermiyor" diff --git a/po/uk_UA.po b/po/uk_UA.po index c7b62ac..2b78821 100644 --- a/po/uk_UA.po +++ b/po/uk_UA.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: zathura\n" -"Report-Msgid-Bugs-To: http://bugs.pwmt.org\n" -"POT-Creation-Date: 2012-11-21 23:42+0100\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-06 21:00+0100\n" "PO-Revision-Date: 2012-06-20 14:58+0000\n" "Last-Translator: Sebastian Ramacher \n" "Language-Team: Ukrainian (Ukraine) (http://www.transifex.com/projects/p/" @@ -31,8 +31,8 @@ msgstr "Вказано невірний індекс: %s" #: ../commands.c:35 ../commands.c:70 ../commands.c:97 ../commands.c:139 #: ../commands.c:253 ../commands.c:283 ../commands.c:309 ../commands.c:401 -#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1020 -#: ../shortcuts.c:1049 +#: ../commands.c:522 ../shortcuts.c:456 ../shortcuts.c:1030 +#: ../shortcuts.c:1059 msgid "No document opened." msgstr "Документ не відкрито." @@ -417,7 +417,7 @@ msgstr "Копіювати картинку" msgid "Save image as" msgstr "" -#: ../shortcuts.c:923 +#: ../shortcuts.c:933 msgid "This document does not contain any index" msgstr "Індекс відсутній в цьому документі" diff --git a/print.c b/print.c index dae6347..b2d5b2b 100644 --- a/print.c +++ b/print.c @@ -106,6 +106,15 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext* return; } + /* try to render the page with out a temporary surface */ + girara_debug("printing page %d ...", page_number); + render_lock(zathura->sync.render_thread); + int err = zathura_page_render(page, cairo, true); + render_unlock(zathura->sync.render_thread); + if (err == ZATHURA_ERROR_OK) { + return; + } + /* we need a temporary cairo object since the cairo object from the print * context doesn't have a width or height */ const gdouble width = gtk_print_context_get_width(context); @@ -136,8 +145,14 @@ cb_print_draw_page(GtkPrintOperation* print_operation, GtkPrintContext* /* render the page to the temporary surface */ girara_debug("printing page %d ...", page_number); render_lock(zathura->sync.render_thread); - zathura_page_render(page, temp_cairo, true); + err = zathura_page_render(page, temp_cairo, true); render_unlock(zathura->sync.render_thread); + if (err != ZATHURA_ERROR_OK) { + cairo_destroy(temp_cairo); + cairo_surface_destroy(surface); + gtk_print_operation_cancel(print_operation); + return; + } /* rescale */ const gdouble scale = MIN(width / page_width, height / page_height);