summaryrefslogtreecommitdiffstats
path: root/src/gradient-chemistry.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-18 18:07:14 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-18 18:07:14 +0000
commite77956b4dbd029c9f6949f81fe083606f995c624 (patch)
tree74adda4df8986d65f70efb341c6235277361fd35 /src/gradient-chemistry.cpp
parentupdated code to work on 0.92 code (diff)
parentLatvian translation update (diff)
downloadinkscape-e77956b4dbd029c9f6949f81fe083606f995c624.tar.gz
inkscape-e77956b4dbd029c9f6949f81fe083606f995c624.zip
update to trunk
(bzr r12588.1.39)
Diffstat (limited to 'src/gradient-chemistry.cpp')
-rw-r--r--src/gradient-chemistry.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 27f4d7a98..aecf1aa35 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -31,7 +31,7 @@
#include "document-undo.h"
#include "desktop.h"
#include "desktop-style.h"
-#include "desktop-handles.h"
+
#include "ui/tools/tool-base.h"
#include "selection.h"
#include "verbs.h"
@@ -41,7 +41,7 @@
#include "sp-gradient-vector.h"
#include "sp-linear-gradient.h"
#include "sp-radial-gradient.h"
-#include "sp-mesh-gradient.h"
+#include "sp-mesh.h"
#include "sp-stop.h"
#include "gradient-drag.h"
#include "gradient-chemistry.h"
@@ -151,7 +151,7 @@ static SPGradient *sp_gradient_get_private_normalized(SPDocument *document, SPGr
repr = xml_doc->createElement("svg:radialGradient");
} else {
// Rows/patches added in sp_gradient_reset_to_userspace for new meshes.
- repr = xml_doc->createElement("svg:meshGradient");
+ repr = xml_doc->createElement("svg:mesh");
}
// privates are garbage-collectable
@@ -413,7 +413,7 @@ SPGradient *sp_gradient_reset_to_userspace(SPGradient *gr, SPItem *item)
// IN SPMeshNodeArray::create()
//sp_repr_set_svg_double(repr, "x", bbox->min()[Geom::X]);
//sp_repr_set_svg_double(repr, "y", bbox->min()[Geom::Y]);
- SPMeshGradient* mg = SP_MESHGRADIENT( gr );
+ SPMesh* mg = SP_MESH( gr );
mg->array.create( mg, item, bbox );
}
@@ -758,10 +758,10 @@ guint32 sp_item_gradient_stop_query_style(SPItem *item, GrPointType point_type,
break;
}
return 0;
- } else if (SP_IS_MESHGRADIENT(gradient)) {
+ } else if (SP_IS_MESH(gradient)) {
// Mesh gradient
- SPMeshGradient *mg = SP_MESHGRADIENT(gradient);
+ SPMesh *mg = SP_MESH(gradient);
switch (point_type) {
case POINT_MG_CORNER: {
@@ -859,7 +859,7 @@ void sp_item_gradient_stop_set_style(SPItem *item, GrPointType point_type, guint
} else {
// Mesh gradient
- SPMeshGradient *mg = SP_MESHGRADIENT(gradient);
+ SPMesh *mg = SP_MESH(gradient);
bool changed = false;
switch (point_type) {
@@ -868,9 +868,8 @@ void sp_item_gradient_stop_set_style(SPItem *item, GrPointType point_type, guint
gchar const* color_str = sp_repr_css_property( stop, "stop-color", NULL );
if( color_str ) {
SPColor color( 0 );
- SPStyle* style = sp_style_new(0);
SPIPaint paint;
- paint.read( color_str, *style );
+ paint.read( color_str );
if( paint.isColor() ) {
color = paint.value.color;
}
@@ -1210,8 +1209,8 @@ void sp_item_gradient_set_coords(SPItem *item, GrPointType point_type, guint poi
gradient->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
}
- } else if (SP_IS_MESHGRADIENT(gradient)) {
- SPMeshGradient *mg = SP_MESHGRADIENT(gradient);
+ } else if (SP_IS_MESH(gradient)) {
+ SPMesh *mg = SP_MESH(gradient);
//Geom::Affine new_transform;
//bool transform_set = false;
@@ -1241,7 +1240,7 @@ void sp_item_gradient_set_coords(SPItem *item, GrPointType point_type, guint poi
}
if( write_repr ) {
//std::cout << "Write mesh repr" << std::endl;
- sp_meshgradient_repr_write( mg );
+ sp_mesh_repr_write( mg );
}
}
@@ -1347,8 +1346,8 @@ Geom::Point getGradientCoords(SPItem *item, GrPointType point_type, guint point_
g_warning( "Bad radial gradient handle type" );
break;
}
- } else if (SP_IS_MESHGRADIENT(gradient)) {
- SPMeshGradient *mg = SP_MESHGRADIENT(gradient);
+ } else if (SP_IS_MESH(gradient)) {
+ SPMesh *mg = SP_MESH(gradient);
switch (point_type) {
case POINT_MG_CORNER:
@@ -1569,20 +1568,20 @@ SPGradient *sp_gradient_vector_for_object( SPDocument *const doc, SPDesktop *con
void sp_gradient_invert_selected_gradients(SPDesktop *desktop, Inkscape::PaintTarget fill_or_stroke)
{
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
for (GSList const* i = selection->itemList(); i != NULL; i = i->next) {
sp_item_gradient_invert_vector_color(SP_ITEM(i->data), fill_or_stroke);
}
// we did an undoable action
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_GRADIENT,
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_GRADIENT,
_("Invert gradient colors"));
}
void sp_gradient_reverse_selected_gradients(SPDesktop *desktop)
{
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
Inkscape::UI::Tools::ToolBase *ev = desktop->getEventContext();
if (!ev) {
@@ -1602,7 +1601,7 @@ void sp_gradient_reverse_selected_gradients(SPDesktop *desktop)
}
// we did an undoable action
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_GRADIENT,
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_GRADIENT,
_("Reverse gradient"));
}