From: buliabyak Date: Tue, 28 Mar 2006 22:34:46 +0000 (+0000) Subject: use SPKnot setter methods instead of g_object_set_property X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d35978edd763d651d996f3ddbfab20a5ffac2510;p=inkscape.git use SPKnot setter methods instead of g_object_set_property --- diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 7e23b5750..2048966b0 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -758,12 +758,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); diff --git a/src/seltrans.cpp b/src/seltrans.cpp index b41ee1d5c..a301c8158 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -441,19 +441,17 @@ void Inkscape::SelTrans::_updateHandles() // center handle if ( _chandle == NULL ) { - _chandle = sp_knot_new(_desktop); - g_object_set(G_OBJECT(_chandle), - "anchor", handle_center.anchor, - "shape", SP_CTRL_SHAPE_BITMAP, - "size", 13, - "mode", SP_CTRL_MODE_XOR, - "fill", 0x00000000, - "fill_mouseover", 0x00000000, - "stroke", 0x000000ff, - "stroke_mouseover", 0xff0000b0, - "pixbuf", handles[handle_center.control], - "tip", _("Center of rotation and skewing: drag to reposition; scaling with Shift also uses this center"), - NULL); + _chandle = sp_knot_new(_desktop, _("Center of rotation and skewing: drag to reposition; scaling with Shift also uses this center")); + + _chandle->setShape (SP_CTRL_SHAPE_BITMAP); + _chandle->setSize (13); + _chandle->setAnchor (handle_center.anchor); + _chandle->setMode (SP_CTRL_MODE_XOR); + _chandle->setFill(0x00000000, 0x00000000, 0x00000000); + _chandle->setStroke(0x000000ff, 0xff0000b0, 0xff0000b0); + _chandle->setPixbuf(handles[handle_center.control]); + sp_knot_update_ctrl(_chandle); + g_signal_connect(G_OBJECT(_chandle), "request", G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &handle_center); g_signal_connect(G_OBJECT(_chandle), "moved", @@ -528,19 +526,16 @@ void Inkscape::SelTrans::_showHandles(SPKnot *knot[], SPSelTransHandle const han for (int i = 0; i < num; i++) { if (knot[i] == NULL) { - knot[i] = sp_knot_new(_desktop); - g_object_set(G_OBJECT(knot[i]), - "anchor", handle[i].anchor, - "shape", SP_CTRL_SHAPE_BITMAP, - "size", 13, - "mode", SP_KNOT_MODE_XOR, - "fill", 0x000000ff, // inversion - "fill_mouseover", 0x00ff6600, // green - "stroke", 0x000000ff, // inversion - "stroke_mouseover", 0x000000ff, // inversion - "pixbuf", handles[handle[i].control], - "tip", i % 2 ? even_tip : odd_tip, - NULL); + knot[i] = sp_knot_new(_desktop, i % 2 ? even_tip : odd_tip); + + knot[i]->setShape (SP_CTRL_SHAPE_BITMAP); + knot[i]->setSize (13); + knot[i]->setAnchor (handle[i].anchor); + knot[i]->setMode (SP_CTRL_MODE_XOR); + knot[i]->setFill(0x000000ff, 0x00ff6600, 0x00ff6600); // inversion, green, green + knot[i]->setStroke(0x000000ff, 0x000000ff, 0x000000ff); // inversion + knot[i]->setPixbuf(handles[handle[i].control]); + sp_knot_update_ctrl(knot[i]); g_signal_connect(G_OBJECT(knot[i]), "request", G_CALLBACK(sp_sel_trans_handle_request), (gpointer) &handle[i]);