summaryrefslogtreecommitdiffstats
path: root/src/display/nr-arena-shape.h
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-06-28 00:37:10 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-06-28 00:37:10 +0000
commitcf6ce8045cd7a019c263d557fd2ea6c3b8a0e669 (patch)
treef9decbfe9e67caac94235d9f1198bef450ab9bb9 /src/display/nr-arena-shape.h
parentImplement clipping (slightly incorrect) and masking (diff)
downloadinkscape-cf6ce8045cd7a019c263d557fd2ea6c3b8a0e669.tar.gz
inkscape-cf6ce8045cd7a019c263d557fd2ea6c3b8a0e669.zip
Text rendering. Factor out style handling into nr-style.h
(bzr r9508.1.5)
Diffstat (limited to 'src/display/nr-arena-shape.h')
-rw-r--r--src/display/nr-arena-shape.h110
1 files changed, 2 insertions, 108 deletions
diff --git a/src/display/nr-arena-shape.h b/src/display/nr-arena-shape.h
index 97001c82d..66c8bc344 100644
--- a/src/display/nr-arena-shape.h
+++ b/src/display/nr-arena-shape.h
@@ -19,88 +19,21 @@
#include <cairo.h>
#include "display/display-forward.h"
-#include "display/canvas-bpath.h"
#include "forward.h"
-#include "sp-paint-server.h"
#include "nr-arena-item.h"
-
-#include "../color.h"
-
-#include "../livarot/Shape.h"
+#include "nr-style.h"
NRType nr_arena_shape_get_type (void);
struct NRArenaShape : public NRArenaItem {
- class Paint {
- public:
- enum Type {
- NONE,
- COLOR,
- SERVER
- };
-
- Paint() : _type(NONE), _color(0), _server(NULL) {}
- Paint(Paint const &p) { _assign(p); }
- virtual ~Paint() { clear(); }
-
- Type type() const { return _type; }
- SPPaintServer *server() const { return _server; }
- SPColor const &color() const { return _color; }
-
- Paint &operator=(Paint const &p) {
- set(p);
- return *this;
- }
-
- void set(Paint const &p) {
- clear();
- _assign(p);
- }
- void set(SPColor const &color) {
- clear();
- _type = COLOR;
- _color = color;
- }
- void set(SPPaintServer *server) {
- clear();
- if (server) {
- _type = SERVER;
- _server = server;
- sp_object_ref(_server, NULL);
- }
- }
- void clear() {
- if ( _type == SERVER ) {
- sp_object_unref(_server, NULL);
- _server = NULL;
- }
- _type = NONE;
- }
-
- private:
- Type _type;
- SPColor _color;
- SPPaintServer *_server;
-
- void _assign(Paint const &p) {
- _type = p._type;
- _server = p._server;
- _color = p._color;
- if (_server) {
- sp_object_ref(_server, NULL);
- }
- }
- };
-
/* Shape data */
SPCurve *curve;
SPStyle *style;
+ NRStyle nrstyle;
NRRect paintbox;
/* State data */
Geom::Matrix ctm;
- cairo_pattern_t *fill_pattern;
- cairo_pattern_t *stroke_pattern;
cairo_path_t *path;
// delayed_shp=true means the *_shp polygons are not computed yet
@@ -123,46 +56,7 @@ struct NRArenaShape : public NRArenaItem {
return obj;
}
- void setFill(SPPaintServer *server);
- void setFill(SPColor const &color);
- void setFillOpacity(double opacity);
- void setFillRule(cairo_fill_rule_t rule);
-
- void setStroke(SPPaintServer *server);
- void setStroke(SPColor const &color);
- void setStrokeOpacity(double opacity);
- void setStrokeWidth(double width);
- void setLineCap(cairo_line_cap_t cap);
- void setLineJoin(cairo_line_join_t join);
- void setMitreLimit(double limit);
-
void setPaintBox(Geom::Rect const &pbox);
-
- void _invalidateCachedFill() {
- }
- void _invalidateCachedStroke() {
- }
-
- struct Style {
- Style() : opacity(0.0) {}
- Paint paint;
- double opacity;
- };
- struct FillStyle : public Style {
- FillStyle() : rule(CAIRO_FILL_RULE_EVEN_ODD) {}
- cairo_fill_rule_t rule;
- } _fill;
- struct StrokeStyle : public Style {
- StrokeStyle()
- : cap(CAIRO_LINE_CAP_ROUND), join(CAIRO_LINE_JOIN_ROUND),
- width(0.0), mitre_limit(0.0)
- {}
-
- cairo_line_cap_t cap;
- cairo_line_join_t join;
- double width;
- double mitre_limit;
- } _stroke;
};
struct NRArenaShapeClass {