瀏覽代碼

Move utilities to the libarary as there are usefull to the c bindings

Antialize 15 年之前
父節點
當前提交
36bdda5088
共有 7 個文件被更改,包括 58 次插入7 次删除
  1. 47 0
      include/wkhtmltox/utilities.hh
  2. 1 1
      src/image/wkhtmltoimage.cc
  3. 2 1
      src/lib/lib.pri
  4. 0 0
      src/lib/utilities.cc
  5. 5 2
      src/lib/utilities.hh
  6. 1 1
      src/pdf/wkhtmltopdf.cc
  7. 2 2
      src/shared/shared.pri

+ 47 - 0
include/wkhtmltox/utilities.hh

@@ -0,0 +1,47 @@
+// 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 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 General Public License
+// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef __UTILITIES_HH__
+#define __UTILITIES_HH__
+#include <QCleanlooksStyle>
+#include <QCommonStyle>
+#include <QFile>
+#include <QFileInfo>
+#include <QImageWriter>
+#include <QPainter>
+#include <QStyleOption>
+#include <QUrl>
+
+#include <wkhtmltox/dllbegin.inc>
+/**
+ * Custom simplistic style
+ */
+class DLL_PUBLIC MyLooksStyle: public QCleanlooksStyle {
+	Q_OBJECT
+public:
+	typedef QCleanlooksStyle parent_t;
+	MyLooksStyle();
+	void drawPrimitive( PrimitiveElement element, const QStyleOption * option, QPainter * painter, const QWidget * widget = 0 ) const;
+	bool weAreDrawingForms;
+public slots:
+	void producingForms(bool f);
+};
+
+DLL_PUBLIC int handleError(bool success, int errorCode);
+#endif //__UTILITIES_HH__
+
+#include <wkhtmltox/dllend.inc>

+ 1 - 1
src/image/wkhtmltoimage.cc

@@ -20,11 +20,11 @@
 
 #include "imagecommandlineparser.hh"
 #include "progressfeedback.hh"
-#include "utilities.hh"
 #include <QApplication>
 #include <QWebFrame>
 #include <wkhtmltox/imageconverter.hh>
 #include <wkhtmltox/imagesettings.hh>
+#include <wkhtmltox/utilities.hh>
 
 int main(int argc, char** argv) {
 	//This will store all our settings

+ 2 - 1
src/lib/lib.pri

@@ -20,10 +20,11 @@ DEFINES += BUILDING_DLL
 #Shared
 PUBLIC_HEADERS += ../lib/converter.hh ../lib/multipageloader.hh ../lib/dllbegin.inc
 PUBLIC_HEADERS += ../lib/dllend.inc ../lib/loadsettings.hh ../lib/websettings.hh
+PUBLIC_HEADERS += ../lib/utilities.hh
 HEADERS += ../lib/multipageloader_p.hh  ../lib/converter_p.hh
 SOURCES += ../lib/loadsettings.cc ../lib/multipageloader.cc ../lib/tempfile.cc \
 	   ../lib/converter.cc ../lib/websettings.cc  \
-  	   ../lib/reflect.cc
+  	   ../lib/reflect.cc ../lib/utilities.cc
 
 #Pdf
 PUBLIC_HEADERS += ../lib/pdfconverter.hh ../lib/pdfsettings.hh

+ 0 - 0
src/shared/utilities.cc → src/lib/utilities.cc


+ 5 - 2
src/shared/utilities.hh → src/lib/utilities.hh

@@ -29,10 +29,11 @@
 #include <QStyleOption>
 #include <QUrl>
 
+#include <wkhtmltox/dllbegin.inc>
 /**
  * Custom simplistic style
  */
-class MyLooksStyle: public QCleanlooksStyle {
+class DLL_PUBLIC MyLooksStyle: public QCleanlooksStyle {
 	Q_OBJECT
 public:
 	typedef QCleanlooksStyle parent_t;
@@ -43,5 +44,7 @@ public slots:
 	void producingForms(bool f);
 };
 
-int handleError(bool success, int errorCode);
+DLL_PUBLIC int handleError(bool success, int errorCode);
+
+#include <wkhtmltox/dllend.inc>
 #endif //__UTILITIES_HH__

+ 1 - 1
src/pdf/wkhtmltopdf.cc

@@ -20,7 +20,6 @@
 
 #include "pdfcommandlineparser.hh"
 #include "progressfeedback.hh"
-#include "utilities.hh"
 #include <QCleanlooksStyle>
 #include <QCommonStyle>
 #include <QPainter>
@@ -34,6 +33,7 @@
 #include <string.h>
 #include <wkhtmltox/pdfconverter.hh>
 #include <wkhtmltox/pdfsettings.hh>
+#include <wkhtmltox/utilities.hh>
 
 using namespace wkhtmltopdf::settings;
 using namespace wkhtmltopdf;

+ 2 - 2
src/shared/shared.pri

@@ -15,9 +15,9 @@
 # You should have received a copy of the GNU General Public License
 # along with wkhtmltopdf.  If not, see <http:#www.gnu.org/licenses/>.
 
-HEADERS +=  ../shared/utilities.hh  ../shared/progressfeedback.hh
+HEADERS +=  ../shared/progressfeedback.hh
 
 SOURCES += ../shared/outputter.cc ../shared/manoutputter.cc ../shared/htmloutputter.cc \
            ../shared/textoutputter.cc ../shared/arghandler.cc ../shared/commondocparts.cc \
- 	   ../shared/commandlineparserbase.cc ../shared/commonarguments.cc ../shared/utilities.cc \
+ 	   ../shared/commandlineparserbase.cc ../shared/commonarguments.cc \
 	   ../shared/progressfeedback.cc