Commit 58de0458 authored by Kristian Høgsberg's avatar Kristian Høgsberg

2005-12-03 Kristian Høgsberg <krh@redhat.com>

        * qt/Makefile.am (noinst_PROGRAMS): Only build qt test program if
        splash is enabled.

        * poppler/CairoOutputDev.cc: Remove unused grid snapping code,
        sidestepping #4507.

        * glib/poppler-document.h (PopplerPermissions): Breaking enum
        definition over multiple lines confuses glib-mkenums (#4600).

        * poppler/Makefile.am (libpoppler_la_LIBADD): Add FREETYPE_LIBS
        (#4515).

        * poppler/TextOutputDev.cc:
        * qt/poppler-qt.h: GCC-4.1 fixes (#5031).
parent df45483f
2005-12-03 Kristian Høgsberg <krh@redhat.com>
* qt/Makefile.am (noinst_PROGRAMS): Only build qt test program if
splash is enabled.
* poppler/CairoOutputDev.cc: Remove unused grid snapping code,
sidestepping #4507.
* glib/poppler-document.h (PopplerPermissions): Breaking enum
definition over multiple lines confuses glib-mkenums (#4600).
* poppler/Makefile.am (libpoppler_la_LIBADD): Add FREETYPE_LIBS
(#4515).
* poppler/TextOutputDev.cc:
* qt/poppler-qt.h: GCC-4.1 fixes (#5031).
2005-12-03 Kristian Høgsberg <krh@redhat.com>
Fixes from Nickolay V. Shmyrev:
......
......@@ -82,10 +82,7 @@ typedef enum /*< flags >*/
POPPLER_PERMISSIONS_OK_TO_MODIFY = 1 << 1,
POPPLER_PERMISSIONS_OK_TO_COPY = 1 << 2,
POPPLER_PERMISSIONS_OK_TO_ADD_NOTES = 1 << 3,
POPPLER_PERMISSIONS_FULL = (POPPLER_PERMISSIONS_OK_TO_PRINT
| POPPLER_PERMISSIONS_OK_TO_MODIFY
| POPPLER_PERMISSIONS_OK_TO_COPY
| POPPLER_PERMISSIONS_OK_TO_ADD_NOTES),
POPPLER_PERMISSIONS_FULL = (POPPLER_PERMISSIONS_OK_TO_PRINT | POPPLER_PERMISSIONS_OK_TO_MODIFY | POPPLER_PERMISSIONS_OK_TO_COPY | POPPLER_PERMISSIONS_OK_TO_ADD_NOTES),
} PopplerPermissions;
......
......@@ -33,8 +33,6 @@
//------------------------------------------------------------------------
#define soutRound(x) ((int)(x + 0.5))
// #define LOG_CAIRO
#ifdef LOG_CAIRO
......@@ -276,8 +274,7 @@ void CairoOutputDev::updateFont(GfxState *state) {
cairo_set_font_matrix (cairo, &matrix);
}
void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
GBool snapToGrid) {
void CairoOutputDev::doPath(GfxState *state, GfxPath *path) {
GfxSubpath *subpath;
double x1, y1, x2, y2, x3, y3;
int i, j;
......@@ -286,9 +283,6 @@ void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
subpath = path->getSubpath(i);
if (subpath->getNumPoints() > 0) {
state->transform(subpath->getX(0), subpath->getY(0), &x1, &y1);
if (snapToGrid) {
x1 = round (x1); y1 = round (y1);
}
cairo_move_to (cairo, x1, y1);
LOG (printf ("move_to %f, %f\n", x1, y1));
j = 1;
......@@ -297,11 +291,6 @@ void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
state->transform(subpath->getX(j), subpath->getY(j), &x1, &y1);
state->transform(subpath->getX(j+1), subpath->getY(j+1), &x2, &y2);
state->transform(subpath->getX(j+2), subpath->getY(j+2), &x3, &y3);
if (snapToGrid) {
x1 = round (x1); y1 = round (y1);
x2 = round (x2); y2 = round (y2);
x3 = round (x3); y3 = round (y3);
}
cairo_curve_to (cairo,
x1, y1,
x2, y2,
......@@ -310,9 +299,6 @@ void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
j += 3;
} else {
state->transform(subpath->getX(j), subpath->getY(j), &x1, &y1);
if (snapToGrid) {
x1 = round (x1); y1 = round (y1);
}
cairo_line_to (cairo, x1, y1);
LOG(printf ("line_to %f, %f\n", x1, y1));
++j;
......@@ -327,14 +313,14 @@ void CairoOutputDev::doPath(GfxState *state, GfxPath *path,
}
void CairoOutputDev::stroke(GfxState *state) {
doPath (state, state->getPath(), gFalse);
doPath (state, state->getPath());
cairo_set_source (cairo, stroke_pattern);
LOG(printf ("stroke\n"));
cairo_stroke (cairo);
}
void CairoOutputDev::fill(GfxState *state) {
doPath (state, state->getPath(), gFalse);
doPath (state, state->getPath());
cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING);
cairo_set_source (cairo, fill_pattern);
LOG(printf ("fill\n"));
......@@ -342,7 +328,7 @@ void CairoOutputDev::fill(GfxState *state) {
}
void CairoOutputDev::eoFill(GfxState *state) {
doPath (state, state->getPath(), gFalse);
doPath (state, state->getPath());
cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_EVEN_ODD);
cairo_set_source (cairo, fill_pattern);
LOG(printf ("fill-eo\n"));
......@@ -350,14 +336,14 @@ void CairoOutputDev::eoFill(GfxState *state) {
}
void CairoOutputDev::clip(GfxState *state) {
doPath (state, state->getPath(), gFalse);
doPath (state, state->getPath());
cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING);
cairo_clip (cairo);
LOG (printf ("clip\n"));
}
void CairoOutputDev::eoClip(GfxState *state) {
doPath (state, state->getPath(), gFalse);
doPath (state, state->getPath());
cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_EVEN_ODD);
cairo_clip (cairo);
LOG (printf ("clip-eo\n"));
......@@ -395,13 +381,10 @@ void CairoOutputDev::endString(GfxState *state)
if (!currentFont)
return;
// check for invisible text -- this is used by Acrobat Capture
// ignore empty strings and invisible text -- this is used by
// Acrobat Capture
render = state->getRender();
if (render == 3)
return;
// ignore empty strings
if (glyphCount == 0) {
if (render == 3 || glyphCount == 0) {
gfree(glyphs);
glyphs = NULL;
return;
......
......@@ -133,7 +133,7 @@ public:
void setSurface (cairo_surface_t *surface);
protected:
void doPath(GfxState *state, GfxPath *path, GBool snapToGrid);
void doPath(GfxState *state, GfxPath *path);
GfxRGB fill_color, stroke_color;
cairo_pattern_t *fill_pattern, *stroke_pattern;
......
......@@ -90,7 +90,8 @@ libpoppler_la_LIBADD = \
$(cairo_libs) \
$(arthur_libs) \
$(libjpeg_libs) \
$(zlib_libs)
$(zlib_libs) \
$(FREETYPE_LIBS)
poppler_includedir = $(includedir)/poppler
poppler_include_HEADERS = \
......
......@@ -3086,7 +3086,7 @@ public:
virtual void visitWord (TextWord *word, int begin, int end,
PDFRectangle *selection) { };
GooString *TextSelectionDumper::getText(void);
GooString *getText(void);
private:
TextLineFrag *frags;
......
......@@ -24,8 +24,12 @@ libpoppler_qt_la_LIBADD= \
$(POPPLER_QT_LIBS) \
$(FREETYPE_LIBS)
if BUILD_SPLASH_OUTPUT
noinst_PROGRAMS = test-poppler-qt
endif
test_poppler_qt_SOURCES = \
test-poppler-qt.cpp
......
......@@ -249,7 +249,7 @@ public:
UseOC
};
static Document *Document::load(const QString & filePath);
static Document *load(const QString & filePath);
Page *getPage(int index) const{ return new Page(this, index); }
......@@ -291,11 +291,11 @@ public:
*/
bool scanForFonts( int numPages, QValueList<FontInfo> *fontList ) const;
Document::~Document();
~Document();
private:
DocumentData *data;
Document::Document(DocumentData *dataA);
Document(DocumentData *dataA);
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment