Code

Added code to initialize DBus (if enabled.)
[inkscape.git] / src / extension / internal / cairo-render-context.h
index fe76cb105861b0cb15e274cd653fd25c11e395f2..930668e03b348b1749c08f1d302ee7f4b17dae22 100644 (file)
@@ -21,8 +21,6 @@
 #include <set>
 #include <string>
 
-#include "libnr/nr-path.h"
-#include <libnr/nr-matrix-ops.h>
 #include <2geom/forward.h>
 
 #include "style.h"
@@ -50,11 +48,12 @@ struct CairoGlyphInfo {
 
 struct CairoRenderState {
     unsigned int merge_opacity : 1;     // whether fill/stroke opacity can be mul'd with item opacity
-    unsigned int need_layer : 1;
+    unsigned int need_layer : 1;        // whether object is masked, clipped, and/or has a non-zero opacity
     unsigned int has_overflow : 1;
     unsigned int parent_has_userspace : 1;  // whether the parent's ctm should be applied
     float opacity;
     bool has_filtereffect;
+    Geom::Matrix item_transform;     // this item's item->transform, for correct clipping
 
     SPClipPath *clip_path;
     SPMask* mask;
@@ -86,9 +85,10 @@ public:
     bool setPdfTarget(gchar const *utf8_fn);
     bool setPsTarget(gchar const *utf8_fn);
     /** Set the cairo_surface_t from an external source */
-    bool setSurfaceTarget(cairo_surface_t *surface, bool is_vector);
+    bool setSurfaceTarget(cairo_surface_t *surface, bool is_vector, cairo_matrix_t *ctm=NULL);
 
     void setPSLevel(unsigned int level);
+    void setEPS(bool eps);
     unsigned int getPSLevel(void);
     void setPDFLevel(unsigned int level);
     void setTextToPath(bool texttopath);
@@ -114,8 +114,8 @@ public:
     void setClipMode(CairoClipMode mode);
     CairoClipMode getClipMode(void) const;
 
-    void addBpath(NArtBpath const *bp);
-    void setBpath(NArtBpath const *bp);
+    void addPathVector(Geom::PathVector const &pv);
+    void setPathVector(Geom::PathVector const &pv);
 
     void pushLayer(void);
     void popLayer(void);
@@ -133,12 +133,11 @@ public:
     void getParentTransform(Geom::Matrix *copy) const;
 
     /* Clipping methods */
-    void addClipPath(NArtBpath const *bp, SPIEnum const *fill_rule);
+    void addClipPath(Geom::PathVector const &pv, SPIEnum const *fill_rule);
     void addClippingRect(double x, double y, double width, double height);
 
     /* Rendering methods */
     bool renderPathVector(Geom::PathVector const & pathv, SPStyle const *style, NRRect const *pbox);
-    bool renderPath(const_NRBPath const *bpath, SPStyle const *style, NRRect const *pbox);
     bool renderImage(unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
                      Geom::Matrix const *image_transform, SPStyle const *style);
     bool renderGlyphtext(PangoFont *font, Geom::Matrix const *font_matrix,
@@ -155,6 +154,7 @@ protected:
     unsigned short _dpi;
     unsigned int _pdf_level;
     unsigned int _ps_level;
+    bool _eps;
     bool _is_texttopath;
     bool _is_filtertobitmap;
     int _bitmapresolution;
@@ -164,7 +164,7 @@ protected:
     unsigned int _is_valid : 1;
     unsigned int _vector_based_target : 1;
 
-    cairo_t *_cr;
+    cairo_t *_cr; // Cairo context
     cairo_surface_t *_surface;
     cairo_surface_type_t _target;
     cairo_format_t _target_format;
@@ -187,7 +187,7 @@ protected:
 
     unsigned int _showGlyphs(cairo_t *cr, PangoFont *font, std::vector<CairoGlyphInfo> const &glyphtext, bool is_stroke);
 
-    bool _finishSurfaceSetup(cairo_surface_t *surface);
+    bool _finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t *ctm = NULL);
     void _setFillStyle(SPStyle const *style, NRRect const *pbox);
     void _setStrokeStyle(SPStyle const *style, NRRect const *pbox);