[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[texworks] 13/73: Imported Debian patch 0.3~svn741-1



This is an automated email from the git hooks/post-receive script.

preining pushed a commit to branch master
in repository texworks.

commit 933a65733c7588b10584d43eec1b77acdd2677e9
Merge: 8f60608 e3f6d23
Author: Atsuhito KOHDA <kohda@debian.org>
Date:   Tue Dec 21 21:17:41 2010 +0900

    Imported Debian patch 0.3~svn741-1

 Info.plist                                         |     2 +-
 README                                             |     2 +-
 TeXworks.plist                                     |     2 +-
 TeXworks.plist.in                                  |     2 +-
 TeXworks.pro                                       |     6 +-
 debian/README.Debian                               |     3 -
 debian/changelog                                   |     8 +
 debian/menu.ex                                     |     2 -
 debian/patch-luatex                                |     2 +-
 debian/patch-plugin                                |     9 +
 debian/patch-print                                 |    28 +-
 debian/postinst.ex                                 |    39 -
 debian/postrm.ex                                   |    37 -
 debian/preinst.ex                                  |    35 -
 debian/prerm.ex                                    |    38 -
 debian/rules                                       |    14 +-
 plugins-src/TWLuaPlugin/TWLuaPlugin.cpp            |     8 +-
 plugins-src/TWLuaPlugin/TWLuaPlugin.h              |     2 +-
 plugins-src/TWLuaPlugin/TWLuaPlugin.pro            |     6 +-
 plugins-src/TWPythonPlugin/TWPythonPlugin.cpp      |     2 +-
 plugins-src/TWPythonPlugin/TWPythonPlugin.h        |     4 +-
 plugins-src/TWPythonPlugin/TWPythonPlugin.pro      |     6 +-
 res/TeXworks.rc                                    |     2 +-
 res/resfiles.qrc                                   |    26 +-
 res/resfiles/completion/tw-latex.txt               |     2 -
 res/resfiles/configuration/syntax-patterns.txt     |     4 +-
 res/resfiles/scripts/Hooks/latexErrors.js          |    89 +-
 res/resfiles/scripts/launchPdf.js                  |     2 +-
 res/resfiles/scripts/system.js                     |     9 +-
 .../templates/Basic LaTeX documents/article.tex    |     2 +-
 res/resfiles/translations/qt_ar.qm                 |   Bin 116781 -> 0 bytes
 res/resfiles/translations/qt_de.qm                 |   Bin 181348 -> 0 bytes
 res/resfiles/translations/qt_fr.qm                 |   Bin 168579 -> 0 bytes
 res/resfiles/translations/qt_ja.qm                 |   Bin 55805 -> 0 bytes
 res/resfiles/translations/qt_ko.qm                 |   Bin 68364 -> 0 bytes
 res/resfiles/translations/qt_nl.qm                 |   Bin 85620 -> 0 bytes
 res/resfiles/translations/qt_pl.qm                 |   Bin 158795 -> 0 bytes
 res/resfiles/translations/qt_ru.qm                 |   Bin 36218 -> 0 bytes
 res/resfiles/translations/qt_zh_CN.qm              |   Bin 31960 -> 0 bytes
 src/CommandlineParser.cpp                          |    30 +-
 src/CommandlineParser.h                            |     2 +-
 src/CompletingEdit.cpp                             |    31 +-
 src/CompletingEdit.h                               |     2 +-
 src/ConfigurableApp.h                              |    57 +
 src/ConfirmDelete.cpp                              |     2 +-
 src/ConfirmDelete.h                                |     2 +-
 src/FindDialog.cpp                                 |    32 +-
 src/FindDialog.h                                   |     3 +-
 src/HardWrapDialog.cpp                             |     2 +-
 src/HardWrapDialog.h                               |     2 +-
 src/PDFDocks.cpp                                   |     5 +-
 src/PDFDocks.h                                     |     2 +-
 src/PDFDocument.cpp                                |   251 +-
 src/PDFDocument.h                                  |     4 +-
 src/PDFDocument.ui                                 |     9 +
 src/PrefsDialog.cpp                                |    14 +-
 src/PrefsDialog.h                                  |     2 +-
 src/PrefsDialog.ui                                 |    69 +-
 src/ScriptManager.cpp                              |    16 +-
 src/ScriptManager.h                                |     2 +-
 src/TWApp.cpp                                      |   153 +-
 src/TWApp.h                                        |    41 +-
 src/TWScript.cpp                                   |   105 +-
 src/TWScript.h                                     |    45 +-
 src/TWScriptAPI.cpp                                |   180 +-
 src/TWScriptAPI.h                                  |    78 +-
 src/TWScriptable.cpp                               |   179 +-
 src/TWScriptable.h                                 |   104 +-
 src/TWSystemCmd.h                                  |    98 +
 src/TWUtils.cpp                                    |   312 +-
 src/TWUtils.h                                      |    35 +-
 src/TWVersion.h                                    |    21 +
 src/TeXDocks.cpp                                   |     6 +-
 src/TeXDocks.h                                     |     2 +-
 src/TeXDocument.cpp                                |   105 +-
 src/TeXDocument.h                                  |     4 +-
 src/TeXHighlighter.cpp                             |     2 +-
 src/TeXHighlighter.h                               |     2 +-
 src/TemplateDialog.cpp                             |     2 +-
 src/TemplateDialog.h                               |     2 +-
 src/main.cpp                                       |     9 +-
 src/synctex_parser.c                               |     8 +-
 src/synctex_parser_utils.c                         |    47 +-
 src/synctex_parser_utils.h                         |     4 +-
 src/synctex_parser_version.txt                     |     1 +
 texworks.desktop                                   |     3 +-
 trans/README                                       |    28 +
 trans/TeXworks_ar.qm                               |   Bin 37751 -> 45480 bytes
 trans/TeXworks_ar.ts                               |  1202 +-
 trans/TeXworks_ca.qm                               |   Bin 40632 -> 49328 bytes
 trans/TeXworks_ca.ts                               |  4821 ++++----
 trans/TeXworks_cs.qm                               |   Bin 39851 -> 48175 bytes
 trans/TeXworks_cs.ts                               |  1195 +-
 trans/TeXworks_de.qm                               |   Bin 47267 -> 50545 bytes
 trans/TeXworks_de.ts                               |   936 +-
 trans/TeXworks_es.qm                               |   Bin 46832 -> 51324 bytes
 trans/TeXworks_es.ts                               |  1200 +-
 trans/TeXworks_fa.qm                               |   Bin 38435 -> 46166 bytes
 trans/TeXworks_fa.ts                               |   447 +-
 trans/TeXworks_fr.qm                               |   Bin 38859 -> 48067 bytes
 trans/TeXworks_fr.ts                               |  1260 ++-
 trans/TeXworks_ko.qm                               |   Bin 31679 -> 38270 bytes
 trans/TeXworks_ko.ts                               |   453 +-
 trans/TeXworks_ru.qm                               |   Bin 45951 -> 49304 bytes
 trans/TeXworks_ru.ts                               |   469 +-
 trans/TeXworks_tr.qm                               |   Bin 39563 -> 47924 bytes
 trans/TeXworks_tr.ts                               |   384 +-
 trans/TeXworks_zh_CN.qm                            |   Bin 32571 -> 36078 bytes
 trans/TeXworks_zh_CN.ts                            |   272 +-
 trans/qt/qt_ar.qm                                  |   Bin 0 -> 33910 bytes
 trans/{ => qt}/qt_ar.ts                            |  1708 ++-
 trans/qt/qt_ca.qm                                  |   Bin 0 -> 143531 bytes
 trans/qt/qt_ca.ts                                  |  5329 +++++++++
 trans/qt/qt_cs.qm                                  |   Bin 0 -> 245782 bytes
 trans/qt/qt_cs.ts                                  | 10362 ++++++++++++++++++
 trans/qt/qt_de.qm                                  |   Bin 0 -> 320659 bytes
 trans/qt/qt_de.ts                                  |  9800 +++++++++++++++++
 {res/resfiles/translations => trans/qt}/qt_es.qm   |   Bin 81845 -> 82411 bytes
 trans/{qt_ar.ts => qt/qt_es.ts}                    |  2933 ++---
 trans/qt/qt_fr.qm                                  |   Bin 0 -> 250219 bytes
 trans/qt/qt_fr.ts                                  | 10970 +++++++++++++++++++
 trans/qt/qt_it.qm                                  |   Bin 0 -> 88236 bytes
 trans/qt/qt_it.ts                                  |  5322 +++++++++
 trans/qt/qt_ja.qm                                  |   Bin 0 -> 185664 bytes
 trans/qt/qt_ja.ts                                  |  9750 ++++++++++++++++
 trans/qt/qt_ko.qm                                  |   Bin 0 -> 84614 bytes
 trans/{ => qt}/qt_ko.ts                            |  3209 ++++--
 trans/qt/qt_nl.qm                                  |   Bin 0 -> 144243 bytes
 trans/qt/qt_nl.ts                                  |  5341 +++++++++
 trans/qt/qt_pl.qm                                  |   Bin 0 -> 297997 bytes
 trans/qt/qt_pl.ts                                  |  9773 +++++++++++++++++
 trans/qt/qt_pt_BR.qm                               |   Bin 0 -> 143803 bytes
 trans/qt/qt_pt_BR.ts                               |  5328 +++++++++
 trans/qt/qt_ru.qm                                  |   Bin 0 -> 241435 bytes
 trans/qt/qt_ru.ts                                  |  9731 ++++++++++++++++
 trans/qt/qt_sl.qm                                  |   Bin 0 -> 228474 bytes
 trans/qt/qt_sl.ts                                  | 10197 +++++++++++++++++
 trans/qt/qt_tr.qm                                  |   Bin 0 -> 70920 bytes
 trans/qt/qt_tr.ts                                  |  5322 +++++++++
 trans/qt/qt_zh_CN.qm                               |   Bin 0 -> 117337 bytes
 trans/{qt_ar.ts => qt/qt_zh_CN.ts}                 |  3461 +++---
 141 files changed, 113402 insertions(+), 10281 deletions(-)

diff --cc debian/README.Debian
index 9c1052c,0000000..2367b15
mode 100644,000000..100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@@ -1,20 -1,0 +1,17 @@@
 +texworks for Debian
 +-------------------
 +
 +An environment for authoring TeX (LaTeX, ConTeXt, etc) documents, with
 +a Unicode-based, TeX-aware editor, integrated PDF viewer, and a clean,
 +simple interface accessible to casual and non-technical users.
 +
 +Note to use synctex feature you need to install TeX Live 2009 which
 +will be in Debian soon.
 +
 +Temporary modifications:
 +1. I borrowed texworks.desktop, texworks.xpm and texworks.1 by
 +Stefan Löffler <st.loeffler@gmail.com> in texworks-0.1.0~svn335~jaunty1
 +and I modified them a bit for Debian, especially, texworks.xpm 
 +was converted from texworks.png
 +
- 2. I enabled to print PDF directly with a patch in
-     http://code.google.com/p/texworks/issues/detail?id=78
- 
 + -- Atsuhito KOHDA <kohda@debian.org>  Sun, 11 Oct 2009 15:25:52 +0900
diff --cc debian/changelog
index 0357d74,0000000..69c9520
mode 100644,000000..100644
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,61 -1,0 +1,69 @@@
++texworks (0.3~svn741-1) unstable; urgency=low
++
++  * New Upstream Release. (Rev. 741)
++  * Removed printing support.  Now it will offer to open the document
++    in the system's default viewer.
++
++ -- Atsuhito KOHDA <kohda@debian.org>  Tue, 21 Dec 2010 21:17:41 +0900
++
 +texworks (0.3~svn671-2) unstable; urgency=low
 +
 +  * Uploaded to unstable.
 +
 + -- Atsuhito KOHDA <kohda@debian.org>  Thu, 19 Aug 2010 15:15:38 +0900
 +
 +texworks (0.3~svn671-1) experimental; urgency=low
 +
 +  * New Upstream Release. (Rev.671)
 +  * Updated patches.
 +
 + -- Atsuhito KOHDA <kohda@debian.org>  Tue, 03 Aug 2010 15:31:17 +0900
 +
 +texworks (0.3~svn606-1) experimental; urgency=low
 +
 +  * New Upstream Release. (Rev.606)
 +  * Updated patches.
 +
 + -- Atsuhito KOHDA <kohda@debian.org>  Thu, 15 Apr 2010 08:15:38 +0900
 +
 +texworks (0.3~svn569-3) experimental; urgency=low
 +
 +  * Fixed TWPythonPlugin compilation problems on AMD64 by consulting
 +    a package of Stefan Löffler.  (Closes: #570841)
 +  * Modified TW_HELPPATH as a package of Stefan Löffler.  I expect one can
 +    use a texworks-help-en package by Stefan Löffler now.
 +  * Added LuaTeX in a list of Typeset engines for experiment.
 +
 + -- Atsuhito KOHDA <kohda@debian.org>  Mon, 22 Feb 2010 12:52:39 +0900
 +
 +texworks (0.3~svn569-2) experimental; urgency=low
 +
 +  * Added Lua and Python scripting plugins.  These are called
 +    texworks-scripting-lua and texworks-scripting-python following packages
 +    (Ubuntu version) of Stefan Löffler.
 +
 + -- Atsuhito KOHDA <kohda@debian.org>  Thu, 18 Feb 2010 09:14:31 +0900
 +
 +texworks (0.3~svn569-1) experimental; urgency=low
 +
 +  * SVN version for experiment.
 +
 + -- Atsuhito KOHDA <kohda@debian.org>  Mon, 15 Feb 2010 22:09:05 +0900
 +
 +texworks (0.2.3-2) unstable; urgency=low
 +
 +  * Rebuild under poppler 0.12  (Closes: #551435)
 +  * Added note on synctex feature in README.Debian
 +  * Fixed copyright file to express Jérôme Laurens correctly
 +  * Added texlive-latex-base and texlive-xetex to Recommends and Suggests
 +    respectively.
 +  * Moved "uudecode debian/document-print.png.enc" to configure-stamp
 +    from build-stamp because configure searched it.
 +
 + -- Atsuhito KOHDA <kohda@debian.org>  Sun, 18 Oct 2009 19:16:52 +0900
 +
 +texworks (0.2.3-1) unstable; urgency=low
 +
 +  * Initial release (Closes: #538211)
 +
 + -- Atsuhito KOHDA <kohda@debian.org>  Sun, 11 Oct 2009 15:25:52 +0900
diff --cc debian/patch-luatex
index 9a107cd,0000000..9dcbae6
mode 100644,000000..100644
--- a/debian/patch-luatex
+++ b/debian/patch-luatex
@@@ -1,11 -1,0 +1,11 @@@
 +--- texworks-0.3/src/TWApp.cpp.orig	2010-02-22 13:19:33.000000000 +0900
 ++++ texworks-0.3/src/TWApp.cpp	2010-02-22 13:20:27.000000000 +0900
- @@ -816,6 +816,8 @@
++@@ -841,6 +841,8 @@
 + 		<< Engine("pdfLaTeX", "pdflatex" EXE, QStringList("$synctexoption") << "$fullname", true)
 + 		<< Engine("XeTeX", "xetex" EXE, QStringList("$synctexoption") << "$fullname", true)
 + 		<< Engine("XeLaTeX", "xelatex" EXE, QStringList("$synctexoption") << "$fullname", true)
 ++		<< Engine("LuaTeX", "luatex" EXE, QStringList("$synctexoption") << "$fullname", true)
 ++		<< Engine("LuaLaTeX", "lualatex" EXE, QStringList("$synctexoption") << "$fullname", true)
 + 		<< Engine("ConTeXt", "texmfstart" EXE, QStringList("texexec") << "$fullname", true)
 + 		<< Engine("XeConTeXt", "texmfstart" EXE, QStringList("texexec") << "--xtx" << "$fullname", true)
 + 		<< Engine("BibTeX", "bibtex" EXE, QStringList("$basename"), false)
diff --cc debian/patch-plugin
index c02e67a,0000000..2650101
mode 100644,000000..100644
--- a/debian/patch-plugin
+++ b/debian/patch-plugin
@@@ -1,13 -1,0 +1,22 @@@
 +--- texworks-0.3~svn569.orig/TeXworks.pro
 ++++ texworks-0.3~svn569/TeXworks.pro
++@@ -31,7 +31,7 @@
++ 
++ # packagers should override this to identify the source of the particular TeXworks build;
++ # avoid spaces or other chars that would need quoting on the command line
++-QMAKE_CXXFLAGS += -DTW_BUILD_ID=personal
+++QMAKE_CXXFLAGS += -DTW_BUILD_ID=Debian
++ 
++ # comment this out if poppler's xpdf headers are not available on the build system
++ QMAKE_CXXFLAGS += -DHAVE_POPPLER_XPDF_HEADERS
 +@@ -95,8 +95,8 @@
 + 
 + 	# Enclose the path in \\\" (which later gets expanded to \", which in turn
 + 	# gets expanded to " in the c++ code)
 +-	QMAKE_CXXFLAGS += -DTW_HELPPATH=\\\"/usr/local/share/texworks-help\\\"
 +-	QMAKE_CXXFLAGS += -DTW_PLUGINPATH=\\\"/usr/local/lib/texworks\\\"
 ++	QMAKE_CXXFLAGS += -DTW_HELPPATH=\\\"/usr/share/doc/texworks-help\\\"
 ++	QMAKE_CXXFLAGS += -DTW_PLUGINPATH=\\\"/usr/lib/texworks\\\"
 + 	QMAKE_CXXFLAGS += -DTW_DICPATH=\\\"/usr/share/myspell/dicts\\\"
 + }
 + 
diff --cc debian/patch-print
index 61f290e,0000000..15f2baa
mode 100644,000000..100644
--- a/debian/patch-print
+++ b/debian/patch-print
@@@ -1,378 -1,0 +1,370 @@@
 +--- texworks-0.0.1~svn337.orig/src/TeXDocument.h
 ++++ texworks-0.0.1~svn337/src/TeXDocument.h
- @@ -133,6 +133,7 @@
++@@ -135,6 +135,7 @@
 + public slots:
 + 	void typeset();
 + 	void interrupt();
 ++	void print();
 + 	void newFile();
 + 	void newFromTemplate();
 + 	void open();
 +--- texworks-0.0.1~svn337.orig/src/PDFDocument.cpp
 ++++ texworks-0.0.1~svn337/src/PDFDocument.cpp
 +@@ -49,6 +49,11 @@
 + #include <QFileSystemWatcher>
 + #include <QDebug>
 + #include <QToolTip>
 ++#include <QPrinter>
 ++#include <QPrintDialog>
 ++#include <QPrintEngine>
 ++#include <QBuffer>
 ++#include <QProgressDialog>
 + 
 + #include <math.h>
 + 
 +@@ -1136,6 +1141,7 @@
 + 	connect(actionNew, SIGNAL(triggered()), qApp, SLOT(newFile()));
 + 	connect(actionNew_from_Template, SIGNAL(triggered()), qApp, SLOT(newFromTemplate()));
 + 	connect(actionOpen, SIGNAL(triggered()), qApp, SLOT(open()));
 ++	connect(actionPrintPDF, SIGNAL(triggered()), this, SLOT(print()));
 + 
 + 	connect(actionQuit_TeXworks, SIGNAL(triggered()), TWApp::instance(), SLOT(maybeQuit()));
 + 
 +@@ -1716,3 +1722,203 @@
 + 	}
 + }
 + 
 ++void PDFDocument::print()
 ++{
 ++	QPrinter printer(QPrinter::HighResolution);
 ++	QPrintDialog printDlg(&printer, this);
 ++	QPainter painter;
 ++	QProgressDialog progressDlg(this);
 ++	Poppler::Page * page;
 ++	QImage pageImage;
 ++	QRect viewport;
 ++	int dpiX, dpiY;
 ++	double dpiXScale = 1.0, dpiYScale = 1.0;
 ++	double scale;
 ++	unsigned int firstPage, lastPage, i;
 ++	bool success = false;
 ++	
 ++	// check if there's a pdf document to print
 ++	if(!document) return;
 ++
 ++	// check if we have permission to print the document
 ++	if(!document->okToPrint()) {
 ++		QMessageBox::critical(this, tr("Printing denied"), tr("You are not permitted to print this document"));
 ++		return;
 ++	}
 ++	
 ++	// Set up some basic information about the document
 ++	printer.setCreator(TEXWORKS_NAME);
 ++	printer.setDocName(document->info("Title"));
 ++	if(printer.docName().isEmpty()) printer.setDocName(QFileInfo(curFile).baseName());
 ++	
 ++	// do some setup for the print dialog
 ++	printDlg.setMinMax(1, document->numPages());
 ++	printDlg.setOption(QAbstractPrintDialog::PrintToFile, true);
 ++	printDlg.setOption(QAbstractPrintDialog::PrintSelection, false);
 ++	printDlg.setOption(QAbstractPrintDialog::PrintPageRange, true);
 ++	printDlg.setOption(QAbstractPrintDialog::PrintCollateCopies, true);
 ++	printDlg.setWindowTitle(tr("Print %1").arg(QFileInfo(curFile).fileName()));
 ++	
 ++	// show the print dialog to the user
 ++	if(printDlg.exec() != QDialog::Accepted) return;
 ++
 ++	// determine the print range
 ++	switch(printDlg.printRange()) {
 ++		case QAbstractPrintDialog::PageRange:
 ++			firstPage = printDlg.fromPage();
 ++			lastPage = printDlg.toPage();
 ++			break;
 ++		default:
 ++			firstPage = 1;
 ++			lastPage = document->numPages();
 ++	}
 ++
 ++	// On *nix-like platforms, try using lp for printing
 ++	#if defined(Q_WS_X11) || defined(Q_WS_MAC)
 ++	// Catch empty printer names (e.g. used by CUPS for "printing to pdf")
 ++	if(!printer.printerName().isEmpty()) {
 ++		QStringList arguments;
 ++		
 ++		arguments << "lp";
 ++		
 ++		arguments << QString("-d %1").arg(printer.printerName());
 ++		arguments << QString("-n %1").arg(printer.numCopies());
 ++		arguments << QString("-t \"%1\"").arg(printer.docName());
 ++		arguments << QString("-P %1-%2").arg(firstPage).arg(lastPage);
 ++
 ++		switch(printer.duplex()) {
 ++			case QPrinter::DuplexNone:
 ++				arguments << "-o sides=one-sided";
 ++				break;
 ++			case QPrinter::DuplexShortSide:
 ++				arguments << "-o sides=two-sided-short-edge";
 ++				break;
 ++			case QPrinter::DuplexLongSide:
 ++				arguments << "-o sides=two-sided-long-edge";
 ++				break;
 ++			default:
 ++				break;
 ++		}
 ++		arguments << "--";
 ++
 ++		arguments << QString("\"%1\"").arg(curFile);
 ++		
 ++		// passing arguments as QStringList didn't work for me - probably
 ++		// because of improper quoting of spaces
 ++		if(QProcess::execute(arguments.join(" ")) == 0) return;
 ++	}
 ++	#endif // On *nix, try using lpr for printing
 ++	
 ++	// On Windows, try using OS native operation
 ++	#if defined(Q_WS_WIN)
 ++	{
 ++		// First try: directly passing postscript to the printer (if supported)
 ++		// I'm not sure if this is supported anywhere
 ++		// Note: QPrinter::getDC and QPrinter::releaseDC are undocumented
 ++		HDC dc;
 ++		Poppler::PSConverter * psConv;
 ++		
 ++		dc = printer.getDC();
 ++		
 ++		if(dc) {
 ++			int nEscapeCode = POSTSCRIPT_PASSTHROUGH;
 ++			if(ExtEscape(dc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&nEscapeCode, 0, NULL ) > 0 && (psConv = document->psConverter())) {
 ++				// Convert the pdf to postscript instructions
 ++				QBuffer buffer;
 ++				
 ++				buffer.open(QBuffer::ReadWrite);
 ++				psConv->setOutputDevice(&buffer);
 ++				psConv->convert();
 ++				
 ++				// and send them to the printer
 ++				success = (ExtEscape(dc, POSTSCRIPT_PASSTHROUGH, buffer.data().size(), buffer.data().data(), 0, NULL) > 0);
 ++				
 ++				buffer.close();
 ++			}
 ++			printer.releaseDC(dc);
 ++			if(success) return;
 ++		}
 ++		// Second try: print by calling the system's standard printing program for pdf
 ++		// Seems to only print to the default printer, hence disabled for now
 ++/*
 ++		wchar_t * filename;
 ++		HRESULT coInit;
 ++		filename = new wchar_t[curFile.size()];
 ++
 ++		curFile.toWCharArray(filename);
 ++		coInit = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
 ++		if(coInit == S_OK || coInit == S_FALSE) {
 ++			success = ((int)ShellExecute(NULL, L"print", filename, NULL, NULL, SW_NORMAL) > 32);
 ++			CoUninitialize();
 ++		}
 ++		delete[] filename;
 ++		if(success) return;
 ++*/
 ++	}
 ++	#endif // On Windows, try using OS native operation
 ++	
 ++	// Fallback: use Qt for printing
 ++	//
 ++	// This means rendering the pages as images via poppler and printing those
 ++	// To keep the rendering time and file size reasonable, resolution is
 ++	// clamped to a maximum of 300dpi. If you need more, use another program ;).
 ++
 ++	{
 ++		// ignore printer margins while painting - the margins are included in the
 ++		// pdf file
 ++		printer.setFullPage(true);
 ++	
 ++		painter.begin(&printer);
 ++		viewport = painter.viewport();
 ++	
 ++		dpiX = printer.printEngine()->metric(QPaintDevice::PdmDpiX);
 ++		dpiY = printer.printEngine()->metric(QPaintDevice::PdmDpiY);
 ++	
 ++		// clamp the resolution to 300 dpi (postscript devices return 1200 dpi to
 ++		// Qt by default) to reduce file size and render time
 ++		dpiXScale = qMax(1, dpiX / 300);
 ++		dpiYScale = qMax(1, dpiY / 300);
 ++		dpiX = qMin(300, dpiX);
 ++		dpiY = qMin(300, dpiY);
 ++
 ++		progressDlg.setAutoClose(true);
 ++		progressDlg.setRange(firstPage, lastPage + 1);
 ++		progressDlg.setWindowModality(Qt::WindowModal);
 ++		for(i = firstPage; i <= lastPage && !progressDlg.wasCanceled(); ++i) {
 ++			progressDlg.setValue(i - firstPage);
 ++			progressDlg.setLabelText(tr("Printing page %1 of %2").arg(i - firstPage + 1).arg(lastPage - firstPage + 1));
 ++
 ++			page = document->page(i - 1);
 ++			if(page) {
 ++				pageImage = page->renderToImage(dpiX, dpiY);
 ++				painter.save();
 ++			
 ++				// calculate the scale factor necessary to resize the page image to
 ++				// the real page while retaining the aspect ratio
 ++				scale = qMin((double)viewport.width() / (dpiXScale * pageImage.width()), (double)viewport.height() / (dpiYScale * pageImage.height()));
 ++			
 ++				// if we need to shrink the page, so be it
 ++				if(scale < 1) {
 ++					painter.scale(scale, scale);
 ++				}
 ++				// otherwise center the page image on the page
 ++				// TODO: handle landscape etc.
 ++				else {
 ++					painter.translate( (viewport.width() - dpiXScale * pageImage.width()) / 2, (viewport.height() - dpiYScale * pageImage.height()) / 2);
 ++				}
 ++				painter.scale(dpiXScale, dpiYScale);
 ++			
 ++				painter.drawImage(0, 0, pageImage);
 ++			
 ++				painter.restore();
 ++			}
 ++		
 ++			if(i != lastPage) printer.newPage();
 ++		}
 ++		
 ++		if(progressDlg.wasCanceled()) printer.abort();
 ++		else painter.end();
 ++		
 ++		progressDlg.reset();
 ++	}
 ++}
 +--- texworks-0.0.1~svn337.orig/src/TeXDocument.ui
 ++++ texworks-0.0.1~svn337/src/TeXDocument.ui
 +@@ -163,7 +163,7 @@
 +      <x>0</x>
 +      <y>0</y>
 +      <width>780</width>
 +-     <height>22</height>
 ++     <height>25</height>
 +     </rect>
 +    </property>
 +    <widget class="QMenu" name="menuFile">
 +@@ -180,6 +180,7 @@
 +     <addaction name="actionSave_As"/>
 +     <addaction name="actionSave_All"/>
 +     <addaction name="actionRevert_to_Saved"/>
 ++    <addaction name="actionPrintSource"/>
 +     <addaction name="separator"/>
 +     <addaction name="actionRemove_Aux_Files"/>
 +     <addaction name="separator"/>
 +@@ -1096,6 +1097,18 @@
 +     <enum>QAction::NoRole</enum>
 +    </property>
 +   </action>
 ++  <action name="actionPrintSource">
 ++   <property name="icon">
 ++    <iconset resource="../res/resources.qrc">
 ++     <normaloff>:/images/tango/document-print.png</normaloff>:/images/tango/document-print.png</iconset>
 ++   </property>
 ++   <property name="text">
 ++    <string>Print</string>
 ++   </property>
 ++   <property name="shortcut">
 ++    <string>Ctrl+P</string>
 ++   </property>
 ++  </action>
 +  </widget>
 +  <customwidgets>
 +   <customwidget>
 +--- texworks-0.0.1~svn337.orig/src/TeXDocument.cpp
 ++++ texworks-0.0.1~svn337/src/TeXDocument.cpp
 +@@ -56,6 +56,8 @@
 + #include <QFileSystemWatcher>
 + #include <QTextBrowser>
 + #include <QDebug>
 ++#include <QPrinter>
 ++#include <QPrintDialog>
 + 
 + #ifdef Q_WS_WIN
 + #include <windows.h>
 +@@ -171,6 +173,7 @@
 + 	connect(actionSave_All, SIGNAL(triggered()), this, SLOT(saveAll()));
 + 	connect(actionRevert_to_Saved, SIGNAL(triggered()), this, SLOT(revert()));
 + 	connect(actionClose, SIGNAL(triggered()), this, SLOT(close()));
 ++	connect(actionPrintSource, SIGNAL(triggered()), this, SLOT(print()));
 + 
 + 	connect(actionRemove_Aux_Files, SIGNAL(triggered()), this, SLOT(removeAuxFiles()));
 + 
- @@ -2844,3 +2847,26 @@
++@@ -2907,3 +2910,26 @@
 + 		pdfDoc = NULL;
 + 	}
 + }
 ++
 ++void TeXDocument::print()
 ++{
 ++	QPrinter printer(QPrinter::HighResolution);
 ++	QPrintDialog printDlg(&printer, this);
 ++
 ++	// Set up some basic information about the document
 ++	printer.setCreator(TEXWORKS_NAME);
 ++	printer.setDocName(QFileInfo(curFile).baseName());
 ++
 ++	// do some setup for the print dialog
 ++	// Note: no page range since we don't know how many pages this will be.
 ++	printDlg.setOption(QAbstractPrintDialog::PrintToFile, true);
 ++	printDlg.setOption(QAbstractPrintDialog::PrintSelection, true);
 ++	printDlg.setOption(QAbstractPrintDialog::PrintPageRange, false);
 ++	printDlg.setOption(QAbstractPrintDialog::PrintCollateCopies, true);
 ++	printDlg.setWindowTitle(tr("Print %1").arg(QFileInfo(curFile).fileName()));
 ++
 ++	// show the print dialog to the user
 ++	if(printDlg.exec() != QDialog::Accepted) return;
 ++	
 ++	textEdit->print(&printer);
 ++}
 +--- texworks-0.0.1~svn337.orig/src/PDFDocument.ui
 ++++ texworks-0.0.1~svn337/src/PDFDocument.ui
 +@@ -23,7 +23,7 @@
 +      <x>0</x>
 +      <y>0</y>
 +      <width>800</width>
 +-     <height>22</height>
 ++     <height>25</height>
 +     </rect>
 +    </property>
 +    <widget class="QMenu" name="menuHelp">
- @@ -43,6 +43,7 @@
-      <addaction name="actionNew_from_Template"/>
-      <addaction name="actionOpen"/>
-      <addaction name="actionOpen_Recent"/>
- +    <addaction name="actionPrintPDF"/>
-      <addaction name="separator"/>
-      <addaction name="actionClose"/>
-      <addaction name="separator"/>
- @@ -729,6 +730,18 @@
-      <enum>QAction::NoRole</enum>
++@@ -736,6 +736,18 @@
 +    </property>
-    </action>
++    <property name="shortcut">
++     <string>Ctrl+P</string>
+++   </property>
+++  </action>
 ++  <action name="actionPrintPDF">
 ++   <property name="icon">
 ++    <iconset resource="../res/resources.qrc">
 ++     <normaloff>:/images/tango/document-print.png</normaloff>:/images/tango/document-print.png</iconset>
 ++   </property>
 ++   <property name="text">
 ++    <string>Print...</string>
 ++   </property>
 ++   <property name="shortcut">
 ++    <string>Ctrl+P</string>
- +   </property>
- +  </action>
++    </property>
++   </action>
 +  </widget>
-   <resources>
-    <include location="../res/resources.qrc"/>
 +--- texworks-0.0.1~svn337.orig/src/PDFDocument.h
 ++++ texworks-0.0.1~svn337/src/PDFDocument.h
- @@ -251,6 +251,7 @@
++@@ -252,6 +252,7 @@
 + public slots:
 + 	void texClosed(QObject *obj);
 + 	void reload();
 ++	void print();
 + 	void retypeset();
 + 	void interrupt();
 + 	void sideBySide();
 +--- texworks-0.0.1~svn337.orig/res/resources.qrc
 ++++ texworks-0.0.1~svn337/res/resources.qrc
 +@@ -19,6 +19,7 @@
 +         <file>tango/document-open.png</file>
 +         <file>images/fileprint.png</file>
 +         <file>tango/document-save.png</file>
 ++        <file>tango/document-print.png</file>
 +         <file>tango/go-first.png</file>
 +         <file>images/fitwidth.png</file>
 +         <file>images/fitwindow.png</file>
diff --cc debian/rules
index b5215cb,0000000..9599e9a
mode 100755,000000..100755
--- a/debian/rules
+++ b/debian/rules
@@@ -1,131 -1,0 +1,131 @@@
 +#!/usr/bin/make -f
 +# -*- makefile -*-
 +# Sample debian/rules that uses debhelper.
 +# This file was originally written by Joey Hess and Craig Small.
 +# As a special exception, when this file is copied by dh-make into a
 +# dh-make output file, you may use that output file without restriction.
 +# This special exception was added by Craig Small in version 0.37 of dh-make.
 +
 +# Uncomment this to turn on verbose mode.
 +#export DH_VERBOSE=1
 +
 +USDIR=$(CURDIR)/debian/texworks/usr/share
 +PLIDIR=plugins-src/TWLuaPlugin
 +PLIPYT=plugins-src/TWPythonPlugin
 +
 +configure: configure-stamp
 +configure-stamp:
 +	dh_testdir
 +	# Add here commands to configure the package.
- 	patch -p1 < ./debian/patch-print
- 	uudecode debian/document-print.png.enc
- 	mv document-print.png res/tango/
++#	patch -p1 < ./debian/patch-print
++#	uudecode debian/document-print.png.enc
++#	mv document-print.png res/tango/
 +	patch -p1 < ./debian/patch-plugin
 +	patch -p1 < ./debian/patch-luatex
- 	qmake-qt4
++#	qmake-qt4 
 +
 +	touch configure-stamp
 +
 +
 +build: build-stamp
 +
 +build-stamp: configure-stamp  
 +	dh_testdir
 +
 +	# Add here commands to compile the package.
- 	$(MAKE)
 +	# Lua plugin
 +	cd $(PLIDIR) && qmake-qt4 -after 'target.path = /usr/lib/texworks' && $(MAKE)
 +	# Python plugin
 +	cd $(PLIPYT) && qmake-qt4 -after 'target.path = /usr/lib/texworks' && $(MAKE)
++	qmake-qt4 && $(MAKE)
 +	#docbook-to-man debian/texworks.sgml > texworks.1
 +
 +	touch $@
 +
 +clean: 
 +	dh_testdir
 +	dh_testroot
 +	rm -f build-stamp configure-stamp 
 +
 +	# Add here commands to clean up after the build process.
 +	if [ -f Makefile ]; then $(MAKE) clean; fi
 +	rm -f ./texworks ./Makefile src/DefaultBinaryPaths.h
 +	if [ -d moc ]; then rmdir moc; fi
 +	if [ -d obj ]; then rmdir obj; fi
 +	if [ -d rcc ]; then rmdir rcc; fi
 +	if [ -d ui ]; then rmdir ui; fi
 +	if [ -f $(PLIDIR)/Makefile ]; then cd $(PLIDIR) && $(MAKE) clean; fi
 +	if [ -d $(PLIDIR)/moc ]; then rmdir $(PLIDIR)/moc; fi
 +	if [ -d $(PLIDIR)/obj ]; then rmdir $(PLIDIR)/obj; fi
 +	if [ -d $(PLIDIR)/rcc ]; then rmdir $(PLIDIR)/rcc; fi
 +	if [ -d $(PLIDIR)/ui ]; then rmdir $(PLIDIR)/ui; fi
 +	if [ -f $(PLIPYT)/Makefile ]; then cd $(PLIPYT) && $(MAKE) clean; fi
 +	if [ -d $(PLIPYT)/moc ]; then rmdir $(PLIPYT)/moc; fi
 +	if [ -d $(PLIPYT)/obj ]; then rmdir $(PLIPYT)/obj; fi
 +	if [ -d $(PLIPYT)/rcc ]; then rmdir $(PLIPYT)/rcc; fi
 +	if [ -d $(PLIPYT)/ui ]; then rmdir $(PLIPYT)/ui; fi
 +	patch -NRp1 < ./debian/patch-luatex || true
- 	patch -NRp1 < ./debian/patch-print || true
++#	patch -NRp1 < ./debian/patch-print || true
 +	patch -NRp1 < ./debian/patch-plugin || true
 +
- 	rm -f document-print.png res/tango/document-print.png
++#	rm -f document-print.png res/tango/document-print.png
 +	rm -f $(PLIDIR)/libTWLuaPlugin.so $(PLIDIR)/Makefile
 +	rm -f $(PLIPYT)/libTWPythonPlugin.so $(PLIPYT)/Makefile
 +
 +	dh_clean 
 +
 +install: build
 +	dh_testdir
 +	dh_testroot
 +	dh_prep  
 +	dh_installdirs -A
 +
 +	# Add here commands to install the package into debian/texworks.
 +#	$(MAKE) DESTDIR=$(CURDIR)/debian/texworks install
 +	install -m 755 -p ./texworks $(CURDIR)/debian/texworks/usr/bin
 +	cp debian/texworks.xpm $(USDIR)/pixmaps/
 +	cp debian/texworks.desktop $(USDIR)/applications/
 +	install -m 755 -p "$(PLIDIR)/libTWLuaPlugin.so" \
 +	$(CURDIR)/debian/texworks-scripting-lua/usr/lib/texworks
 +	install -m 755 -p "$(PLIPYT)/libTWPythonPlugin.so" \
 +	$(CURDIR)/debian/texworks-scripting-python/usr/lib/texworks
 +
 +# Build architecture-independent files here.
 +binary-indep: install
 +# We have nothing to do by default.
 +
 +# Build architecture-dependent files here.
 +binary-arch: install
 +	dh_testdir
 +	dh_testroot
 +	dh_installchangelogs 
 +	dh_installdocs
 +	dh_installexamples
 +#	dh_install
 +	dh_installmenu
 +#	dh_installdebconf
 +#	dh_installlogrotate
 +#	dh_installemacsen
 +#	dh_installpam
 +#	dh_installmime
 +#	dh_python
 +#	dh_installinit
 +#	dh_installcron
 +#	dh_installinfo
 +	dh_installman debian/texworks.1
 +	dh_link
 +	dh_strip
 +	dh_compress
 +	dh_fixperms
 +#	dh_perl
 +#	dh_makeshlibs
 +	dh_installdeb
 +	dh_shlibdeps
 +	dh_gencontrol
 +	dh_md5sums
 +	dh_builddeb
 +
 +binary: binary-indep binary-arch
 +.PHONY: build clean binary-indep binary-arch binary install configure
 +#%:
 +#	dh  $@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-tex/texworks.git


Reply to: