diff --git a/CMakeLists.txt b/CMakeLists.txt index 2badbab..68b0fc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,8 @@ add_executable(pdf2htmlEX src/util/ffw.c src/util/math.h src/util/math.cc + src/util/misc.h + src/util/misc.cc src/util/namespace.h src/util/path.h src/util/path.cc @@ -181,8 +183,6 @@ add_executable(pdf2htmlEX src/util/TmpFiles.cc src/util/unicode.h src/util/unicode.cc - src/util/util.h - src/util/util.cc ) target_link_libraries(pdf2htmlEX ${PDF2HTMLEX_LIBS}) diff --git a/src/HTMLRenderer/HTMLRenderer.h b/src/HTMLRenderer/HTMLRenderer.h index d11b62a..7dfc605 100644 --- a/src/HTMLRenderer/HTMLRenderer.h +++ b/src/HTMLRenderer/HTMLRenderer.h @@ -26,7 +26,7 @@ #include "Param.h" #include "Preprocessor.h" -#include "util/util.h" +#include "util/const.h" #include "util/string_formatter.h" #include "util/TmpFiles.h" diff --git a/src/HTMLRenderer/LineBuffer.cc b/src/HTMLRenderer/LineBuffer.cc index 8876ed0..00d4078 100644 --- a/src/HTMLRenderer/LineBuffer.cc +++ b/src/HTMLRenderer/LineBuffer.cc @@ -12,6 +12,7 @@ #include "HTMLRenderer.h" #include "util/namespace.h" #include "util/unicode.h" +#include "util/math.h" namespace pdf2htmlEX { @@ -19,6 +20,8 @@ using std::min; using std::max; using std::vector; using std::ostream; +using std::cerr; +using std::endl; void HTMLRenderer::LineBuffer::reset(GfxState * state) { diff --git a/src/HTMLRenderer/Preprocessor.cc b/src/HTMLRenderer/Preprocessor.cc index 3214d99..1c77337 100644 --- a/src/HTMLRenderer/Preprocessor.cc +++ b/src/HTMLRenderer/Preprocessor.cc @@ -15,7 +15,8 @@ #include #include "Preprocessor.h" -#include "util/util.h" +#include "util/misc.h" +#include "util/const.h" namespace pdf2htmlEX { diff --git a/src/HTMLRenderer/draw.cc b/src/HTMLRenderer/draw.cc index 0185c07..9d21d46 100644 --- a/src/HTMLRenderer/draw.cc +++ b/src/HTMLRenderer/draw.cc @@ -14,6 +14,7 @@ #include #include "HTMLRenderer.h" +#include "util/misc.h" #include "util/math.h" #include "util/namespace.h" diff --git a/src/HTMLRenderer/export.cc b/src/HTMLRenderer/export.cc index c8e0ea8..f7f6b18 100644 --- a/src/HTMLRenderer/export.cc +++ b/src/HTMLRenderer/export.cc @@ -14,6 +14,7 @@ #include "util/namespace.h" #include "util/base64.h" #include "util/math.h" +#include "util/misc.h" namespace pdf2htmlEX { diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index 2c8833d..fa5a1cb 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -31,6 +31,8 @@ using std::max; using std::min_element; using std::vector; using std::abs; +using std::cerr; +using std::endl; static void dummy(void *, enum ErrorCategory, int pos, char *) { diff --git a/src/HTMLRenderer/install.cc b/src/HTMLRenderer/install.cc index a51dbf7..511e1d4 100644 --- a/src/HTMLRenderer/install.cc +++ b/src/HTMLRenderer/install.cc @@ -17,10 +17,13 @@ #include "HTMLRenderer.h" #include "util/namespace.h" #include "util/math.h" +#include "util/misc.h" namespace pdf2htmlEX { using std::abs; +using std::cerr; +using std::endl; const FontInfo * HTMLRenderer::install_font(GfxFont * font) { diff --git a/src/HTMLRenderer/link.cc b/src/HTMLRenderer/link.cc index 68126dd..fa78b9e 100644 --- a/src/HTMLRenderer/link.cc +++ b/src/HTMLRenderer/link.cc @@ -16,12 +16,15 @@ #include "HTMLRenderer.h" #include "util/namespace.h" #include "util/math.h" +#include "util/misc.h" namespace pdf2htmlEX { using std::ostringstream; using std::min; using std::max; +using std::cerr; +using std::endl; /* * The detailed rectangle area of the link destination diff --git a/src/HTMLRenderer/text.cc b/src/HTMLRenderer/text.cc index 2f40b82..666be7e 100644 --- a/src/HTMLRenderer/text.cc +++ b/src/HTMLRenderer/text.cc @@ -21,6 +21,7 @@ #include "util/unicode.h" #include "util/path.h" #include "util/math.h" +#include "util/misc.h" namespace pdf2htmlEX { @@ -29,6 +30,8 @@ using std::min; using std::all_of; using std::floor; using std::swap; +using std::cerr; +using std::endl; string HTMLRenderer::dump_embedded_font (GfxFont * font, long long fn_id) { diff --git a/src/util/const.h b/src/util/const.h index 1fde46f..ffd2357 100644 --- a/src/util/const.h +++ b/src/util/const.h @@ -13,6 +13,10 @@ namespace pdf2htmlEX { +#ifndef nullptr +#define nullptr (NULL) +#endif + static const double EPS = 1e-6; static const double DEFAULT_DPI = 72.0; extern const double ID_MATRIX[6]; diff --git a/src/util/util.cc b/src/util/misc.cc similarity index 88% rename from src/util/util.cc rename to src/util/misc.cc index 034d108..e2572c0 100644 --- a/src/util/util.cc +++ b/src/util/misc.cc @@ -6,16 +6,9 @@ * 2012.08.10 */ -#include -#include +#include -#include -#include -#include -#include -#include - -#include "util.h" +#include "misc.h" using std::cerr; using std::endl; diff --git a/src/util/util.h b/src/util/misc.h similarity index 81% rename from src/util/util.h rename to src/util/misc.h index 24e1248..11ae739 100644 --- a/src/util/util.h +++ b/src/util/misc.h @@ -9,19 +9,9 @@ #ifndef UTIL_H__ #define UTIL_H__ -#include #include -#include -#include -#include -#include -#include -#include "const.h" - -#ifndef nullptr -#define nullptr (NULL) -#endif +#include namespace pdf2htmlEX { @@ -30,7 +20,6 @@ static inline long long hash_ref(const Ref * id) return (((long long)(id->num)) << (sizeof(id->gen)*8)) | (id->gen); } - /* * In PDF, edges of the rectangle are in the middle of the borders * In HTML, edges are completely outside the rectangle diff --git a/src/util/namespace.h b/src/util/namespace.h index a74f936..46dcd0f 100644 --- a/src/util/namespace.h +++ b/src/util/namespace.h @@ -12,8 +12,6 @@ using std::hex; using std::dec; using std::string; -using std::cout; -using std::cerr; using std::endl; using std::make_pair; using std::ifstream;