Browse Source

Share outputter code bettween wkhtmltopdf and wkhtmltoimage

Jakob Truelsen 15 years ago
parent
commit
80d85e4d7a

+ 0 - 13
src/image/arguments.cc

@@ -76,19 +76,6 @@ void ArgHandler::useDefault(CommandLineParserPrivate & parser) {
 	Q_UNUSED(parser);
 } 
 
-/*!
-  \fn ArgHandler::getDesc() const
-  Get the description of this switch
-*/  
-QString ArgHandler::getDesc() const {
-	return desc;
-}
-
-/*!
-  \fn ArgHandler::~ArgHandler()
-  Dummy virtual destructor
-*/  
-ArgHandler::~ArgHandler() {}
 
 /*!
   \class CommandLineParserPrivate

+ 2 - 35
src/image/commandlineparser_p.hh

@@ -22,47 +22,14 @@
 #include <QString>
 #include "commandlineparser.hh"
 #include "settings.hh"
+#include "outputter.hh"
 
 class CommandLineParserPrivate;
 
-class ArgHandler {
+class ArgHandler: public ArgHandlerBase {
 public:
-	QString longName;
-	QString desc;
-	char shortSwitch;
-	QVector<QString> argn;
-	bool display;
-	bool extended;
-	bool qthack;
 	virtual bool operator() (const char ** args, CommandLineParserPrivate & parser) = 0;
 	virtual void useDefault(CommandLineParserPrivate & parser);
-	virtual QString getDesc() const;
-	virtual ~ArgHandler();
-};
- 
-
-class Outputter {
-public:
-	virtual ~Outputter() {}
-	virtual void beginSection(const QString & name) = 0;
-	virtual void endSection() = 0;
-	virtual void beginParagraph() = 0;
-	virtual void text(const QString & t) = 0;
-	virtual void bold(const QString & t) =  0;
-	virtual void italic(const QString & t) = 0;
-	virtual void link(const QString & l) = 0;
-	virtual void endParagraph() = 0;
-	virtual void verbatim(const QString & t) = 0;
- 	virtual void beginList(bool ordered=false) = 0;
- 	virtual void endList() = 0;
- 	virtual void listItem(const QString & t) = 0;
-	virtual void beginSwitch() = 0;
-	virtual void cswitch(const ArgHandler * h) = 0;
-	virtual void endSwitch() = 0;
-	void paragraph(const QString & t);
-	static Outputter * text(FILE * fd, bool doc=false, bool extended=false);
-	static Outputter * man(FILE * fd);
-	static Outputter * html(FILE * fd);
 };
 
 class CommandLineParserPrivate {

+ 0 - 125
src/image/htmloutputter.cc

@@ -1,125 +0,0 @@
-/*
- * File:   htmloutputter.cc
- * Author: Christian Sciberras
- * Created: 20 May 2010
- *   This file is part of wkhtmltoimage.
- *   wkhtmltoimage is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, either version 3 of the License, or
- *   (at your option) any later version.
- *   wkhtmltoimage is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *   You should have received a copy of the GNU General Public License
- *   along with wkhtmltoimage.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "commandlineparser_p.hh"
-#include <QTextDocument>
-
-#define S(x) Qt::escape(x).toUtf8().constData()
-
-class HtmlOutputter: public Outputter {
-private:
-	FILE * fd;
-	bool ordered;
-public:
-	HtmlOutputter(FILE * _): fd(_) {
-		fprintf(fd,
-				"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
-				"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\n"
-				"<head>\n"
-				"  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n"
-				"  <title>wkhtmltoimage - Manual</title>\n"
-				"  <style type=\"text/css\">\n"
-				"    body {width: 70em}\n"
-				"    .short {font-weight: bold; width:2em}\n"
-				"    .long {font-weight: bold; width: 15em}\n"
-				"    .arg {font-style: italic; width: 12em}\n"
-				"    tr {vertical-align: top}\n"
-				"  </style>\n"
-				"</head><body>");
-	}
-
-	~HtmlOutputter() {
-		fprintf(fd,"</body></html>\n");
-	}
-
-	void beginSection(const QString & name) {
-		fprintf(fd, "<h1>%s</h1>\n", S(name));
-	}
-
-	void endSection() {
-	}
-
-	void beginParagraph() {
-		fprintf(fd,"<p>");
-	}
-
-	void endParagraph() {
-		fprintf(fd,"</p>\n");
-	}
-
-	void text(const QString & t) {
-		fprintf(fd, "%s", S(t));
-	}
-	
-	void bold(const QString & t) {
-		fprintf(fd, "<b>%s</b>", S(t));
-	}
-	
-	void italic(const QString & t) {
-		fprintf(fd, "<i>%s</i>", S(t));
-	}
-
-	void link(const QString & t) {
-		fprintf(fd, "<a href=\"%s\">%s</a>", S(t),S(t));
-	}
-	
-	void verbatim(const QString & t) {
-		fprintf(fd, "<pre>%s</pre>", S(t));
-	}
-
-	void beginList(bool o) {
-		ordered = o;
-		fprintf(fd, ordered?"<ol>":"<ul>");
-	}
-	
-	void endList() {
-		fprintf(fd, ordered?"</ol>":"</ul>");
-	}
-	
-	void listItem(const QString & s) {
-		fprintf(fd, "<li>%s</li>\n", S(s));
-	}
-	
-	void beginSwitch() {
-		fprintf(fd, "<table>\n");
-	}
-
-	void cswitch(const ArgHandler * h) {
-		fprintf(fd, "<tr><td class=\"short\">");
-		if(h->shortSwitch)
-			fprintf(fd, "-%c,",h->shortSwitch);
-		fprintf(fd, "</td><td class=\"long\">--%s%s</td><td class=\"arg\">",S(h->longName),
-				(h->qthack?"<span style=\"font-weight: normal; font-size: 80%; color:red;\">*</span>":""));
-		foreach(const QString & arg, h->argn)
-			fprintf(fd, "&lt;%s&gt; ",S(arg));
-		fprintf(fd, "</td><td class=\"desc\">%s</td></tr>\n",S(h->getDesc()));
-	}
-
-	void endSwitch() {
-		fprintf(fd, "</table>\n");
-		fprintf(fd, "<p>Items marked <span style=\"font-weight: normal; font-size: 80%%; color:red;\">*</span> are only available using patched QT.</p>");
-	}
-	
-};
-
-/*!
-  Create a Html outputter
-  \param fd A file description to output to
-*/
-  Outputter * Outputter::html(FILE * fd) {
-	return new HtmlOutputter(fd);
-}

+ 6 - 5
src/image/image.pro

@@ -7,8 +7,8 @@ UI_DIR = ../../build/image
 TEMPLATE = app
 TARGET = wkhtmltoimage
 DESTDIR = ../../bin
-DEPENDPATH += . src
-INCLUDEPATH += . src
+DEPENDPATH += . ../shared
+INCLUDEPATH += . ../shared
 
 readme.target=README_WKHTMLTOIMAGE
 readme.commands=./wkhtmltoimage --readme > README_WKHTMLTOIMAGE
@@ -35,6 +35,7 @@ target.path=$$INSTALLBASE/bin
 
 # Input
 HEADERS += pageloader.hh settings.hh
-SOURCES += wkhtmltoimage.cc arguments.cc commandlineparser.cc docparts.cc      \
-           textoutputter.cc outputter.cc manoutputter.cc pageloader.cc         \
-           settings.cc utilities.cc htmloutputter.cc
+SOURCES += wkhtmltoimage.cc arguments.cc commandlineparser.cc docparts.cc \
+           pageloader.cc settings.cc utilities.cc \
+
+include(../shared/shared.pri)

+ 0 - 117
src/image/manoutputter.cc

@@ -1,117 +0,0 @@
-/*
- * File:   manoutputter.cc
- * Author: Christian Sciberras
- * Created: 20 May 2010
- *   This file is part of wkhtmltoimage.
- *   wkhtmltoimage is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, either version 3 of the License, or
- *   (at your option) any later version.
- *   wkhtmltoimage is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *   You should have received a copy of the GNU General Public License
- *   along with wkhtmltoimage.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "commandlineparser_p.hh"
-#include <QStringList>
-#define S(x) ((x).toUtf8().constData())
-
-class ManOutputter: public Outputter {
-private:
-	FILE * fd;
-	int order;
-public:
-	ManOutputter(FILE * _): fd(_) {
-		fprintf(fd,".TH wkhtmltoimage 1 \"2010 May 21\"\n\n");
-	}
-
-	void beginSection(const QString & name) {
-		fprintf(fd, ".SH %s\n", S(name));
-	}
-
-	void endSection() {
-		fprintf(fd, "\n");
-	}
-
-	void beginParagraph() {
-	}
-
-	void endParagraph() {
-		fprintf(fd, "\n\n");
-	}
-	
-	void text(const QString & t) {
-		QString str = QString(t).replace("-", "\\-");
-		fprintf(fd, "%s", S(str));
-	}
-	
-	void bold(const QString & t) {
-		fprintf(fd, "\\fB%s\\fP", S(t));
-	}
-	
-	void italic(const QString & t) {
-		fprintf(fd, "\\fB%s\\fP", S(t));
-	}
-
-	void link(const QString & t) {
-		fprintf(fd, "<%s>", S(t));
-	}
-
-	void verbatim(const QString & t) {
-		QString str = QString(t).replace("-", "\\-");
-		QStringList l = str.split('\n');
-		while ( l.back() == "") l.pop_back();
-		foreach(const QString & line, l)
-			fprintf(fd, "  %s\n", S(line));
-		fprintf(fd, "\n");
-	}
-	
-	void beginSwitch() {
-		fprintf(fd, ".PD 0\n");
-	}
-
-	void beginList(bool ordered) {
-		order=(ordered?1:-1);
-	}
-
-	void endList() {
-		fprintf(fd, "\n");
-	}
-	
-	void listItem(const QString & s) {
-		if (order < 0) fprintf(fd, " * ");
-		else fprintf(fd, "%3d ", order++);
-		fprintf(fd,"%s\n",S(s));
-	}
-	
-	void cswitch(const ArgHandler * h) {
-		fprintf(fd, ".TP\n");
-		fprintf(fd, "\\fB");
-		if(h->shortSwitch != 0)
-			fprintf(fd, "\\-%c, ", h->shortSwitch);
-		else
-			fprintf(fd, "    ");
-		fprintf(fd,"\\-\\-%s\\fR", S(h->longName));
-		
-		for(QVector<QString>::const_iterator i = h->argn.constBegin(); i != h->argn.constEnd(); ++i)
-			fprintf(fd," \\fI<%s>\\fR", S(*i));
-		
-		fprintf(fd, "\n%s\n",S(h->desc));
-	}
-	
-	void endSwitch() {
-		fprintf(fd, ".PD\n");
-		fprintf(fd, "\n");
-	}
-};
-
-/*!
-  Create a man page outputter
-  \param fd A file description to output to
-*/
-Outputter * Outputter::man(FILE * fd) {
-  return new ManOutputter(fd);
-}

+ 0 - 119
src/image/outputter.cc

@@ -1,119 +0,0 @@
-/*
- * File:   outputter.hh
- * Author: Christian Sciberras
- * Created: 20 May 2010
- *   This file is part of wkhtmltoimage.
- *   wkhtmltoimage is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, either version 3 of the License, or
- *   (at your option) any later version.
- *   wkhtmltoimage is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *   You should have received a copy of the GNU General Public License
- *   along with wkhtmltoimage.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <commandlineparser_p.hh>
-
-/*!
-  \class Outputter
-  \brief Interface for classes used to output documentation
-*/
-
-/*!
-  \fn Outputter::beginSection(const QString & name)
-  Add a new section to the output
-  \param name The name of the section
-*/
-
-/*!
-  \fn Outputter::endSection()
-  End the current section
-*/
-
-/*!
-  \fn Outputter::beginParagraph()
-  Begin a text paragraph
-*/
-
-/*!
-  \fn Outputter::text(const QString & t)
-  Add some text to the current paragraph
-  \param t The text to add
-*/
-
-/*!
-  \fn Outputter::bold(const QString & t) =  0;
-  Add some bold text to the current paragraph
-  \param t The text to add
-*/
-
-/*!
-  \fn Outputter::italic(const QString & t)
-  Add some italic text tho the current paragraph
-  \param t The text to add
-*/
-
-/*!
-  \fn Outputter::link(const QString & l)
-  Add a hyperlink to somewhere
-  \param l The url to link to
-*/
-
-/*!
-  \fn Outputter::endParagraph()
-  End the current paragraph
-*/
-
-/*!
-  \fn Outputter::verbatim(const QString & t)
-  Add a pice of code or verbatime text
-  \param t The text to add
-*/
-
-/*!
-  \fn Outputter::beginList(bool ordered=false)
-  Begin a ordered or unordered listing
-  \param ordered Should the list be ordered
-*/
-
-/*!
-  \fn Outputter::endList()
-  End the current listing
-*/
-
-/*!
-  \fn Outputter::listItem(QString & t)
-  Add an item to the current listing
-  \param t The text to add
-*/
-
-/*!
-  \fn Outputter::beginSwitch()
-  Begin a section with command line switches
-*/
-
-	
-/*!
-  \fn Outputter::cswitch(const ArgHandler * h, bool doc)
-  Output a switch description
-  \param h The switch to add
-  \param doc Are we outputting to documentation
-*/
-
-/*!
-  \fn Outputter::endSwitch()
-  End a switch section
-*/
-
-
-/*!
-  Output a paragraph of simple text
-*/
-void Outputter::paragraph(const QString & t) {
-	beginParagraph();
-	text(t);
-	endParagraph();
-}

+ 0 - 177
src/image/textoutputter.cc

@@ -1,177 +0,0 @@
-/*
- * File:   textoutputter.cc
- * Author: Christian Sciberras
- * Created: 20 May 2010
- *   This file is part of wkhtmltoimage.
- *   wkhtmltoimage is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, either version 3 of the License, or
- *   (at your option) any later version.
- *   wkhtmltoimage is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *   You should have received a copy of the GNU General Public License
- *   along with wkhtmltoimage.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "commandlineparser_p.hh"
-#include <qstringlist.h>
-
-#define S(t) (doc?(t).toUtf8().constData():(t).toLocal8Bit().constData())
-
-class TextOutputter: public Outputter {
-public:
-	FILE * fd;
-	static const int lw = 80;
-	int w;
-	bool doc;
-	bool extended;
-	bool first;
-	int order;
-	TextOutputter(FILE * _, bool d, bool e): fd(_), doc(d), extended(e) {}
-
-	void beginSection(const QString & name) {
-		if(doc) {
-			int x= 80 - name.size() - 4;
-			if(x < 6) x = 60;
-			for(int i=0; i < x/2; ++i) 
-				fprintf(fd, "=");
-			fprintf(fd, "> %s <", S(name) );
-			for(int i=0; i < (x+1)/2; ++i) 
-				fprintf(fd, "=");
-			fprintf(fd, "\n");
-		} else 
-			fprintf(fd, "%s:\n", S(name) );
-	}
-	
-	void endSection() {
-	}
-
-	void beginParagraph() {
-		first=true;
-		if(doc) {
-			w=0;
-		} else {
-			w=2;
-			fprintf(fd,"  ");
-		}
-	}
-
-	void text(const QString & t) {
-		first=true;
-		QStringList list = t.split(" ");
-		foreach(const QString & s, list) {
-			if( w + s.size() + (first?0:1) > lw) {
-				fprintf(fd, "\n");
-				if(doc) {
-					w=0;
-				} else {
-					w=2;
-					fprintf(fd,"  ");
-				}
-				first=true;
-			}
-			if(first) first=false;
-			else {
-				fprintf(fd, " ");
-				++w;
-			}
-			w += s.size();
-			fprintf(fd, "%s", S(s));
-		}
-	}
-	
-	void bold(const QString & t) {
-		text("*"+t+"*");
-	}
-	
-	void italic(const QString & t) {
-		text("_"+t+"_");
-	}
-	
-	void link(const QString & t) {
-		text("<"+t+">");
-	}
-
-	void endParagraph() {
-		fprintf(fd,"\n\n");
-	}
-
-	void verbatim(const QString & t) {
-		if(doc)
-			fprintf(fd,"%s\n", S(t));
-		else {
-			foreach(const QString & s, t.split("\n"))
-				fprintf(fd,"  %s\n",S(s));
-		}
-	}
-
-	void beginList(bool ordered) {
-		order=ordered?1:-1;
-	}
-	void endList() {
-		fprintf(fd,"\n");
-	}
-	void listItem(const QString & s) {
-		if (order < 0) fprintf(fd, " * ");
-		else fprintf(fd, "%3d ", order++);
-		fprintf(fd,"%s\n",S(s));
-	}
-	
-	void beginSwitch() {}
-
-	void cswitch(const ArgHandler * h) {
-		w=0;
-		if(!doc) {fprintf(fd,"  "); w=2;}
-		if(h->shortSwitch != 0)
-			fprintf(fd,"-%c, ",h->shortSwitch);
-		else
-			fprintf(fd,"    ");
-		fprintf(fd,"--%s",S(h->longName));
-		w+=4 + 2 + h->longName.size();
-		if (doc && h->qthack) { 
-			fprintf(fd, " *");
-			w += 2;
-		}
-				
-		foreach(const QString & arg, h->argn) {
-			fprintf(fd," <%s>",S(arg));
-			w+=3+arg.size();
-		}
-		while(w < 37) {
-			fprintf(fd," ");
-			++w;
-		}
-		foreach(const QString & s, h->getDesc().split(" ")) {
-			if(w+1+s.size() > lw) {
-				printf("\n");
-				w=0;
-				while(w < 37) {
-					fprintf(fd," ");
-					++w;
-				}
-			}
-			fprintf(fd, " %s", S(s));
-			w += s.size() + 1;
-		}
-		fprintf(fd,"\n");
-	}
-
-	void endSwitch() {
-		if (doc)
-			fprintf(fd, "\nItems marked * are only available using patched QT.\n");
-		printf("\n");
-	}		
-	
-};
-
-/*!
-  Create a raw text outputter, used for outputting --help and readme
-  \param fd A file description to output to
-  \param doc Ouput in readme format
-  \param extended Output extended options
-*/
-Outputter * Outputter::text(FILE * fd, bool doc, bool extended) {
-	return new TextOutputter(fd, doc, extended);
-}

+ 0 - 24
src/pdf/arguments.cc

@@ -66,30 +66,6 @@
   \param settings The settings to store the information in
 */
 
-/*!
-  \fn ArgHandler::useDefault(CommandLineParserPrivate & parser)
-  Set give settings its default value
-
-  This is a NOOP for ArgHandler
-  \param parser The parser giving the request
-*/
-//void ArgHandler::useDefault(CommandLineParserPrivate & parser) {
-//	Q_UNUSED(parser);
-//} 
-
-/*!
-  \fn ArgHandler::getDesc() const
-  Get the description of this switch
-*/  
-QString ArgHandler::getDesc() const {
-	return desc;
-}
-
-/*!
-  \fn ArgHandler::~ArgHandler()
-  Dummy virtual destructor
-*/  
-ArgHandler::~ArgHandler() {}
 
 /*!
   \class CommandLineParserPrivate

+ 3 - 37
src/pdf/commandlineparser_p.hh

@@ -20,50 +20,16 @@
 #include <QString>
 #include "commandlineparser.hh"
 #include "settings.hh"
+#include "outputter.hh"
+
 using namespace wkhtmltopdf::settings;
 
 class CommandLineParserPrivate;
 
-class ArgHandler {
+class ArgHandler: public ArgHandlerBase {
 public:
-	QString longName;
-	QString desc;
-	char shortSwitch;
-	QVector<QString> argn;
-	bool display;
-	bool extended;
-	bool qthack;
 	int section;
 	virtual bool operator() (const char ** args, CommandLineParserPrivate & parser, Page & page) = 0;
-	//virtual void useDefault(CommandLineParserPrivate & parser, Settings::PageSettings & page);
-	virtual QString getDesc() const;
-	virtual ~ArgHandler();
-};
- 
-
-class Outputter {
-public:
-	virtual ~Outputter() {}
-	virtual void beginSection(const QString & name) = 0;
-	virtual void endSection() = 0;
-	virtual void beginParagraph() = 0;
-	virtual void text(const QString & t) = 0;
-	virtual void bold(const QString & t) =  0;
-	virtual void italic(const QString & t) = 0;
-	virtual void link(const QString & l) = 0;
-	virtual void sectionLink(const QString & s) = 0;
-	virtual void endParagraph() = 0;
-	virtual void verbatim(const QString & t) = 0;
- 	virtual void beginList(bool ordered=false) = 0;
- 	virtual void endList() = 0;
- 	virtual void listItem(const QString & t) = 0;
-	virtual void beginSwitch() = 0;
-	virtual void cswitch(const ArgHandler * h) = 0;
-	virtual void endSwitch() = 0;
-	void paragraph(const QString & t);
-	static Outputter * text(FILE * fd, bool doc=false, bool extended=false);
-	static Outputter * man(FILE * fd);
-	static Outputter * html(FILE * fd);
 };
 
 class CommandLineParserPrivate {

+ 4 - 4
src/pdf/pdf.pro

@@ -3,8 +3,8 @@ include(../../common.pri)
 TEMPLATE = app
 DESTDIR = ../../bin
 TARGET = wkhtmltopdf
-DEPENDPATH += . src
-INCLUDEPATH += . src
+DEPENDPATH += . ../shared
+INCLUDEPATH += . ../shared
 
 readme.target=README
 readme.commands=./wkhtmltopdf --readme > README
@@ -41,6 +41,6 @@ SOURCES += tempfile.cc settings.cc pageconverter.cc \
 HEADERS += progressfeedback.hh
 
 SOURCES += wkhtmltopdf.cc arguments.cc commandlineparser.cc \
-           docparts.cc outputter.cc manoutputter.cc \
-           htmloutputter.cc textoutputter.cc progressfeedback.cc
+           docparts.cc  progressfeedback.cc
            
+include(../shared/shared.pri)

+ 2 - 2
src/pdf/htmloutputter.cc → src/shared/htmloutputter.cc

@@ -13,7 +13,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-#include "commandlineparser_p.hh"
+#include "outputter.hh"
 #include <QTextDocument>
 
 #define S(x) Qt::escape(x).toUtf8().constData()
@@ -100,7 +100,7 @@ public:
 		fprintf(fd, "<table>\n");
 	}
 
-	void cswitch(const ArgHandler * h) {
+	void cswitch(const ArgHandlerBase * h) {
 		fprintf(fd, "<tr><td class=\"short\">");
 		if(h->shortSwitch)
 			fprintf(fd, "-%c,",h->shortSwitch);

+ 2 - 2
src/pdf/manoutputter.cc → src/shared/manoutputter.cc

@@ -13,7 +13,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-#include "commandlineparser_p.hh"
+#include "outputter.hh"
 #include <QStringList>
 #define S(x) ((x).toUtf8().constData())
 
@@ -89,7 +89,7 @@ public:
 		fprintf(fd,"%s\n",S(s));
 	}
 	
-	void cswitch(const ArgHandler * h) {
+	void cswitch(const ArgHandlerBase * h) {
 		fprintf(fd, ".TP\n");
 		fprintf(fd, "\\fB");
 		if(h->shortSwitch != 0)

+ 1 - 1
src/pdf/outputter.cc → src/shared/outputter.cc

@@ -13,7 +13,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-#include <commandlineparser_p.hh>
+#include "outputter.hh"
 
 /*!
   \class Outputter

+ 2 - 2
src/pdf/textoutputter.cc → src/shared/textoutputter.cc

@@ -13,7 +13,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-#include "commandlineparser_p.hh"
+#include "outputter.hh"
 #include <qstringlist.h>
 
 #define S(t) (doc?(t).toUtf8().constData():(t).toLocal8Bit().constData())
@@ -123,7 +123,7 @@ public:
 	
 	void beginSwitch() {}
 
-	void cswitch(const ArgHandler * h) {
+	void cswitch(const ArgHandlerBase * h) {
 		w=0;
 		if(!doc) {fprintf(fd,"  "); w=2;}
 		if(h->shortSwitch != 0)

+ 0 - 1
wkhtmltopdf.pro

@@ -13,7 +13,6 @@
 # You should have received a copy of the GNU General Public License
 # along with wkhtmltopdf.  If not, see <http:#www.gnu.org/licenses/>.
 
-# src/shared /src/image
 TEMPLATE = subdirs
 
 CONFIG += ordered