X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fgradient-drag.cpp;h=cb61a9890e044440e7e1a4b4e97595d1e923f9fa;hb=c2163b544f441fdd51e80da77f1bc63d21703724;hp=7e23b5750ec2e98e995733fc9ee3727ac9e7fd9e;hpb=f951374eef04129c6a0d213e7ab4d9ed2095ca69;p=inkscape.git diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 7e23b5750..cb61a9890 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -223,7 +223,7 @@ GrDrag::GrDrag(SPDesktop *desktop) { this->desktop = desktop; - this->selection = SP_DT_SELECTION(desktop); + this->selection = sp_desktop_selection(desktop); this->draggers = NULL; this->lines = NULL; @@ -378,7 +378,7 @@ gr_knot_moved_handler(SPKnot *knot, NR::Point const *ppointer, guint state, gpoi d_new->updateKnotShape (); d_new->updateTip (); d_new->updateDependencies(true); - sp_document_done (SP_DT_DOCUMENT (d_new->parent->desktop)); + sp_document_done (sp_desktop_document (d_new->parent->desktop)); return; } } @@ -509,7 +509,7 @@ gr_knot_ungrabbed_handler (SPKnot *knot, unsigned int state, gpointer data) dragger->updateDependencies(true); // we did an undoable action - sp_document_done (SP_DT_DOCUMENT (dragger->parent->desktop)); + sp_document_done (sp_desktop_document (dragger->parent->desktop)); } /** @@ -656,8 +656,11 @@ GrDragger::updateTip () } else if (g_slist_length (draggables) == 2 && isA (POINT_RG_CENTER) && isA (POINT_RG_FOCUS)) { this->knot->tip = g_strdup_printf (_("Radial gradient center and focus; drag with Shift to separate focus")); } else { - this->knot->tip = g_strdup_printf (_("Gradient point shared by %d gradients; drag with Shift to separate"), - g_slist_length (this->draggables)); + int length = g_slist_length (this->draggables); + this->knot->tip = g_strdup_printf (ngettext("Gradient point shared by %d gradient; drag with Shift to separate", + "Gradient point shared by %d gradients; drag with Shift to separate", + length), + length); } } @@ -758,12 +761,10 @@ GrDragger::GrDragger (GrDrag *parent, NR::Point p, GrDraggable *draggable) // create the knot this->knot = sp_knot_new (parent->desktop, NULL); - g_object_set (G_OBJECT (this->knot->item), "mode", SP_KNOT_MODE_XOR, NULL); - this->knot->fill [SP_KNOT_STATE_NORMAL] = GR_KNOT_COLOR_NORMAL; - this->knot->stroke [SP_KNOT_STATE_NORMAL] = 0x000000ff; - this->knot->stroke [SP_KNOT_STATE_DRAGGING] = 0x000000ff; - this->knot->stroke [SP_KNOT_STATE_MOUSEOVER] = 0x000000ff; - g_object_set (G_OBJECT (this->knot->item), "stroke_color", 0x000000ff, NULL); + this->knot->setMode(SP_KNOT_MODE_XOR); + this->knot->setFill(GR_KNOT_COLOR_NORMAL, GR_KNOT_COLOR_NORMAL, GR_KNOT_COLOR_NORMAL); + this->knot->setStroke(0x000000ff, 0x000000ff, 0x000000ff); + sp_knot_update_ctrl(this->knot); // move knot to the given point sp_knot_set_position (this->knot, &p, SP_KNOT_STATE_NORMAL); @@ -852,7 +853,7 @@ Create a line from p1 to p2 and add it to the lines list void GrDrag::addLine (NR::Point p1, NR::Point p2, guint32 rgba) { - SPCanvasItem *line = sp_canvas_item_new(SP_DT_CONTROLS(this->desktop), + SPCanvasItem *line = sp_canvas_item_new(sp_desktop_controls(this->desktop), SP_TYPE_CTRLLINE, NULL); sp_ctrlline_set_coords(SP_CTRLLINE(line), p1, p2); if (rgba != GR_LINE_COLOR_FILL) // fill is the default, so don't set color for it to speed up redraw @@ -1060,7 +1061,7 @@ GrDrag::selected_move (double x, double y) selected->updateDependencies(true); // we did an undoable action - sp_document_done (SP_DT_DOCUMENT (desktop)); + sp_document_done (sp_desktop_document (desktop)); } void