Browse Source

use the headers in src/lib as the single copy used everywhere

There's no need to keep duplicate copies in include/wkhtmltox,
as there would be no users of this unstable API. The stable API
headers are now automatically included during "make install".

Remove scripts/sync-headers.sh as it is now redundant.
Ashish Kulkarni 7 years ago
parent
commit
3ca39ce4c4

+ 2 - 2
common.pri

@@ -20,7 +20,7 @@ CONFIG(static, shared|static):lessThan(QT_MAJOR_VERSION, 5) {
     QTPLUGIN += qcncodecs qjpcodecs qkrcodecs qtwcodecs
 }
 
-INCLUDEPATH += ../../include
+INCLUDEPATH += ../../src/lib
 RESOURCES    = $$PWD/wkhtmltopdf.qrc
 
 win32:      CONFIG += console
@@ -40,4 +40,4 @@ VERSION_LIST=$$split(VERSION_TEXT, "-")
 count(VERSION_LIST, 1): VERSION=$$VERSION_TEXT
 else:                   VERSION=$$member(VERSION_LIST, 0)
 
-DEFINES += VERSION=$$VERSION FULL_VERSION=$$VERSION_TEXT
+DEFINES += VERSION=$$VERSION FULL_VERSION=$$VERSION_TEXT BUILDING_WKHTMLTOX

+ 0 - 62
include/wkhtmltox/converter.hh

@@ -1,62 +0,0 @@
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __CONVERTER_HH__
-#define __CONVERTER_HH__
-
-#include <QObject>
-#include <wkhtmltox/loadsettings.hh>
-#include <wkhtmltox/dllbegin.inc>
-
-namespace wkhtmltopdf {
-
-class DLL_LOCAL ConverterPrivate;
-
-class DLL_PUBLIC Converter: public QObject {
-    Q_OBJECT
-public:
-	virtual ~Converter() {};
-
-    int currentPhase();
-    int phaseCount();
-    QString phaseDescription(int phase=-1);
-    QString progressString();
-    int httpErrorCode();
-signals:
-    void warning(const QString & message);
-    void error(const QString & message);
-    void phaseChanged();
-    void progressChanged(int progress);
-    void finished(bool ok);
-
-	void checkboxSvgChanged(const QString & path);
-	void checkboxCheckedSvgChanged(const QString & path);
-	void radiobuttonSvgChanged(const QString & path);
-	void radiobuttonCheckedSvgChanged(const QString & path);
-public slots:
-    void beginConversion();
-	bool convert();
-	void cancel();
-protected:
-	void emitCheckboxSvgs(const settings::LoadPage & ls);
-	virtual ConverterPrivate & priv() = 0;
-	friend class ConverterPrivate;
-};
-
-}
-#include <wkhtmltox/dllend.inc>
-#endif //__CONVERTER_HH__

+ 0 - 52
include/wkhtmltox/dllbegin.inc

@@ -1,52 +0,0 @@
-/*
- * Copyright 2010 wkhtmltopdf authors
- *
- * This file is part of wkhtmltopdf.
- *
- * wkhtmltopdf is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * wkhtmltopdf 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 Lesser General Public License
- * along with wkhtmltopdf.  If not, see <http: *www.gnu.org/licenses/>.
- */
-
-#ifndef __WKHTMLTOPDF_DLLBEGIN__
-#define __WKHTMLTOPDF_DLLBEGIN__
-
-#if defined _WIN32 || defined __CYGWIN__
-  #ifdef BUILDING_DLL
-     #define DLL_PUBLIC __declspec(dllexport)
-  #else
-     #define DLL_PUBLIC __declspec(dllimport)
-  #endif
-  #define DLL_LOCAL
-#else
-  #if __GNUC__ >= 4
-    #define DLL_PUBLIC __attribute__ ((visibility("default")))
-    #define DLL_LOCAL  __attribute__ ((visibility("hidden")))
-  #else
-    #define DLL_PUBLIC
-    #define DLL_LOCAL
-  #endif
-#endif
-
-#if defined _WIN32
-#define CALLTYPE __stdcall
-#else
-#define CALLTYPE
-#endif
-
-#ifdef __cplusplus
-  #define CAPI(type) extern "C" DLL_PUBLIC type CALLTYPE
-#else
-  #define CAPI(type) DLL_PUBLIC type CALLTYPE
-#endif
-
-#endif /*__WKHTMLTOPDF_DLLBEGIN__*/

+ 0 - 28
include/wkhtmltox/dllend.inc

@@ -1,28 +0,0 @@
-/*
- * Copyright 2010 wkhtmltopdf authors
- *
- * This file is part of wkhtmltopdf.
- *
- * wkhtmltopdf is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * wkhtmltopdf 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 Lesser General Public License
- * along with wkhtmltopdf.  If not, see <http: *www.gnu.org/licenses/>.
- */
-
-#ifdef __WKHTMLTOPDF_DLLBEGIN__
-
-#undef __WKHTMLTOPDF_DLLBEGIN__
-#undef DLL_PUBLIC
-#undef DLL_LOCAL
-#undef CAPI
-#undef CALLTYPE
-
-#endif /*__WKHTMLTOPDF_DLLBEGIN__*/

+ 0 - 64
include/wkhtmltox/image.h

@@ -1,64 +0,0 @@
-/*
- * Copyright 2010 wkhtmltopdf authors
- *
- * This file is part of wkhtmltopdf.
- *
- * wkhtmltopdf is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * wkhtmltopdf 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 Lesser General Public License
- * along with wkhtmltopdf.  If not, see <http: *www.gnu.org/licenses/>.
- */
-
-#ifndef __IMAGE_H__
-#define __IMAGE_H__
-#include <wkhtmltox/dllbegin.inc>
-
-struct wkhtmltoimage_global_settings;
-typedef struct wkhtmltoimage_global_settings wkhtmltoimage_global_settings;
-
-struct wkhtmltoimage_converter;
-typedef struct wkhtmltoimage_converter wkhtmltoimage_converter;
-
-typedef void (*wkhtmltoimage_str_callback)(wkhtmltoimage_converter * converter, const char * str);
-typedef void (*wkhtmltoimage_int_callback)(wkhtmltoimage_converter * converter, const int val);
-typedef void (*wkhtmltoimage_void_callback)(wkhtmltoimage_converter * converter);
-
-CAPI(int) wkhtmltoimage_init(int use_graphics);
-CAPI(int) wkhtmltoimage_deinit();
-CAPI(int) wkhtmltoimage_extended_qt();
-CAPI(const char *)wkhtmltoimage_version();
-
-CAPI(wkhtmltoimage_global_settings *) wkhtmltoimage_create_global_settings();
-
-CAPI(int) wkhtmltoimage_set_global_setting(wkhtmltoimage_global_settings * settings, const char * name, const char * value);
-CAPI(int) wkhtmltoimage_get_global_setting(wkhtmltoimage_global_settings * settings, const char * name, char * value, int vs);
-
-CAPI(wkhtmltoimage_converter *) wkhtmltoimage_create_converter(wkhtmltoimage_global_settings * settings, const char * data);
-CAPI(void) wkhtmltoimage_destroy_converter(wkhtmltoimage_converter * converter);
-
-CAPI(void) wkhtmltoimage_set_warning_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_str_callback cb);
-CAPI(void) wkhtmltoimage_set_error_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_str_callback cb);
-CAPI(void) wkhtmltoimage_set_phase_changed_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_void_callback cb);
-CAPI(void) wkhtmltoimage_set_progress_changed_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_int_callback cb);
-CAPI(void) wkhtmltoimage_set_finished_callback(wkhtmltoimage_converter * converter, wkhtmltoimage_int_callback cb);
-CAPI(int) wkhtmltoimage_convert(wkhtmltoimage_converter * converter);
-/* CAPI(void) wkhtmltoimage_begin_conversion(wkhtmltoimage_converter * converter); */
-/* CAPI(void) wkhtmltoimage_cancel(wkhtmltoimage_converter * converter); */
-
-CAPI(int) wkhtmltoimage_current_phase(wkhtmltoimage_converter * converter);
-CAPI(int) wkhtmltoimage_phase_count(wkhtmltoimage_converter * converter);
-CAPI(const char *) wkhtmltoimage_phase_description(wkhtmltoimage_converter * converter, int phase);
-CAPI(const char *) wkhtmltoimage_progress_string(wkhtmltoimage_converter * converter);
-CAPI(int) wkhtmltoimage_http_error_code(wkhtmltoimage_converter * converter);
-CAPI(long) wkhtmltoimage_get_output(wkhtmltoimage_converter * converter, const unsigned char **);
-
-#include <wkhtmltox/dllend.inc>
-#endif /*__IMAGE_H__*/

+ 0 - 43
include/wkhtmltox/imageconverter.hh

@@ -1,43 +0,0 @@
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __IMAGECONVERTER_HH__
-#define __IMAGECONVERTER_HH__
-
-#include <wkhtmltox/converter.hh>
-#include <wkhtmltox/imagesettings.hh>
-
-#include <wkhtmltox/dllbegin.inc>
-namespace wkhtmltopdf {
-
-class DLL_LOCAL ImageConverterPrivate;
-
-class DLL_PUBLIC ImageConverter: public Converter {
-	Q_OBJECT
-public:
-	ImageConverter(settings::ImageGlobal & settings, const QString * data=NULL);
-	~ImageConverter();
-	const QByteArray & output();
-private:
-	ImageConverterPrivate * d;
-	virtual ConverterPrivate & priv();
-	friend class ImageConverterPrivate;
-};
-
-#include <wkhtmltox/dllend.inc>
-}
-#endif //__IMAGECONVERTER_HH__

+ 0 - 96
include/wkhtmltox/imagesettings.hh

@@ -1,96 +0,0 @@
-// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
-// vi:set ts=4 sts=4 sw=4 noet :
-//
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __IMAGESETTINGS_HH__
-#define __IMAGESETTINGS_HH__
-
-#include <QString>
-#include <wkhtmltox/logging.hh>
-#include <wkhtmltox/loadsettings.hh>
-#include <wkhtmltox/websettings.hh>
-
-#include <wkhtmltox/dllbegin.inc>
-namespace wkhtmltopdf {
-namespace settings {
-
-/*! \brief Settings for cropping image */
-struct DLL_PUBLIC CropSettings {
-	CropSettings();
-	//! Cropping left/x coord
-	int left;
-	//! Cropping top/y coord
-	int top;
-	//! Cropping width/w dime
-	int width;
-	//! Cropping height/h dime
-	int height;
-};
-
-/*! \brief Class holding all user settings.
-
-    This class holds all the user settings, settings can be filled in by hand,
-    or with other methods.
-    \sa CommandLineParser::parse()
-*/
-struct DLL_PUBLIC ImageGlobal {
-	ImageGlobal();
-
-	//! Crop related settings
-	CropSettings crop;
-	//! Scale related settings
-	// ScaleSettings scale;
-
-	LoadGlobal loadGlobal;
-	LoadPage loadPage;
-	Web web;
-
-	//! Log level
-	LogLevel logLevel;
-
-	bool transparent;
-
-	//! Should we use the graphics system
-	bool useGraphics;
-
-	QString in;
-	//! The file for output
-	QString out;
-	//! The output format
-	QString fmt;
-
-	//! Set the screen width
-	int screenWidth;
-
-	//! Set the screen height
-	int screenHeight;
-
-	//! Image Quality
-	int quality;
-
-	bool smartWidth;
-
-	QString get(const char * name);
-	bool set(const char * name, const QString & value);
-};
-
-#include <wkhtmltox/dllend.inc>
-}
-}
-#endif //__IMAGESETTINGS_HH__

+ 0 - 146
include/wkhtmltox/loadsettings.hh

@@ -1,146 +0,0 @@
-// Copyright 2010, 2012 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __LOADSETTINGS_HH__
-#define __LOADSETTINGS_HH__
-
-#include <QNetworkProxy>
-#include <QString>
-
-#include <wkhtmltox/dllbegin.inc>
-namespace wkhtmltopdf {
-namespace settings {
-
-/*! \brief Settings considering proxy */
-struct DLL_PUBLIC Proxy {
-	Proxy();
-	//! Type of proxy to use
-	QNetworkProxy::ProxyType type;
-	//! The port of the proxy to use
-	int port;
-	//! The host name of the proxy to use or NULL
-	QString host;
-	//! Username for the said proxy or NULL
-	QString user;
-	//! Password for the said proxy or NULL
-	QString password;
-};
-
-struct DLL_PUBLIC PostItem {
-	QString name;
-	QString value;
-	bool file;
-};
-
-struct DLL_PUBLIC LoadGlobal {
-	LoadGlobal();
-	//! Path of the cookie jar file
-	QString cookieJar;
-};
-
-struct DLL_PUBLIC LoadPage {
-	LoadPage();
-
-	enum LoadErrorHandling {
-		abort,
-		skip,
-		ignore
-	};
-
-	//! Username used for http auth login
-	QString username;
-
-	//! Password used for http auth login
-	QString password;
-
-	//! Path to the ssl client cert private key in OpenSSL PEM format
-	QString clientSslKeyPath;
-
-	//! Password to ssl client cert private key
-	QString clientSslKeyPassword;
-
-	//! Path to the ssl client cert public key in OpenSSL PEM format, optionally followed by intermediate ca and trusted certs
-	QString clientSslCrtPath;
-
-	//! How many milliseconds should we wait for a Javascript redirect
-	int jsdelay;
-
-	//! What window.status value should we wait for
-	QString windowStatus;
-
-	//! What zoom factor should we apply when printing
-	// TODO MOVE
-	float zoomFactor;
-
-	//! Map of custom header variables
-	QList< QPair<QString, QString> > customHeaders;
-
-	//! Set if the custom header should be repeated for each resource request
-	bool repeatCustomHeaders;
-
-	//! Map of cookies
-	QList< QPair<QString, QString> > cookies;
-
-	QList< PostItem > post;
-
-	//! Block access to local files for the given page
-	bool blockLocalFileAccess;
-
-	//! If access to local files is not allowed in general, allow it for these files
-	QList< QString > allowed;
-
-	//! Stop Javascript from running too long
-	bool stopSlowScripts;
-
-	//! Output Javascript debug messages
-	bool debugJavascript;
-
-	//! What should we do about load errors
-	LoadErrorHandling loadErrorHandling;
-	LoadErrorHandling mediaLoadErrorHandling;
-
-	//! Proxy related settings
-	Proxy proxy;
-
-	//! Additional javascript to run on a page once it has loaded
-	QList< QString > runScript;
-
-	QString checkboxSvg;
-	QString checkboxCheckedSvg;
-	QString radiobuttonSvg;
-	QString radiobuttonCheckedSvg;
-
-	QString cacheDir;
-	static QList<QString> mediaFilesExtensions;
-
-	// Hosts to bypass
-	QList< QString > bypassProxyForHosts;
-
-	//! Whether to use the proxy for resolving hostnames
-	bool proxyHostNameLookup;
-};
-
-DLL_PUBLIC LoadPage::LoadErrorHandling strToLoadErrorHandling(const char * s, bool * ok=0);
-DLL_PUBLIC QString loadErrorHandlingToStr(LoadPage::LoadErrorHandling leh);
-
-DLL_PUBLIC Proxy strToProxy(const char * s, bool * ok=0);
-DLL_PUBLIC QString proxyToStr(const Proxy & proxy);
-
-}
-}
-#include <wkhtmltox/dllend.inc>
-#endif //__LOADSETTINGS_HH__

+ 0 - 43
include/wkhtmltox/logging.hh

@@ -1,43 +0,0 @@
-// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
-// vi:set ts=4 sts=4 sw=4 noet :
-//
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __LOGGING_HH__
-#define __LOGGING_HH__
-
-#include <QMap>
-#include <QString>
-#include <wkhtmltox/dllbegin.inc>
-namespace wkhtmltopdf {
-namespace settings {
-
-enum LogLevel {
-	None,
-	Error,
-	Warn,
-	Info
-};
-
-DLL_PUBLIC LogLevel strToLogLevel(const char * s, bool * ok=0);
-DLL_PUBLIC QString logLevelToStr(const LogLevel & l, bool * ok=0);
-
-}
-}
-#include <wkhtmltox/dllend.inc>
-#endif //__LOGGING_HH__

+ 0 - 74
include/wkhtmltox/multipageloader.hh

@@ -1,74 +0,0 @@
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __MULTIPAGELOADER_HH__
-#define __MULTIPAGELOADER_HH__
-
-#include <QFile>
-#include <QObject>
-#include <QUrl>
-#if QT_VERSION >= 0x050000
-#include <QtWebKitWidgets>
-#else
-#include <QWebPage>
-#endif
-#include <wkhtmltox/loadsettings.hh>
-
-#include <wkhtmltox/dllbegin.inc>
-namespace wkhtmltopdf {
-
-class DLL_LOCAL MyQWebPage;
-
-class DLL_LOCAL LoaderObject {
-public:
-	QWebPage & page;
-	bool skip;
-
-	LoaderObject(QWebPage & page);
-};
-
-class DLL_LOCAL MultiPageLoaderPrivate;
-class DLL_LOCAL MultiPageLoader: public QObject {
-	Q_OBJECT
-public:
-	MultiPageLoader(settings::LoadGlobal & s, int dpi, bool mainLoader = false);
-	~MultiPageLoader();
-	LoaderObject * addResource(const QString & url, const settings::LoadPage & settings, const QString * data=NULL);
-	LoaderObject * addResource(const QUrl & url, const settings::LoadPage & settings);
-	static QUrl guessUrlFromString(const QString &string);
-	int httpErrorCode();
-	static bool copyFile(QFile & src, QFile & dst);
-public slots:
-	void load();
-	void clearResources();
-	void cancel();
-signals:
-	void loadFinished(bool ok);
-	void loadProgress(int progress);
-	void loadStarted();
-	void warning(QString text);
-	void error(QString text);
-private:
-	MultiPageLoaderPrivate * d;
-	friend class MultiPageLoaderPrivate;
-	friend class MyQWebPage;
-	friend class ResourceObject;
-};
-
-}
-#include <wkhtmltox/dllend.inc>
-#endif //__MULTIPAGELOADER_HH__

+ 0 - 76
include/wkhtmltox/pdf.h

@@ -1,76 +0,0 @@
-/*
- * Copyright 2010 wkhtmltopdf authors
- *
- * This file is part of wkhtmltopdf.
- *
- * wkhtmltopdf is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * wkhtmltopdf 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 Lesser General Public License
- * along with wkhtmltopdf.  If not, see <http: *www.gnu.org/licenses/>.
- */
-
-#ifndef __PDF_H__
-#define __PDF_H__
-#include <wkhtmltox/dllbegin.inc>
-
-struct wkhtmltopdf_global_settings;
-typedef struct wkhtmltopdf_global_settings wkhtmltopdf_global_settings;
-
-struct wkhtmltopdf_object_settings;
-typedef struct wkhtmltopdf_object_settings wkhtmltopdf_object_settings;
-
-struct wkhtmltopdf_converter;
-typedef struct wkhtmltopdf_converter wkhtmltopdf_converter;
-
-typedef void (*wkhtmltopdf_str_callback)(wkhtmltopdf_converter * converter, const char * str);
-typedef void (*wkhtmltopdf_int_callback)(wkhtmltopdf_converter * converter, const int val);
-typedef void (*wkhtmltopdf_void_callback)(wkhtmltopdf_converter * converter);
-
-CAPI(int) wkhtmltopdf_init(int use_graphics);
-CAPI(int) wkhtmltopdf_deinit();
-CAPI(int) wkhtmltopdf_extended_qt();
-CAPI(const char *) wkhtmltopdf_version();
-
-CAPI(wkhtmltopdf_global_settings *) wkhtmltopdf_create_global_settings();
-CAPI(void) wkhtmltopdf_destroy_global_settings(wkhtmltopdf_global_settings *);
-
-CAPI(wkhtmltopdf_object_settings *) wkhtmltopdf_create_object_settings();
-CAPI(void) wkhtmltopdf_destroy_object_settings(wkhtmltopdf_object_settings *);
-
-CAPI(int) wkhtmltopdf_set_global_setting(wkhtmltopdf_global_settings * settings, const char * name, const char * value);
-CAPI(int) wkhtmltopdf_get_global_setting(wkhtmltopdf_global_settings * settings, const char * name, char * value, int vs);
-CAPI(int) wkhtmltopdf_set_object_setting(wkhtmltopdf_object_settings * settings, const char * name, const char * value);
-CAPI(int) wkhtmltopdf_get_object_setting(wkhtmltopdf_object_settings * settings, const char * name, char * value, int vs);
-
-
-CAPI(wkhtmltopdf_converter *) wkhtmltopdf_create_converter(wkhtmltopdf_global_settings * settings);
-CAPI(void) wkhtmltopdf_destroy_converter(wkhtmltopdf_converter * converter);
-
-CAPI(void) wkhtmltopdf_set_warning_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_str_callback cb);
-CAPI(void) wkhtmltopdf_set_error_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_str_callback cb);
-CAPI(void) wkhtmltopdf_set_phase_changed_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_void_callback cb);
-CAPI(void) wkhtmltopdf_set_progress_changed_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_int_callback cb);
-CAPI(void) wkhtmltopdf_set_finished_callback(wkhtmltopdf_converter * converter, wkhtmltopdf_int_callback cb);
-/* CAPI(void) wkhtmltopdf_begin_conversion(wkhtmltopdf_converter * converter); */
-/* CAPI(void) wkhtmltopdf_cancel(wkhtmltopdf_converter * converter); */
-CAPI(int) wkhtmltopdf_convert(wkhtmltopdf_converter * converter);
-CAPI(void) wkhtmltopdf_add_object(
-	wkhtmltopdf_converter * converter, wkhtmltopdf_object_settings * setting, const char * data);
-
-CAPI(int) wkhtmltopdf_current_phase(wkhtmltopdf_converter * converter);
-CAPI(int) wkhtmltopdf_phase_count(wkhtmltopdf_converter * converter);
-CAPI(const char *) wkhtmltopdf_phase_description(wkhtmltopdf_converter * converter, int phase);
-CAPI(const char *) wkhtmltopdf_progress_string(wkhtmltopdf_converter * converter);
-CAPI(int) wkhtmltopdf_http_error_code(wkhtmltopdf_converter * converter);
-CAPI(long) wkhtmltopdf_get_output(wkhtmltopdf_converter * converter, const unsigned char **);
-
-#include <wkhtmltox/dllend.inc>
-#endif /*__PDF_H__*/

+ 0 - 49
include/wkhtmltox/pdfconverter.hh

@@ -1,49 +0,0 @@
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __PDFCONVERTER_HH__
-#define __PDFCONVERTER_HH__
-
-#include <wkhtmltox/converter.hh>
-#include <wkhtmltox/pdfsettings.hh>
-
-#include <wkhtmltox/dllbegin.inc>
-namespace wkhtmltopdf {
-
-class DLL_LOCAL PdfConverterPrivate;
-
-class DLL_PUBLIC PdfConverter: public Converter {
-	Q_OBJECT
-public:
-	PdfConverter(settings::PdfGlobal & globalSettings);
-	~PdfConverter();
-	int pageCount();
-	void addResource(const settings::PdfObject & pageSettings, const QString * data=0);
-	const settings::PdfGlobal & globalSettings() const;
-	const QByteArray & output();
-    static const qreal millimeterToPointMultiplier;
-private:
-	PdfConverterPrivate * d;
-	virtual ConverterPrivate & priv();
-	friend class PdfConverterPrivate;
-signals:
-	void producingForms(bool);
-};
-
-}
-#include <wkhtmltox/dllend.inc>
-#endif //__PDFCONVERTER_HH__

+ 0 - 231
include/wkhtmltox/pdfsettings.hh

@@ -1,231 +0,0 @@
-// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
-// vi:set ts=4 sts=4 sw=4 noet :
-//
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __PDFSETTINGS_HH__
-#define __PDFSETTINGS_HH__
-
-#include <QNetworkProxy>
-#include <QPrinter>
-#include <QString>
-#include <wkhtmltox/logging.hh>
-#include <wkhtmltox/loadsettings.hh>
-#include <wkhtmltox/websettings.hh>
-
-#include <wkhtmltox/dllbegin.inc>
-namespace wkhtmltopdf {
-namespace settings {
-
-typedef QPair<qreal, QPrinter::Unit> UnitReal;
-
-/*! \brief Settings considering margins */
-struct DLL_PUBLIC Margin {
-	Margin();
-	//!Margin applied to the top of the page
-	UnitReal top;
-	//!Margin applied to the right of the page
-	UnitReal right;
-	//!Margin applied to the bottom of the page
-	UnitReal bottom;
-	//!Margin applied to the leftp of the page
-	UnitReal left;
-};
-
-/*! \brief Settings considering page size */
-struct DLL_PUBLIC Size {
-	Size();
-	//! What size paper should we use
-	QPrinter::PageSize pageSize;
-	//!Height of the page
-	UnitReal height;
-	//!Width of the page
-	UnitReal width;
-};
-
-/*! \brief Settings considering the table of content */
-struct DLL_PUBLIC TableOfContent {
-	TableOfContent();
-	//! Should we print dots between the name and the page number?
-	bool useDottedLines;
-	//! Name af the TOC
-	QString captionText;
-	//! Link from TOC to section headers
-	bool forwardLinks;
-	//! Link from section headers to TOC
-	bool backLinks;
-	//! How fare should we indent on every level
-	QString indentation;
-	//! Factor we should scale the font with on every level
-	float fontScale;
-};
-
-/*! \brief Class holding all user setting.
-    This class holds all the user settings, settings can be filled in by hand,
-    or with other methods.
-    \sa CommandLineParser::parse()
-*/
-struct DLL_PUBLIC PdfGlobal {
-	PdfGlobal();
-
-	//! Size related settings
-	Size size;
-
-	//! Log level
-	LogLevel logLevel;
-
-	//! Should we use the graphics system
-	bool useGraphics;
-
-	//! Should relative links be resolved or kept as-is
-	bool resolveRelativeLinks;
-
-	//! Should we orientate in landscape or portrate
-	QPrinter::Orientation orientation;
-
-	//! Color or grayscale
-	QPrinter::ColorMode colorMode;
-
-	//! What overall resolution should we use
-	QPrinter::PrinterMode resolution;
-
-	//! What dpi should be used when printing
-	int dpi;
-
-	//! When pagenumbers are printed, apply this offset to them all
-	int pageOffset;
-
-	//! How many copies do we wan to print
-	int copies;
-
-	//! Should be print a whole copy before beginning the next
-	bool collate;
-
-	//! Should we generate an outline and put it into the pdf file
-	bool outline;
-
-	//! Maximal depth of the generated outline
-	int outlineDepth;
-
-	//! dump outline to this filename
-	QString dumpOutline;
-
-	//! The file where in to store the output
-	QString out;
-
-	QString documentTitle;
-
-	bool useCompression;
-
-	//! Margin related settings
-	Margin margin;
-
-	QString viewportSize;
-
-	int imageDPI;
-	int imageQuality;
-
-	LoadGlobal load;
-
-	QString get(const char * name);
-	bool set(const char * name, const QString & value);
-};
-
-/*! \brief Settings considering headers and footers */
-struct DLL_PUBLIC HeaderFooter {
-	HeaderFooter();
-	//! Size of the font used to render the text
-	int fontSize;
-	//! Name of font used to render text
-	QString fontName;
-	//! Text to render at the left
-	QString left;
-	//! Text to render at the right
-	QString right;
-	//! Text to render at the center
-	QString center;
-	//! Should a line separate the header/footer and the document
-	bool line;
-	//! Url of the document the html document that should be used as a header/footer
-	QString htmlUrl;
-	//! Spacing
-	float spacing;
-};
-
-struct DLL_PUBLIC PdfObject {
-	PdfObject();
-	//! Settings regarding the TOC
-	TableOfContent toc;
-
-	QString page;
-
-	//! Header related settings
-	HeaderFooter header;
-
-	//! Header related settings
-	HeaderFooter footer;
-
-	//! Should external links be links in the PDF
-	bool useExternalLinks;
-
-	//! Should internal links be links in the PDF
-	bool useLocalLinks;
-
-	//! Replacements
-	QList< QPair<QString, QString> > replacements;
-
-	//! Convert forms on the pages into PDF forms
-	bool produceForms;
-
-	LoadPage load;
-
-	Web web;
-
-	bool includeInOutline;
-
-	bool pagesCount;
-
-	bool isTableOfContent;
-
-	QString tocXsl;
-
-	QString get(const char * name);
-	bool set(const char * name, const QString & value);
-};
-
-DLL_PUBLIC QPrinter::PageSize strToPageSize(const char * s, bool * ok=0);
-DLL_PUBLIC QString pageSizeToStr(QPrinter::PageSize ps);
-
-DLL_PUBLIC UnitReal strToUnitReal(const char * s, bool * ok=0);
-DLL_PUBLIC QString unitRealToStr(const UnitReal & ur, bool * ok);
-
-DLL_PUBLIC QPrinter::Orientation strToOrientation(const char * s, bool * ok=0);
-DLL_PUBLIC QString orientationToStr(QPrinter::Orientation o);
-
-DLL_PUBLIC QPrinter::PrinterMode strToPrinterMode(const char * s, bool * ok=0);
-DLL_PUBLIC QString printerModeToStr(QPrinter::PrinterMode o);
-
-DLL_PUBLIC QPrinter::ColorMode strToColorMode(const char * s, bool * ok=0);
-DLL_PUBLIC QString colorModeToStr(QPrinter::ColorMode o);
-
-}
-
-DLL_PUBLIC void dumpDefaultTOCStyleSheet(QTextStream & stream, settings::TableOfContent & s);
-}
-#include <wkhtmltox/dllend.inc>
-#endif //__PDFSETTINGS_HH__

+ 0 - 57
include/wkhtmltox/utilities.hh

@@ -1,57 +0,0 @@
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __UTILITIES_HH__
-#define __UTILITIES_HH__
-
-#include <QProxyStyle>
-#include <QFile>
-#include <QFileInfo>
-#include <QImageWriter>
-#include <QPainter>
-#include <QStyleOption>
-#include <QSvgRenderer>
-#include <QUrl>
-
-#include <wkhtmltox/dllbegin.inc>
-/**
- * Custom simplistic style
- */
-class DLL_PUBLIC MyLooksStyle: public QProxyStyle {
-	Q_OBJECT
-public:
-	typedef QProxyStyle parent_t;
-	MyLooksStyle();
-	void drawPrimitive( PrimitiveElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget = 0 ) const;
-	bool weAreDrawingForms;
-
-	static QSvgRenderer * checkbox;
-	static QSvgRenderer * checkbox_checked;
-	static QSvgRenderer * radiobutton;
-	static QSvgRenderer * radiobutton_checked;
-public slots:
-	void producingForms(bool f);
-	void setCheckboxSvg(const QString & path);
-	void setCheckboxCheckedSvg(const QString & path);
-	void setRadioButtonSvg(const QString & path);
-	void setRadioButtonCheckedSvg(const QString & path);
-};
-
-DLL_PUBLIC int handleError(bool success, int errorCode);
-
-#include <wkhtmltox/dllend.inc>
-#endif //__UTILITIES_HH__

+ 0 - 62
include/wkhtmltox/websettings.hh

@@ -1,62 +0,0 @@
-// Copyright 2010 wkhtmltopdf authors
-//
-// This file is part of wkhtmltopdf.
-//
-// wkhtmltopdf is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// wkhtmltopdf 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 Lesser General Public License
-// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef __WEBSETTINGS_HH__
-#define __WEBSETTINGS_HH__
-
-#include <QNetworkProxy>
-#include <QString>
-
-#include <wkhtmltox/dllbegin.inc>
-namespace wkhtmltopdf {
-namespace settings {
-
-struct DLL_PUBLIC Web {
-	Web();
-
-	//! Should we print background images
-	bool background;
-
-	//! Should we load images
-	bool loadImages;
-
-	//! Should we enable Javascript
-	bool enableJavascript;
-
-	//! Should the horrible intelligent shrinking feature be enabled?
-	bool enableIntelligentShrinking;
-
-	//! Minimum font size
-	int minimumFontSize;
-
-	//! Should we use the print or the screen media type
-	bool printMediaType;
-
-	//! Encoding used to enterpit a document with do supplied encoding
-	QString defaultEncoding;
-
-	//! Stylesheet supplied by the user
-	QString userStyleSheet;
-
-	//! Should plugins be allowed
-	bool enablePlugins;
-};
-
-}
-}
-#include <wkhtmltox/dllend.inc>
-#endif //__WEBSETTINGS_HH__

+ 1 - 4
scripts/build.py

@@ -950,10 +950,7 @@ def build_posix_local(config, basedir):
     os.environ['WKHTMLTOX_VERSION'] = version
     shell('../qt/bin/qmake ../../../wkhtmltopdf.pro')
     shell('%s -j%d' % (make, CPU_COUNT))
-    shell('cp bin/wkhtmlto* ../wkhtmltox-%s/bin' % version)
-    shell('cp -P bin/libwkhtmltox*.so.* ../wkhtmltox-%s/lib' % version)
-    shell('cp ../../../include/wkhtmltox/*.h ../wkhtmltox-%s/include/wkhtmltox' % version)
-    shell('cp ../../../include/wkhtmltox/dll*.inc ../wkhtmltox-%s/include/wkhtmltox' % version)
+    shell('%s install INSTALL_ROOT=../wkhtmltox-%s' % (make, version))
 
     if config.endswith('-dbg'):
         return

+ 0 - 32
scripts/sync-headers.sh

@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2010, 2011 wkhtmltopdf authors
-#
-# This file is part of wkhtmltopdf.
-#
-# wkhtmltopdf is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# wkhtmltopdf 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 Lesser General Public License
-# along with wkhtmltopdf.  If not, see <http:#www.gnu.org/licenses/>.
-
-mkdir -p include/wkhtmltox
-find src -iname '*.pro' -or -iname '*.pri' | while read name; do
-	cat "$name" | sed -nre 's/PUBLIC_HEADERS \+=[ \t]*(.*[^\t ])[^\t ]*/\1/p' | sed -re 's/[\t ]+/\n/g' | sort -u | while read file; do
-		path="$(dirname $name)/$file"
-		[ -f "$path" ] || continue
-		cat $path | sed -n '4,$p' | sed -e '1s/ \*/\/\*\n \*/'> tmpheader
-		dst="include/wkhtmltox/$(basename $path)"
-
-		[ -f "${dst}" ] && cmp -s "$dst" tmpheader && rm tmpheader && continue
-		echo "$dst"
-		mv tmpheader "$dst"
-	done
-done

+ 1 - 1
src/image/imagecommandlineparser.hh

@@ -22,7 +22,7 @@
 #define __IMAGECOMMANDLINEPARSER_HH__
 #include "commandlineparserbase.hh"
 #include <cstdio>
-#include <wkhtmltox/imagesettings.hh>
+#include <imagesettings.hh>
 
 /*! \brief The class is responsible for parsing command line information
 */

+ 3 - 3
src/image/wkhtmltoimage.cc

@@ -22,9 +22,9 @@
 #include "progressfeedback.hh"
 #include <QApplication>
 #include <QWebFrame>
-#include <wkhtmltox/imageconverter.hh>
-#include <wkhtmltox/imagesettings.hh>
-#include <wkhtmltox/utilities.hh>
+#include <imageconverter.hh>
+#include <imagesettings.hh>
+#include <utilities.hh>
 
 #if defined(Q_OS_UNIX)
 #include <locale.h>

+ 3 - 3
src/lib/converter.hh

@@ -22,8 +22,8 @@
 #define __CONVERTER_HH__
 
 #include <QObject>
-#include <wkhtmltox/loadsettings.hh>
-#include <wkhtmltox/dllbegin.inc>
+#include <loadsettings.hh>
+#include <dllbegin.inc>
 
 namespace wkhtmltopdf {
 
@@ -61,5 +61,5 @@ protected:
 };
 
 }
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 #endif //__CONVERTER_HH__

+ 10 - 0
src/lib/image.h

@@ -21,7 +21,12 @@
 
 #ifndef __IMAGE_H__
 #define __IMAGE_H__
+
+#ifdef BUILDING_WKHTMLTOX
+#include "dllbegin.inc"
+#else
 #include <wkhtmltox/dllbegin.inc>
+#endif
 
 struct wkhtmltoimage_global_settings;
 typedef struct wkhtmltoimage_global_settings wkhtmltoimage_global_settings;
@@ -62,5 +67,10 @@ CAPI(const char *) wkhtmltoimage_progress_string(wkhtmltoimage_converter * conve
 CAPI(int) wkhtmltoimage_http_error_code(wkhtmltoimage_converter * converter);
 CAPI(long) wkhtmltoimage_get_output(wkhtmltoimage_converter * converter, const unsigned char **);
 
+#ifdef BUILDING_WKHTMLTOX
+#include "dllend.inc"
+#else
 #include <wkhtmltox/dllend.inc>
+#endif
+
 #endif /*__IMAGE_H__*/

+ 4 - 4
src/lib/imageconverter.hh

@@ -21,10 +21,10 @@
 #ifndef __IMAGECONVERTER_HH__
 #define __IMAGECONVERTER_HH__
 
-#include <wkhtmltox/converter.hh>
-#include <wkhtmltox/imagesettings.hh>
+#include <converter.hh>
+#include <imagesettings.hh>
 
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 
 class DLL_LOCAL ImageConverterPrivate;
@@ -41,6 +41,6 @@ private:
 	friend class ImageConverterPrivate;
 };
 
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 }
 #endif //__IMAGECONVERTER_HH__

+ 5 - 5
src/lib/imagesettings.hh

@@ -22,11 +22,11 @@
 #define __IMAGESETTINGS_HH__
 
 #include <QString>
-#include <wkhtmltox/logging.hh>
-#include <wkhtmltox/loadsettings.hh>
-#include <wkhtmltox/websettings.hh>
+#include <logging.hh>
+#include <loadsettings.hh>
+#include <websettings.hh>
 
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 namespace settings {
 
@@ -90,7 +90,7 @@ struct DLL_PUBLIC ImageGlobal {
 	bool set(const char * name, const QString & value);
 };
 
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 }
 }
 #endif //__IMAGESETTINGS_HH__

+ 5 - 7
src/lib/lib.pro

@@ -24,14 +24,12 @@ include(lib.pri)
 DEF_FILE = lib.def
 CONFIG(static, shared|static): DEFINES += QT_NODLL
 
-unix {
-   headers.target=headers
-   headers.files=../../include/wkhtmltox/*.h ../../include/wkhtmltox/*.inc
-   headers.path=$$INSTALLBASE/include/wkhtmltox
+headers.target=headers
+headers.files=*.h *.inc
+headers.path=$$INSTALLBASE/include/wkhtmltox
 
-   QMAKE_EXTRA_TARGETS += headers
-   INSTALLS += headers
-}
+QMAKE_EXTRA_TARGETS += headers
+INSTALLS += headers
 
 windows {
    TARGET_EXT=.dll

+ 2 - 2
src/lib/loadsettings.hh

@@ -24,7 +24,7 @@
 #include <QNetworkProxy>
 #include <QString>
 
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 namespace settings {
 
@@ -145,5 +145,5 @@ DLL_PUBLIC QString proxyToStr(const Proxy & proxy);
 
 }
 }
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 #endif //__LOADSETTINGS_HH__

+ 2 - 2
src/lib/logging.cc

@@ -21,7 +21,7 @@
 #include "logging.hh"
 #include <QMap>
 #include <QString>
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 namespace settings {
 
@@ -59,4 +59,4 @@ QString logLevelToStr(const LogLevel & l, bool * ok) {
 
 }
 }
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>

+ 2 - 2
src/lib/logging.hh

@@ -23,7 +23,7 @@
 
 #include <QMap>
 #include <QString>
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 namespace settings {
 
@@ -39,5 +39,5 @@ DLL_PUBLIC QString logLevelToStr(const LogLevel & l, bool * ok=0);
 
 }
 }
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 #endif //__LOGGING_HH__

+ 3 - 3
src/lib/multipageloader.hh

@@ -29,9 +29,9 @@
 #else
 #include <QWebPage>
 #endif
-#include <wkhtmltox/loadsettings.hh>
+#include <loadsettings.hh>
 
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 
 class DLL_LOCAL MyQWebPage;
@@ -73,5 +73,5 @@ private:
 };
 
 }
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 #endif //__MULTIPAGELOADER_HH__

+ 10 - 0
src/lib/pdf.h

@@ -21,7 +21,12 @@
 
 #ifndef __PDF_H__
 #define __PDF_H__
+
+#ifdef BUILDING_WKHTMLTOX
+#include "dllbegin.inc"
+#else
 #include <wkhtmltox/dllbegin.inc>
+#endif
 
 struct wkhtmltopdf_global_settings;
 typedef struct wkhtmltopdf_global_settings wkhtmltopdf_global_settings;
@@ -74,5 +79,10 @@ CAPI(const char *) wkhtmltopdf_progress_string(wkhtmltopdf_converter * converter
 CAPI(int) wkhtmltopdf_http_error_code(wkhtmltopdf_converter * converter);
 CAPI(long) wkhtmltopdf_get_output(wkhtmltopdf_converter * converter, const unsigned char **);
 
+#ifdef BUILDING_WKHTMLTOX
+#include "dllend.inc"
+#else
 #include <wkhtmltox/dllend.inc>
+#endif
+
 #endif /*__PDF_H__*/

+ 4 - 4
src/lib/pdfconverter.hh

@@ -21,10 +21,10 @@
 #ifndef __PDFCONVERTER_HH__
 #define __PDFCONVERTER_HH__
 
-#include <wkhtmltox/converter.hh>
-#include <wkhtmltox/pdfsettings.hh>
+#include <converter.hh>
+#include <pdfsettings.hh>
 
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 
 class DLL_LOCAL PdfConverterPrivate;
@@ -48,5 +48,5 @@ signals:
 };
 
 }
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 #endif //__PDFCONVERTER_HH__

+ 5 - 5
src/lib/pdfsettings.hh

@@ -24,11 +24,11 @@
 #include <QNetworkProxy>
 #include <QPrinter>
 #include <QString>
-#include <wkhtmltox/logging.hh>
-#include <wkhtmltox/loadsettings.hh>
-#include <wkhtmltox/websettings.hh>
+#include <logging.hh>
+#include <loadsettings.hh>
+#include <websettings.hh>
 
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 namespace settings {
 
@@ -227,5 +227,5 @@ DLL_PUBLIC QString colorModeToStr(QPrinter::ColorMode o);
 
 DLL_PUBLIC void dumpDefaultTOCStyleSheet(QTextStream & stream, settings::TableOfContent & s);
 }
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 #endif //__PDFSETTINGS_HH__

+ 2 - 2
src/lib/utilities.hh

@@ -30,7 +30,7 @@
 #include <QSvgRenderer>
 #include <QUrl>
 
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 /**
  * Custom simplistic style
  */
@@ -56,5 +56,5 @@ public slots:
 
 DLL_PUBLIC int handleError(bool success, int errorCode);
 
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 #endif //__UTILITIES_HH__

+ 2 - 2
src/lib/websettings.hh

@@ -24,7 +24,7 @@
 #include <QNetworkProxy>
 #include <QString>
 
-#include <wkhtmltox/dllbegin.inc>
+#include <dllbegin.inc>
 namespace wkhtmltopdf {
 namespace settings {
 
@@ -61,5 +61,5 @@ struct DLL_PUBLIC Web {
 
 }
 }
-#include <wkhtmltox/dllend.inc>
+#include <dllend.inc>
 #endif //__WEBSETTINGS_HH__

+ 1 - 1
src/pdf/pdfarguments.cc

@@ -22,7 +22,7 @@
 #include "pdfcommandlineparser.hh"
 #include <QFile>
 #include <qglobal.h>
-#include <wkhtmltox/pdfconverter.hh>
+#include <pdfconverter.hh>
 
 /*!
   \class ArgHandler

+ 1 - 1
src/pdf/pdfcommandlineparser.hh

@@ -22,7 +22,7 @@
 #define __PDFCOMMANDLINEPARSER_HH__
 #include "commandlineparserbase.hh"
 #include <cstdio>
-#include <wkhtmltox/pdfsettings.hh>
+#include <pdfsettings.hh>
 
 class PdfCommandLineParser: public CommandLineParserBase {
 public:

+ 3 - 3
src/pdf/wkhtmltopdf.cc

@@ -30,9 +30,9 @@
 #include <qapplication.h>
 #include <qglobal.h>
 #include <string.h>
-#include <wkhtmltox/pdfconverter.hh>
-#include <wkhtmltox/pdfsettings.hh>
-#include <wkhtmltox/utilities.hh>
+#include <pdfconverter.hh>
+#include <pdfsettings.hh>
+#include <utilities.hh>
 
 #if defined(Q_OS_UNIX)
 #include <locale.h>

+ 2 - 2
src/shared/arghandler.inl

@@ -21,8 +21,8 @@
 #ifndef __ARGHANDLER_INL__
 #define __ARGHANDLER_INL__
 #include "commandlineparserbase.hh"
-#include <wkhtmltox/loadsettings.hh>
-#include <wkhtmltox/logging.hh>
+#include <loadsettings.hh>
+#include <logging.hh>
 
 template <typename T> class DstArgHandler: public ArgHandler {
 public:

+ 2 - 2
src/shared/commandlineparserbase.hh

@@ -20,8 +20,8 @@
 
 #ifndef __COMMANDLINEPARSERBASE_HH__
 #define __COMMANDLINEPARSERBASE_HH__
-#include <wkhtmltox/loadsettings.hh>
-#include <wkhtmltox/websettings.hh>
+#include <loadsettings.hh>
+#include <websettings.hh>
 class Outputter;
 class CommandLineParserBase;
 

+ 1 - 1
src/shared/commonarguments.cc

@@ -20,7 +20,7 @@
 
 #include "arghandler.inl"
 #include "commandlineparserbase.hh"
-#include <wkhtmltox/loadsettings.hh>
+#include <loadsettings.hh>
 using namespace wkhtmltopdf::settings;
 
 struct LoadErrorHandlingTM: public SomeSetterTM<LoadPage::LoadErrorHandling> {

+ 2 - 2
src/shared/progressfeedback.hh

@@ -20,8 +20,8 @@
 
 #ifndef __PROGRESSFEEDBACK_HH__
 #define __PROGRESSFEEDBACK_HH__
-#include <wkhtmltox/converter.hh>
-#include <wkhtmltox/logging.hh>
+#include <converter.hh>
+#include <logging.hh>
 namespace wkhtmltopdf {
 
 class ProgressFeedback: public QObject {

+ 2 - 4
wkhtmltox.nsi

@@ -92,10 +92,8 @@ skip_vcruntime:
   File static-build\${TARGET}\app\bin\wkhtmltox.lib
 
   SetOutPath "$INSTDIR\include\wkhtmltox"
-  File include\wkhtmltox\dllbegin.inc
-  File include\wkhtmltox\dllend.inc
-  File include\wkhtmltox\pdf.h
-  File include\wkhtmltox\image.h
+  File src\lib\*.inc
+  File src\lib\*.h
 
   WriteRegStr HKLM "Software\wkhtmltopdf" "InstallPath" "$INSTDIR"
   WriteRegStr HKLM "Software\wkhtmltopdf" "Version"     "${VERSION}"