summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2018-06-21 18:18:15 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2018-06-21 18:18:15 +0000
commit74c2ed472c8e5b7070e9702fcf749bb19dadac99 (patch)
treefd617c1a35ab8f2b8add246f95ef00eac857f0b2 /src
parentMerge branch 'transf_mat_3x4' of gitlab.com:linkmauve/inkscape (diff)
parentMove global functions into SPImage methods. (diff)
downloadinkscape-74c2ed472c8e5b7070e9702fcf749bb19dadac99.tar.gz
inkscape-74c2ed472c8e5b7070e9702fcf749bb19dadac99.zip
Merge branch 'sp_print' of gitlab.com:linkmauve/inkscape
Diffstat (limited to 'src')
-rw-r--r--src/gradient-chemistry.cpp2
-rw-r--r--src/libnrtype/Layout-TNG-Output.cpp10
-rw-r--r--src/object/sp-gradient.cpp59
-rw-r--r--src/object/sp-gradient.h28
-rw-r--r--src/object/sp-image.cpp20
-rw-r--r--src/object/sp-image.h5
-rw-r--r--src/object/sp-item.cpp4
-rw-r--r--src/object/sp-root.cpp4
-rw-r--r--src/object/sp-shape.cpp8
-rw-r--r--src/object/sp-symbol.cpp4
-rw-r--r--src/object/sp-use.cpp4
-rw-r--r--src/print.cpp35
-rw-r--r--src/print.h27
-rw-r--r--src/splivarot.cpp4
-rw-r--r--src/ui/dialog/color-item.cpp2
-rw-r--r--src/ui/dialog/swatches.cpp2
-rw-r--r--src/widgets/desktop-widget.cpp2
-rw-r--r--src/widgets/gradient-image.cpp6
18 files changed, 111 insertions, 115 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 17c61d3c0..97c77d146 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -112,7 +112,7 @@ SPGradient *sp_gradient_ensure_vector_normalized(SPGradient *gr)
gr->ensureVector();
g_assert(gr->vector.built);
// this adds stops from gr->vector as children to gr
- sp_gradient_repr_write_vector (gr);
+ gr->repr_write_vector ();
}
/* If gr hrefs some other gradient, remove the href */
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index dc69934b1..7f9ee69a9 100644
--- a/src/libnrtype/Layout-TNG-Output.cpp
+++ b/src/libnrtype/Layout-TNG-Output.cpp
@@ -270,9 +270,9 @@ Geom::Affine glyph_matrix;
_getGlyphTransformMatrix(glyph_index, &glyph_matrix);
Geom::PathVector temp_pv = (*pv) * glyph_matrix;
if (!text_source->style->fill.isNone())
- sp_print_fill(ctx, temp_pv, ctm, text_source->style, pbox, dbox, bbox);
+ ctx->fill(temp_pv, ctm, text_source->style, pbox, dbox, bbox);
if (!text_source->style->stroke.isNone())
- sp_print_stroke(ctx, temp_pv, ctm, text_source->style, pbox, dbox, bbox);
+ ctx->stroke(temp_pv, ctm, text_source->style, pbox, dbox, bbox);
}
}
}
@@ -401,16 +401,16 @@ std:: cout << "DEBUG Layout::print in while --- "
}
// write it
- sp_print_bind(ctx, glyph_matrix, 1.0);
+ ctx->bind(glyph_matrix, 1.0);
// the dx array is smuggled through to the EMF driver (ignored by others) as:
// text<nul>w1 w2 w3 ...wn<nul><nul>
// where the widths are floats 7 characters wide, including the space
char *smuggle_string=smuggle_adxkyrtl_in(text_string.c_str(),ndx, &hold_dx[0], ky, rtl);
- sp_print_text(ctx, smuggle_string, g_pos, text_source->style);
+ ctx->text(smuggle_string, g_pos, text_source->style);
free(smuggle_string);
- sp_print_release(ctx);
+ ctx->release();
ndx = 0;
char_index = lc_index;
}
diff --git a/src/object/sp-gradient.cpp b/src/object/sp-gradient.cpp
index 0e3fa8e77..e36af38de 100644
--- a/src/object/sp-gradient.cpp
+++ b/src/object/sp-gradient.cpp
@@ -863,9 +863,9 @@ SPGradientUnits SPGradient::fetchUnits()
* Clears the gradient's svg:stop children from its repr.
*/
void
-sp_gradient_repr_clear_vector(SPGradient *gr)
+SPGradient::repr_clear_vector()
{
- Inkscape::XML::Node *repr = gr->getRepr();
+ Inkscape::XML::Node *repr = getRepr();
/* Collect stops from original repr */
std::vector<Inkscape::XML::Node *> l;
@@ -889,30 +889,27 @@ sp_gradient_repr_clear_vector(SPGradient *gr)
* inherited from refs) into the gradient repr as svg:stop elements.
*/
void
-sp_gradient_repr_write_vector(SPGradient *gr)
+SPGradient::repr_write_vector()
{
- g_return_if_fail(gr != nullptr);
- g_return_if_fail(SP_IS_GRADIENT(gr));
-
- Inkscape::XML::Document *xml_doc = gr->document->getReprDoc();
- Inkscape::XML::Node *repr = gr->getRepr();
+ Inkscape::XML::Document *xml_doc = document->getReprDoc();
+ Inkscape::XML::Node *repr = getRepr();
/* We have to be careful, as vector may be our own, so construct repr list at first */
std::vector<Inkscape::XML::Node *> l;
- for (guint i = 0; i < gr->vector.stops.size(); i++) {
+ for (guint i = 0; i < vector.stops.size(); i++) {
Inkscape::CSSOStringStream os;
Inkscape::XML::Node *child = xml_doc->createElement("svg:stop");
- sp_repr_set_css_double(child, "offset", gr->vector.stops[i].offset);
+ sp_repr_set_css_double(child, "offset", vector.stops[i].offset);
/* strictly speaking, offset an SVG <number> rather than a CSS one, but exponents make no
* sense for offset proportions. */
- os << "stop-color:" << gr->vector.stops[i].color.toString() << ";stop-opacity:" << gr->vector.stops[i].opacity;
+ os << "stop-color:" << vector.stops[i].color.toString() << ";stop-opacity:" << vector.stops[i].opacity;
child->setAttribute("style", os.str().c_str());
/* Order will be reversed here */
l.push_back(child);
}
- sp_gradient_repr_clear_vector(gr);
+ repr_clear_vector();
/* And insert new children from list */
for (auto i=l.rbegin();i!=l.rend();++i) {
@@ -1072,9 +1069,9 @@ void SPGradient::rebuildArray()
}
Geom::Affine
-sp_gradient_get_g2d_matrix(SPGradient const *gr, Geom::Affine const &ctm, Geom::Rect const &bbox)
+SPGradient::get_g2d_matrix(Geom::Affine const &ctm, Geom::Rect const &bbox) const
{
- if (gr->getUnits() == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
+ if (getUnits() == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
return ( Geom::Scale(bbox.dimensions())
* Geom::Translate(bbox.min())
* Geom::Affine(ctm) );
@@ -1084,31 +1081,31 @@ sp_gradient_get_g2d_matrix(SPGradient const *gr, Geom::Affine const &ctm, Geom::
}
Geom::Affine
-sp_gradient_get_gs2d_matrix(SPGradient const *gr, Geom::Affine const &ctm, Geom::Rect const &bbox)
+SPGradient::get_gs2d_matrix(Geom::Affine const &ctm, Geom::Rect const &bbox) const
{
- if (gr->getUnits() == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
- return ( gr->gradientTransform
+ if (getUnits() == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX) {
+ return ( gradientTransform
* Geom::Scale(bbox.dimensions())
* Geom::Translate(bbox.min())
* Geom::Affine(ctm) );
} else {
- return gr->gradientTransform * ctm;
+ return gradientTransform * ctm;
}
}
void
-sp_gradient_set_gs2d_matrix(SPGradient *gr, Geom::Affine const &ctm,
+SPGradient::set_gs2d_matrix(Geom::Affine const &ctm,
Geom::Rect const &bbox, Geom::Affine const &gs2d)
{
- gr->gradientTransform = gs2d * ctm.inverse();
- if (gr->getUnits() == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX ) {
- gr->gradientTransform = ( gr->gradientTransform
+ gradientTransform = gs2d * ctm.inverse();
+ if (getUnits() == SP_GRADIENT_UNITS_OBJECTBOUNDINGBOX ) {
+ gradientTransform = ( gradientTransform
* Geom::Translate(-bbox.min())
* Geom::Scale(bbox.dimensions()).inverse() );
}
- gr->gradientTransform_set = TRUE;
+ gradientTransform_set = TRUE;
- gr->requestModified(SP_OBJECT_MODIFIED_FLAG);
+ requestModified(SP_OBJECT_MODIFIED_FLAG);
}
@@ -1157,17 +1154,17 @@ sp_gradient_pattern_common_setup(cairo_pattern_t *cp,
}
cairo_pattern_t *
-sp_gradient_create_preview_pattern(SPGradient *gr, double width)
+SPGradient::create_preview_pattern(double width)
{
cairo_pattern_t *pat = nullptr;
- if (!SP_IS_MESHGRADIENT(gr)) {
- gr->ensureVector();
+ if (!SP_IS_MESHGRADIENT(this)) {
+ ensureVector();
pat = cairo_pattern_create_linear(0, 0, width, 0);
- for (std::vector<SPGradientStop>::iterator i = gr->vector.stops.begin();
- i != gr->vector.stops.end(); ++i)
+ for (std::vector<SPGradientStop>::iterator i = vector.stops.begin();
+ i != vector.stops.end(); ++i)
{
cairo_pattern_add_color_stop_rgba(pat, i->offset,
i->color.v.c[0], i->color.v.c[1], i->color.v.c[2], i->opacity);
@@ -1175,14 +1172,14 @@ sp_gradient_create_preview_pattern(SPGradient *gr, double width)
} else {
// For the moment, use the top row of nodes for preview.
- unsigned columns = gr->array.patch_columns();
+ unsigned columns = array.patch_columns();
double offset = 1.0/double(columns);
pat = cairo_pattern_create_linear(0, 0, width, 0);
for (unsigned i = 0; i < columns+1; ++i) {
- SPMeshNode* node = gr->array.node( 0, i*3 );
+ SPMeshNode* node = array.node( 0, i*3 );
cairo_pattern_add_color_stop_rgba(pat, i*offset,
node->color.v.c[0], node->color.v.c[1], node->color.v.c[2], node->opacity);
}
diff --git a/src/object/sp-gradient.h b/src/object/sp-gradient.h
index 5d644925a..e03937c5b 100644
--- a/src/object/sp-gradient.h
+++ b/src/object/sp-gradient.h
@@ -185,6 +185,20 @@ public:
static void gradientRefModified(SPObject *href, unsigned int flags, SPGradient *gradient);
static void gradientRefChanged(SPObject *old_ref, SPObject *ref, SPGradient *gr);
+ /* Gradient repr methods */
+ void repr_write_vector();
+ void repr_clear_vector();
+
+ cairo_pattern_t *create_preview_pattern(double width);
+
+ /** Transforms to/from gradient position space in given environment */
+ Geom::Affine get_g2d_matrix(Geom::Affine const &ctm,
+ Geom::Rect const &bbox) const;
+ Geom::Affine get_gs2d_matrix(Geom::Affine const &ctm,
+ Geom::Rect const &bbox) const;
+ void set_gs2d_matrix(Geom::Affine const &ctm, Geom::Rect const &bbox,
+ Geom::Affine const &gs2d);
+
private:
bool invalidateVector();
bool invalidateArray();
@@ -209,20 +223,6 @@ sp_gradient_pattern_common_setup(cairo_pattern_t *cp,
Geom::OptRect const &bbox,
double opacity);
-/* Gradient repr methods */
-void sp_gradient_repr_write_vector(SPGradient *gr);
-void sp_gradient_repr_clear_vector(SPGradient *gr);
-
-cairo_pattern_t *sp_gradient_create_preview_pattern(SPGradient *gradient, double width);
-
-/** Transforms to/from gradient position space in given environment */
-Geom::Affine sp_gradient_get_g2d_matrix(SPGradient const *gr, Geom::Affine const &ctm,
- Geom::Rect const &bbox);
-Geom::Affine sp_gradient_get_gs2d_matrix(SPGradient const *gr, Geom::Affine const &ctm,
- Geom::Rect const &bbox);
-void sp_gradient_set_gs2d_matrix(SPGradient *gr, Geom::Affine const &ctm, Geom::Rect const &bbox,
- Geom::Affine const &gs2d);
-
#endif // SEEN_SP_GRADIENT_H
diff --git a/src/object/sp-image.cpp b/src/object/sp-image.cpp
index cdbe0ef4a..a5bc115ce 100644
--- a/src/object/sp-image.cpp
+++ b/src/object/sp-image.cpp
@@ -479,7 +479,7 @@ void SPImage::print(SPPrintContext *ctx) {
Geom::Translate tp(vx, vy);
Geom::Scale s(this->sx, this->sy);
t = s * tp;
- sp_print_image_R8G8B8A8_N(ctx, px, w, h, rs, t, this->style);
+ ctx->image_R8G8B8A8_N(px, w, h, rs, t, this->style);
delete pb;
}
}
@@ -735,11 +735,11 @@ static void sp_image_set_curve( SPImage *image )
/**
* Return duplicate of curve (if any exists) or NULL if there is no curve
*/
-SPCurve *sp_image_get_curve( SPImage *image )
+SPCurve *SPImage::get_curve() const
{
SPCurve *result = nullptr;
- if (image->curve) {
- result = image->curve->copy();
+ if (curve) {
+ result = curve->copy();
}
return result;
}
@@ -841,21 +841,21 @@ void sp_embed_svg(Inkscape::XML::Node *image_node, std::string const &fn)
}
}
-void sp_image_refresh_if_outdated( SPImage* image )
+void SPImage::refresh_if_outdated()
{
- if ( image->href && image->pixbuf && image->pixbuf->modificationTime()) {
+ if ( href && pixbuf && pixbuf->modificationTime()) {
// It *might* change
GStatBuf st;
memset(&st, 0, sizeof(st));
int val = 0;
- if (g_file_test (image->pixbuf->originalPath().c_str(), G_FILE_TEST_EXISTS)){
- val = g_stat(image->pixbuf->originalPath().c_str(), &st);
+ if (g_file_test (pixbuf->originalPath().c_str(), G_FILE_TEST_EXISTS)){
+ val = g_stat(pixbuf->originalPath().c_str(), &st);
}
if ( !val ) {
// stat call worked. Check time now
- if ( st.st_mtime != image->pixbuf->modificationTime() ) {
- image->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_IMAGE_HREF_MODIFIED_FLAG);
+ if ( st.st_mtime != pixbuf->modificationTime() ) {
+ requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_IMAGE_HREF_MODIFIED_FLAG);
}
}
}
diff --git a/src/object/sp-image.h b/src/object/sp-image.h
index 04e1df7fa..464d0f144 100644
--- a/src/object/sp-image.h
+++ b/src/object/sp-image.h
@@ -63,12 +63,13 @@ public:
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
void apply_profile(Inkscape::Pixbuf *pixbuf);
#endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
+
+ SPCurve *get_curve () const;
+ void refresh_if_outdated();
};
/* Return duplicate of curve or NULL */
-SPCurve *sp_image_get_curve (SPImage *image);
void sp_embed_image(Inkscape::XML::Node *imgnode, Inkscape::Pixbuf *pb);
void sp_embed_svg(Inkscape::XML::Node *image_node, std::string const &fn);
-void sp_image_refresh_if_outdated( SPImage* image );
#endif
diff --git a/src/object/sp-item.cpp b/src/object/sp-item.cpp
index 286886a1a..ec92c655f 100644
--- a/src/object/sp-item.cpp
+++ b/src/object/sp-item.cpp
@@ -1023,9 +1023,9 @@ void SPItem::invoke_print(SPPrintContext *ctx)
{
if ( !isHidden() ) {
if (!transform.isIdentity() || style->opacity.value != SP_SCALE24_MAX) {
- sp_print_bind(ctx, transform, SP_SCALE24_TO_FLOAT(style->opacity.value));
+ ctx->bind(transform, SP_SCALE24_TO_FLOAT(style->opacity.value));
this->print(ctx);
- sp_print_release(ctx);
+ ctx->release();
} else {
this->print(ctx);
}
diff --git a/src/object/sp-root.cpp b/src/object/sp-root.cpp
index 592aae443..6ebccef3c 100644
--- a/src/object/sp-root.cpp
+++ b/src/object/sp-root.cpp
@@ -369,11 +369,11 @@ Inkscape::DrawingItem *SPRoot::show(Inkscape::Drawing &drawing, unsigned int key
void SPRoot::print(SPPrintContext *ctx)
{
- sp_print_bind(ctx, this->c2p, 1.0);
+ ctx->bind(this->c2p, 1.0);
SPGroup::print(ctx);
- sp_print_release(ctx);
+ ctx->release();
}
const char *SPRoot::displayName() const {
diff --git a/src/object/sp-shape.cpp b/src/object/sp-shape.cpp
index 1f4572428..d3fce702e 100644
--- a/src/object/sp-shape.cpp
+++ b/src/object/sp-shape.cpp
@@ -641,7 +641,7 @@ void SPShape::print(SPPrintContext* ctx) {
if (add_comments) {
gchar * comment = g_strdup_printf("begin '%s'", this->defaultLabel());
- sp_print_comment(ctx, comment);
+ ctx->comment(comment);
g_free(comment);
}
@@ -656,11 +656,11 @@ void SPShape::print(SPPrintContext* ctx) {
SPStyle* style = this->style;
if (!style->fill.isNone()) {
- sp_print_fill (ctx, pathv, i2dt, style, pbox, dbox, bbox);
+ ctx->fill (pathv, i2dt, style, pbox, dbox, bbox);
}
if (!style->stroke.isNone()) {
- sp_print_stroke (ctx, pathv, i2dt, style, pbox, dbox, bbox);
+ ctx->stroke (pathv, i2dt, style, pbox, dbox, bbox);
}
/** \todo make code prettier */
@@ -737,7 +737,7 @@ void SPShape::print(SPPrintContext* ctx) {
if (add_comments) {
gchar * comment = g_strdup_printf("end '%s'",
this->defaultLabel());
- sp_print_comment(ctx, comment);
+ ctx->comment(comment);
g_free(comment);
}
}
diff --git a/src/object/sp-symbol.cpp b/src/object/sp-symbol.cpp
index d3a06a60b..feb3ed097 100644
--- a/src/object/sp-symbol.cpp
+++ b/src/object/sp-symbol.cpp
@@ -148,11 +148,11 @@ void SPSymbol::print(SPPrintContext* ctx) {
if (this->cloned) {
// Cloned <symbol> is actually renderable
- sp_print_bind(ctx, this->c2p, 1.0);
+ ctx->bind(this->c2p, 1.0);
SPGroup::print(ctx);
- sp_print_release (ctx);
+ ctx->release ();
}
}
diff --git a/src/object/sp-use.cpp b/src/object/sp-use.cpp
index 6ee4be4b2..a73a731f8 100644
--- a/src/object/sp-use.cpp
+++ b/src/object/sp-use.cpp
@@ -216,7 +216,7 @@ void SPUse::print(SPPrintContext* ctx) {
if ((this->x._set && this->x.computed != 0) || (this->y._set && this->y.computed != 0)) {
Geom::Affine tp(Geom::Translate(this->x.computed, this->y.computed));
- sp_print_bind(ctx, tp, 1.0);
+ ctx->bind(tp, 1.0);
translated = true;
}
@@ -225,7 +225,7 @@ void SPUse::print(SPPrintContext* ctx) {
}
if (translated) {
- sp_print_release(ctx);
+ ctx->release();
}
}
diff --git a/src/print.cpp b/src/print.cpp
index efdfe392b..f455623ae 100644
--- a/src/print.cpp
+++ b/src/print.cpp
@@ -34,49 +34,48 @@
unsigned int
-sp_print_bind(SPPrintContext *ctx, Geom::Affine const &transform, float opacity)
+SPPrintContext::bind(Geom::Affine const &transform, float opacity)
{
- return ctx->module->bind(transform, opacity);
+ return module->bind(transform, opacity);
}
unsigned int
-sp_print_release(SPPrintContext *ctx)
+SPPrintContext::release()
{
- return ctx->module->release();
+ return module->release();
}
unsigned int
-sp_print_comment(SPPrintContext *ctx, char const *comment)
+SPPrintContext::comment(char const *comment)
{
- return ctx->module->comment(comment);
+ return module->comment(comment);
}
unsigned int
-sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style,
- Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox)
+SPPrintContext::fill(Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style,
+ Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox)
{
- return ctx->module->fill(pathv, ctm, style, pbox, dbox, bbox);
+ return module->fill(pathv, ctm, style, pbox, dbox, bbox);
}
unsigned int
-sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style,
- Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox)
+SPPrintContext::stroke(Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style,
+ Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox)
{
- return ctx->module->stroke(pathv, ctm, style, pbox, dbox, bbox);
+ return module->stroke(pathv, ctm, style, pbox, dbox, bbox);
}
unsigned int
-sp_print_image_R8G8B8A8_N(SPPrintContext *ctx,
- guchar *px, unsigned int w, unsigned int h, unsigned int rs,
- Geom::Affine const &transform, SPStyle const *style)
+SPPrintContext::image_R8G8B8A8_N(guchar *px, unsigned int w, unsigned int h, unsigned int rs,
+ Geom::Affine const &transform, SPStyle const *style)
{
- return ctx->module->image(px, w, h, rs, transform, style);
+ return module->image(px, w, h, rs, transform, style);
}
-unsigned int sp_print_text(SPPrintContext *ctx, char const *text, Geom::Point p,
+unsigned int SPPrintContext::text(char const *text, Geom::Point p,
SPStyle const *style)
{
- return ctx->module->text(text, p, style);
+ return module->text(text, p, style);
}
/* UI */
diff --git a/src/print.h b/src/print.h
index ab2bcc0a7..a952672b7 100644
--- a/src/print.h
+++ b/src/print.h
@@ -30,24 +30,23 @@ class Print;
struct SPPrintContext {
Inkscape::Extension::Print *module;
-};
-unsigned int sp_print_bind(SPPrintContext *ctx, Geom::Affine const &transform, float opacity);
-unsigned int sp_print_release(SPPrintContext *ctx);
-unsigned int sp_print_comment(SPPrintContext *ctx, char const *comment);
-unsigned int sp_print_fill(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style,
- Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox);
-unsigned int sp_print_stroke(SPPrintContext *ctx, Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style,
- Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox);
+ unsigned int bind(Geom::Affine const &transform, float opacity);
+ unsigned int release();
+ unsigned int comment(char const *comment);
+ unsigned int fill(Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style,
+ Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox);
+ unsigned int stroke(Geom::PathVector const &pathv, Geom::Affine const &ctm, SPStyle const *style,
+ Geom::OptRect const &pbox, Geom::OptRect const &dbox, Geom::OptRect const &bbox);
-unsigned int sp_print_image_R8G8B8A8_N(SPPrintContext *ctx,
- unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
- Geom::Affine const &transform, SPStyle const *style);
+ unsigned int image_R8G8B8A8_N(unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
+ Geom::Affine const &transform, SPStyle const *style);
-unsigned int sp_print_text(SPPrintContext *ctx, char const *text, Geom::Point p,
- SPStyle const *style);
+ unsigned int text(char const *text, Geom::Point p,
+ SPStyle const *style);
-void sp_print_get_param(SPPrintContext *ctx, char *name, bool *value);
+ void get_param(char *name, bool *value);
+};
/* UI */
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index 7a3971994..081e10da2 100644
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
@@ -2559,7 +2559,7 @@ SPCurve* curve_for_item(SPItem *item)
}
else if (SP_IS_IMAGE(item))
{
- curve = sp_image_get_curve(SP_IMAGE(item));
+ curve = SP_IMAGE(item)->get_curve();
}
return curve; // do not forget to unref the curve at some point!
@@ -2584,7 +2584,7 @@ SPCurve* curve_for_item_before_LPE(SPItem *item)
}
else if (SP_IS_IMAGE(item))
{
- curve = sp_image_get_curve(SP_IMAGE(item));
+ curve = SP_IMAGE(item)->get_curve();
}
return curve; // do not forget to unref the curve at some point!
diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp
index 61709f791..53f0d4c34 100644
--- a/src/ui/dialog/color-item.cpp
+++ b/src/ui/dialog/color-item.cpp
@@ -215,7 +215,7 @@ static void colorItemDragBegin( GtkWidget */*widget*/, GdkDragContext* dc, gpoin
GdkPixbuf* pixbuf = nullptr;
if ( item->getGradient() ){
cairo_surface_t *s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
- cairo_pattern_t *gradient = sp_gradient_create_preview_pattern(item->getGradient(), width);
+ cairo_pattern_t *gradient = item->getGradient()->create_preview_pattern(width);
cairo_t *ct = cairo_create(s);
cairo_set_source(ct, gradient);
cairo_paint(ct);
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp
index 8dc982b82..0eef5ecc3 100644
--- a/src/ui/dialog/swatches.cpp
+++ b/src/ui/dialog/swatches.cpp
@@ -1207,7 +1207,7 @@ static void recalcSwatchContents(SPDocument* doc,
ColorItem* item = new ColorItem( 0, 0, 0, name );
cairo_pattern_t *check = ink_cairo_pattern_create_checkerboard();
- cairo_pattern_t *gradient = sp_gradient_create_preview_pattern(grad, PREVIEW_PIXBUF_WIDTH);
+ cairo_pattern_t *gradient = grad->create_preview_pattern(PREVIEW_PIXBUF_WIDTH);
cairo_set_source(ct, check);
cairo_paint(ct);
cairo_set_source(ct, gradient);
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index e70578e90..d0b6af9a0 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -1796,7 +1796,7 @@ bool SPDesktopWidget::onFocusInEvent(GdkEventFocus*)
std::vector<SPObject *> imageList = (desktop->doc())->getResourceList("image");
for (std::vector<SPObject *>::const_iterator it = imageList.begin(); it != imageList.end(); ++it) {
SPImage* image = SP_IMAGE(*it);
- sp_image_refresh_if_outdated( image );
+ image->refresh_if_outdated();
}
}
diff --git a/src/widgets/gradient-image.cpp b/src/widgets/gradient-image.cpp
index aae0cc063..1dfc11795 100644
--- a/src/widgets/gradient-image.cpp
+++ b/src/widgets/gradient-image.cpp
@@ -113,7 +113,7 @@ static gboolean sp_gradient_image_draw(GtkWidget *widget, cairo_t *ct)
cairo_pattern_destroy(check);
if (gr) {
- cairo_pattern_t *p = sp_gradient_create_preview_pattern(gr, allocation.width);
+ cairo_pattern_t *p = gr->create_preview_pattern(allocation.width);
cairo_set_source(ct, p);
cairo_paint(ct);
cairo_pattern_destroy(p);
@@ -144,7 +144,7 @@ sp_gradient_to_pixbuf (SPGradient *gr, int width, int height)
cairo_pattern_destroy(check);
if (gr) {
- cairo_pattern_t *p = sp_gradient_create_preview_pattern(gr, width);
+ cairo_pattern_t *p = gr->create_preview_pattern(width);
cairo_set_source(ct, p);
cairo_paint(ct);
cairo_pattern_destroy(p);
@@ -171,7 +171,7 @@ sp_gradient_to_pixbuf_ref (SPGradient *gr, int width, int height)
cairo_pattern_destroy(check);
if (gr) {
- cairo_pattern_t *p = sp_gradient_create_preview_pattern(gr, width);
+ cairo_pattern_t *p = gr->create_preview_pattern(width);
cairo_set_source(ct, p);
cairo_paint(ct);
cairo_pattern_destroy(p);