diff options
| author | Martin Owens <doctormo@gmail.com> | 2014-03-27 01:33:44 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2014-03-27 01:33:44 +0000 |
| commit | 5a4fb2325f60d292b47330f540b26a3279341c90 (patch) | |
| tree | d2aa7967be25450b83e625025366c618101ae49f /src/sp-paint-server.cpp | |
| parent | The Polar Arrange Tab of the Arrange Dialog now hides the parametric (diff) | |
| parent | Remove Snap menu item and improve grid menu item text (diff) | |
| download | inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.tar.gz inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.zip | |
Commit a merge to trunk, with probabal errors
(bzr r11073.1.36)
Diffstat (limited to 'src/sp-paint-server.cpp')
| -rw-r--r-- | src/sp-paint-server.cpp | 68 |
1 files changed, 7 insertions, 61 deletions
diff --git a/src/sp-paint-server.cpp b/src/sp-paint-server.cpp index ae4a60ba6..692265bd8 100644 --- a/src/sp-paint-server.cpp +++ b/src/sp-paint-server.cpp @@ -20,12 +20,6 @@ #include "sp-gradient.h" #include "xml/node.h" -static void sp_paint_server_class_init(SPPaintServerClass *psc); - -static cairo_pattern_t *sp_paint_server_create_dummy_pattern(SPPaintServer *ps, cairo_t *ct, Geom::OptRect const &bbox, double opacity); - -static SPObjectClass *parent_class; - SPPaintServer *SPPaintServerReference::getObject() const { return static_cast<SPPaintServer *>(URIReference::getObject()); @@ -36,63 +30,11 @@ bool SPPaintServerReference::_acceptObject(SPObject *obj) const return SP_IS_PAINT_SERVER(obj); } -GType SPPaintServer::get_type(void) -{ - static GType type = 0; - if (!type) { - GTypeInfo info = { - sizeof(SPPaintServerClass), - NULL, /* base_init */ - NULL, /* base_finalize */ - (GClassInitFunc) sp_paint_server_class_init, - NULL, /* class_finalize */ - NULL, /* class_data */ - sizeof(SPPaintServer), - 16, /* n_preallocs */ - (GInstanceInitFunc) SPPaintServer::init, - NULL, /* value_table */ - }; - type = g_type_register_static(SP_TYPE_OBJECT, "SPPaintServer", &info, (GTypeFlags) 0); - } - return type; -} - -static void sp_paint_server_class_init(SPPaintServerClass *psc) -{ - psc->pattern_new = sp_paint_server_create_dummy_pattern; - - parent_class = static_cast<SPObjectClass *>(g_type_class_ref(SP_TYPE_OBJECT)); -} - -void SPPaintServer::init(SPPaintServer * /*ps*/) -{ -} - -cairo_pattern_t *sp_paint_server_create_pattern(SPPaintServer *ps, - cairo_t *ct, - Geom::OptRect const &bbox, - double opacity) -{ - g_return_val_if_fail(ps != NULL, NULL); - g_return_val_if_fail(SP_IS_PAINT_SERVER(ps), NULL); - - cairo_pattern_t *cp = NULL; - SPPaintServerClass *psc = (SPPaintServerClass *) G_OBJECT_GET_CLASS(ps); - if ( psc->pattern_new ) { - cp = (*psc->pattern_new)(ps, ct, bbox, opacity); - } - - return cp; +SPPaintServer::SPPaintServer() : SPObject() { + this->swatch = 0; } -static cairo_pattern_t * -sp_paint_server_create_dummy_pattern(SPPaintServer */*ps*/, - cairo_t */* ct */, - Geom::OptRect const &/*bbox*/, - double /* opacity */) -{ - cairo_pattern_t *cp = cairo_pattern_create_rgb(1.0, 0.0, 1.0); - return cp; +SPPaintServer::~SPPaintServer() { } bool SPPaintServer::isSwatch() const @@ -100,6 +42,10 @@ bool SPPaintServer::isSwatch() const return swatch; } + +// TODO: So a solid brush is a gradient with a swatch and zero stops? +// Should we derive a new class for that? Or at least make this method +// virtual and move it out of the way? bool SPPaintServer::isSolid() const { bool solid = false; |
