summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 34c29a8)
raw | patch | inline | side by side (parent: 34c29a8)
author | keescook <keescook@users.sourceforge.net> | |
Mon, 10 Dec 2007 00:48:29 +0000 (00:48 +0000) | ||
committer | keescook <keescook@users.sourceforge.net> | |
Mon, 10 Dec 2007 00:48:29 +0000 (00:48 +0000) |
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 61d40ea4eca2bea2d18e5210ca065e6a88866535..8f106f55fe2db6ad087d9d5e5b2e92dcbbdbde0b 100644 (file)
# include "config.h"
#endif
-#ifdef HAVE_CAIRO_PDF
-
#ifndef PANGO_ENABLE_BACKEND
#define PANGO_ENABLE_BACKEND
#endif
break;
}
+ return _finishSurfaceSetup (surface);
+}
+
+bool
+CairoRenderContext::setSurface(cairo_surface_t *surface)
+{
+ if (_is_valid || !surface)
+ return false;
+
+ bool ret = _finishSurfaceSetup (surface);
+ if (ret)
+ cairo_surface_reference (surface);
+ return ret;
+}
+
+bool
+CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface)
+{
_cr = cairo_create(surface);
_surface = surface;
@@ -1502,8 +1518,6 @@ _write_callback(void *closure, const unsigned char *data, unsigned int length)
/* End of GNU GPL code */
-#endif /* HAVE_CAIRO_PDF */
-
/*
Local Variables:
diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h
index dc1592a81f44c69deb45505866a88579c703df5f..ff7ebec7fdcbd15ecdaf86e54d8bd5a81dd7aad6 100644 (file)
# include "config.h"
#endif
-#ifdef HAVE_CAIRO_PDF
-
#include "extension/extension.h"
#include <set>
#include <string>
given width, height and with the currently set target
surface type. */
bool setupSurface(double width, double height);
+ /** Set the cairo_surface_t from an external source */
+ bool setSurface(cairo_surface_t *surface);
cairo_surface_t *getSurface(void);
unsigned int _showGlyphs(cairo_t *cr, PangoFont *font, std::vector<CairoGlyphInfo> const &glyphtext, bool is_stroke);
+ bool _finishSurfaceSetup(cairo_surface_t *surface);
void _setFillStyle(SPStyle const *style, NRRect const *pbox);
void _setStrokeStyle(SPStyle const *style, NRRect const *pbox);
} /* namespace Extension */
} /* namespace Inkscape */
-#endif /* HAVE_CAIRO_PDF */
-
#endif /* !EXTENSION_INTERNAL_CAIRO_RENDER_CONTEXT_H_SEEN */
/*
index 5583fa63c9a89dd164f956e7785193ea639dd278..418e82b894d260fedf7ee507b65a13b81a289be9 100644 (file)
# include "config.h"
#endif
-#ifdef HAVE_CAIRO_PDF
-
#ifndef PANGO_ENABLE_BACKEND
#define PANGO_ENABLE_BACKEND
#endif
@@ -598,9 +596,6 @@ calculatePreserveAspectRatio(unsigned int aspect_align, unsigned int aspect_clip
/* End of GNU GPL code */
-#endif /* HAVE_CAIRO_PDF */
-
-
/*
Local Variables:
mode:c++
index 6cb810bfe3bb7ae1c543eb130241504be4f99d19..4056a8697dbd5d2026798458af68c111720b01e7 100644 (file)
# include "config.h"
#endif
-#ifdef HAVE_CAIRO_PDF
-
#include "extension/extension.h"
#include <set>
#include <string>
} /* namespace Extension */
} /* namespace Inkscape */
-#endif /* HAVE_CAIRO_PDF */
-
#endif /* !EXTENSION_INTERNAL_CAIRO_RENDERER_H_SEEN */
/*