mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-07-05 01:28:39 +00:00
split util.h
This commit is contained in:
parent
d179b50147
commit
56e59baeb2
|
@ -173,6 +173,8 @@ add_executable(pdf2htmlEX
|
||||||
src/util/ffw.c
|
src/util/ffw.c
|
||||||
src/util/math.h
|
src/util/math.h
|
||||||
src/util/math.cc
|
src/util/math.cc
|
||||||
|
src/util/misc.h
|
||||||
|
src/util/misc.cc
|
||||||
src/util/namespace.h
|
src/util/namespace.h
|
||||||
src/util/path.h
|
src/util/path.h
|
||||||
src/util/path.cc
|
src/util/path.cc
|
||||||
|
@ -181,8 +183,6 @@ add_executable(pdf2htmlEX
|
||||||
src/util/TmpFiles.cc
|
src/util/TmpFiles.cc
|
||||||
src/util/unicode.h
|
src/util/unicode.h
|
||||||
src/util/unicode.cc
|
src/util/unicode.cc
|
||||||
src/util/util.h
|
|
||||||
src/util/util.cc
|
|
||||||
)
|
)
|
||||||
target_link_libraries(pdf2htmlEX ${PDF2HTMLEX_LIBS})
|
target_link_libraries(pdf2htmlEX ${PDF2HTMLEX_LIBS})
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "Param.h"
|
#include "Param.h"
|
||||||
#include "Preprocessor.h"
|
#include "Preprocessor.h"
|
||||||
#include "util/util.h"
|
#include "util/const.h"
|
||||||
#include "util/string_formatter.h"
|
#include "util/string_formatter.h"
|
||||||
#include "util/TmpFiles.h"
|
#include "util/TmpFiles.h"
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "HTMLRenderer.h"
|
#include "HTMLRenderer.h"
|
||||||
#include "util/namespace.h"
|
#include "util/namespace.h"
|
||||||
#include "util/unicode.h"
|
#include "util/unicode.h"
|
||||||
|
#include "util/math.h"
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
namespace pdf2htmlEX {
|
||||||
|
|
||||||
|
@ -19,6 +20,8 @@ using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::ostream;
|
using std::ostream;
|
||||||
|
using std::cerr;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
void HTMLRenderer::LineBuffer::reset(GfxState * state)
|
void HTMLRenderer::LineBuffer::reset(GfxState * state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
#include <GfxFont.h>
|
#include <GfxFont.h>
|
||||||
|
|
||||||
#include "Preprocessor.h"
|
#include "Preprocessor.h"
|
||||||
#include "util/util.h"
|
#include "util/misc.h"
|
||||||
|
#include "util/const.h"
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
namespace pdf2htmlEX {
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "HTMLRenderer.h"
|
#include "HTMLRenderer.h"
|
||||||
|
#include "util/misc.h"
|
||||||
#include "util/math.h"
|
#include "util/math.h"
|
||||||
#include "util/namespace.h"
|
#include "util/namespace.h"
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "util/namespace.h"
|
#include "util/namespace.h"
|
||||||
#include "util/base64.h"
|
#include "util/base64.h"
|
||||||
#include "util/math.h"
|
#include "util/math.h"
|
||||||
|
#include "util/misc.h"
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
namespace pdf2htmlEX {
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ using std::max;
|
||||||
using std::min_element;
|
using std::min_element;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::abs;
|
using std::abs;
|
||||||
|
using std::cerr;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
static void dummy(void *, enum ErrorCategory, int pos, char *)
|
static void dummy(void *, enum ErrorCategory, int pos, char *)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,10 +17,13 @@
|
||||||
#include "HTMLRenderer.h"
|
#include "HTMLRenderer.h"
|
||||||
#include "util/namespace.h"
|
#include "util/namespace.h"
|
||||||
#include "util/math.h"
|
#include "util/math.h"
|
||||||
|
#include "util/misc.h"
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
namespace pdf2htmlEX {
|
||||||
|
|
||||||
using std::abs;
|
using std::abs;
|
||||||
|
using std::cerr;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
const FontInfo * HTMLRenderer::install_font(GfxFont * font)
|
const FontInfo * HTMLRenderer::install_font(GfxFont * font)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,12 +16,15 @@
|
||||||
#include "HTMLRenderer.h"
|
#include "HTMLRenderer.h"
|
||||||
#include "util/namespace.h"
|
#include "util/namespace.h"
|
||||||
#include "util/math.h"
|
#include "util/math.h"
|
||||||
|
#include "util/misc.h"
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
namespace pdf2htmlEX {
|
||||||
|
|
||||||
using std::ostringstream;
|
using std::ostringstream;
|
||||||
using std::min;
|
using std::min;
|
||||||
using std::max;
|
using std::max;
|
||||||
|
using std::cerr;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The detailed rectangle area of the link destination
|
* The detailed rectangle area of the link destination
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "util/unicode.h"
|
#include "util/unicode.h"
|
||||||
#include "util/path.h"
|
#include "util/path.h"
|
||||||
#include "util/math.h"
|
#include "util/math.h"
|
||||||
|
#include "util/misc.h"
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
namespace pdf2htmlEX {
|
||||||
|
|
||||||
|
@ -29,6 +30,8 @@ using std::min;
|
||||||
using std::all_of;
|
using std::all_of;
|
||||||
using std::floor;
|
using std::floor;
|
||||||
using std::swap;
|
using std::swap;
|
||||||
|
using std::cerr;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
string HTMLRenderer::dump_embedded_font (GfxFont * font, long long fn_id)
|
string HTMLRenderer::dump_embedded_font (GfxFont * font, long long fn_id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
namespace pdf2htmlEX {
|
||||||
|
|
||||||
|
#ifndef nullptr
|
||||||
|
#define nullptr (NULL)
|
||||||
|
#endif
|
||||||
|
|
||||||
static const double EPS = 1e-6;
|
static const double EPS = 1e-6;
|
||||||
static const double DEFAULT_DPI = 72.0;
|
static const double DEFAULT_DPI = 72.0;
|
||||||
extern const double ID_MATRIX[6];
|
extern const double ID_MATRIX[6];
|
||||||
|
|
|
@ -6,16 +6,9 @@
|
||||||
* 2012.08.10
|
* 2012.08.10
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <map>
|
||||||
#include <cctype>
|
|
||||||
|
|
||||||
#include <GfxState.h>
|
#include "misc.h"
|
||||||
#include <GfxFont.h>
|
|
||||||
#include <CharTypes.h>
|
|
||||||
#include <GlobalParams.h>
|
|
||||||
#include <Object.h>
|
|
||||||
|
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::endl;
|
using std::endl;
|
|
@ -9,19 +9,9 @@
|
||||||
#ifndef UTIL_H__
|
#ifndef UTIL_H__
|
||||||
#define UTIL_H__
|
#define UTIL_H__
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
|
||||||
#include <cmath>
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include "const.h"
|
#include <GfxState.h>
|
||||||
|
|
||||||
#ifndef nullptr
|
|
||||||
#define nullptr (NULL)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace pdf2htmlEX {
|
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);
|
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 PDF, edges of the rectangle are in the middle of the borders
|
||||||
* In HTML, edges are completely outside the rectangle
|
* In HTML, edges are completely outside the rectangle
|
|
@ -12,8 +12,6 @@
|
||||||
using std::hex;
|
using std::hex;
|
||||||
using std::dec;
|
using std::dec;
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::cout;
|
|
||||||
using std::cerr;
|
|
||||||
using std::endl;
|
using std::endl;
|
||||||
using std::make_pair;
|
using std::make_pair;
|
||||||
using std::ifstream;
|
using std::ifstream;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user