summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 094dc7c)
raw | patch | inline | side by side (parent: 094dc7c)
author | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | |
Wed, 14 Jul 2010 18:10:35 +0000 (23:40 +0530) | ||
committer | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | |
Wed, 14 Jul 2010 18:10:35 +0000 (23:40 +0530) |
30 files changed:
diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp
index 354fa1234213c7191d023702b460d170416bfe74..e48f7e17d044e46d571e57b10fb92fc97322c430 100644 (file)
--- a/src/box3d-context.cpp
+++ b/src/box3d-context.cpp
@@ -573,7 +573,8 @@ static gint sp_box3d_context_root_handler(SPEventContext *event_context, GdkEven
static void sp_box3d_drag(Box3DContext &bc, guint /*state*/)
{
- SPDesktop *desktop = SP_EVENT_CONTEXT(&bc)->desktop;
+ //SPDesktop *desktop = SP_EVENT_CONTEXT(&bc)->desktop;
+ SPDesktop *desktop = bc.desktop;
if (!bc.item) {
}
/* Create object */
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&bc));
+
+ /* Remove convoluted code. */
+ //Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&bc));
+
+ /*To be removed for directly accessing the XML Document*/
+ Inkscape::XML::Document *xml_doc = desktop->doc()->rdoc;
Inkscape::XML::Node *repr = xml_doc->createElement("svg:g");
repr->setAttribute("sodipodi:type", "inkscape:box3d");
repr_side->setAttribute("sodipodi:type", "inkscape:box3dside");
repr->addChild(repr_side, NULL);
- Box3DSide *side = SP_BOX3D_SIDE(inkscape_active_document()->getObjectByRepr (repr_side));
+ //Box3DSide *side = SP_BOX3D_SIDE(inkscape_active_document()->getObjectByRepr (repr_side));
+ Box3DSide *side = SP_BOX3D_SIDE(desktop->doc()->getObjectByRepr(repr_side));
guint desc = Box3D::int_to_face(i);
side->front_or_rear = (Box3D::FrontOrRear) (desc & 0x8);
/* Set style */
- box3d_side_apply_style(side);
+ /* Removed the faulty usage */
+ //box3d_side_apply_style(side);
+
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+
+ Glib::ustring descr = "/desktop/";
+ descr += box3d_side_axes_string(side);
+ descr += "/style";
+ Glib::ustring cur_style = prefs->getString(descr);
+
+ bool use_current = prefs->getBool("/tools/shapes/3dbox/usecurrent", false);
+ if (use_current && !cur_style.empty()) {
+ // use last used style
+ side->setAttribute("style", cur_style.data());
+
+ } else {
+ // use default style
+ GString *pstring = g_string_new("");
+ g_string_printf (pstring, "/tools/shapes/3dbox/%s", box3d_side_axes_string(side));
+ sp_desktop_apply_style_tool (desktop, side->getRepr(), pstring->str, false);
+ }
+
SP_OBJECT(side)->updateRepr(); // calls box3d_side_write() and updates, e.g., the axes string description
}
diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp
index be6d47db736e205109651a2f317c977fbb5bdd4d..9059e97056a1526ef9e48bb23c8dc5527cd2ca8e 100644 (file)
--- a/src/box3d-side.cpp
+++ b/src/box3d-side.cpp
@@ -117,7 +117,7 @@ box3d_side_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::
sp_repr_set_int(repr, "inkscape:box3dsidetype", side->dir1 ^ side->dir2 ^ side->front_or_rear);
}
- sp_shape_set_shape ((SPShape *) object);
+ ((SPShape *) object)->setShape ();
/* Duplicate the path */
SPCurve const *curve = ((SPShape *) object)->curve;
if (flags & (SP_OBJECT_MODIFIED_FLAG |
SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
- sp_shape_set_shape ((SPShape *) object);
+ ((SPShape *) object)->setShape ();
}
if (((SPObjectClass *) parent_class)->update)
/* Reset the shape'scurve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
- sp_shape_set_curve_insync (shape, c, TRUE);
+ shape->setCurveInsync( c, TRUE);
if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) {
SPCurve *c_lpe = c->copy();
bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe);
if (success) {
- sp_shape_set_curve_insync (shape, c_lpe, TRUE);
+ shape->setCurveInsync( c_lpe, TRUE);
}
c_lpe->unref();
}
c->unref();
}
-void
+/* removed to be merged into box3d-context function sp_box3d_drag
+ * so as to remove the faulty mehcanism of accessing a parent's/base
+ * level class members from a derived subclass.
+ */
+
+/*void
box3d_side_apply_style (Box3DSide *side) {
Inkscape::XML::Node *repr_face = SP_OBJECT_REPR(SP_OBJECT(side));
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
SPDesktop *desktop = inkscape_active_desktop();
bool use_current = prefs->getBool("/tools/shapes/3dbox/usecurrent", false);
if (use_current && !cur_style.empty()) {
- /* use last used style */
+ // use last used style
repr_face->setAttribute("style", cur_style.data());
} else {
- /* use default style */
+ // use default style
GString *pstring = g_string_new("");
g_string_printf (pstring, "/tools/shapes/3dbox/%s", box3d_side_axes_string(side));
sp_desktop_apply_style_tool (desktop, repr_face, pstring->str, false);
}
-}
+}*/
gchar *
box3d_side_axes_string(Box3DSide *side)
diff --git a/src/box3d-side.h b/src/box3d-side.h
index ba1431fabb9923edab389acd0f0ae7446738a820..6014ddaae72b4fab2815fa94bedc45a290b030dd 100644 (file)
--- a/src/box3d-side.h
+++ b/src/box3d-side.h
GType box3d_side_get_type (void);
void box3d_side_position_set (Box3DSide *side); // FIXME: Replace this by box3d_side_set_shape??
-void box3d_side_apply_style (Box3DSide *side);
+//void box3d_side_apply_style (Box3DSide *side);
gchar *box3d_side_axes_string(Box3DSide *side);
Persp3D *box3d_side_perspective(Box3DSide *side);
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index ed2aceb82575c916e420955b12a33f5776149a59..fd37fceed6dc7e7db9bd36e8068af7c09d97ec61 100644 (file)
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
@@ -484,7 +484,7 @@ static std::vector<Geom::Point> approxItemWithPoints(SPItem const *item, const G
}
else if (SP_IS_SHAPE(item))
{
- SPCurve* item_curve = sp_shape_get_curve(SP_SHAPE(item));
+ SPCurve* item_curve = SP_SHAPE(item)->getCurve();
// make sure it has an associated curve
if (item_curve)
{
index aadb9ee171995866437803c5ff9b39f176c32f31..bf8a70a1492b49ea079b4789b549e952eb5e52e5 100644 (file)
else if (SP_IS_SHAPE(item))
{
//g_message("### %s is a shape", nodeName.c_str());
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
}
else if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item))
{
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index 6778e9ad85ee3976205bdbb957a510ae25c7abd1..23d610ad015cf90606fed98ea80ea835dffaa382 100644 (file)
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
}
if (SP_IS_SHAPE(item)) {
- sp_shape_set_shape(SP_SHAPE(item));
+ SP_SHAPE(item)->setShape();
}
knot_holder->update_knots();
}
if (SP_IS_SHAPE (item)) {
- sp_shape_set_shape(SP_SHAPE (item));
+ SP_SHAPE (item)->setShape();
}
this->update_knots();
index 6266fade0297cfe2934de1a0d2df4b8654a6ab18..2cc26e4e10ef88f58da2b2901c5eac571ec99855 100644 (file)
// rather than copying PathVectors all over the place
if (show_orig_path) {
// add original path to helperpaths
- SPCurve* curve = sp_shape_get_curve (SP_SHAPE(lpeitem));
+ SPCurve* curve = SP_SHAPE(lpeitem)->getCurve ();
hp_vec.push_back(curve->get_pathvector());
}
index a2476a098425575b97219792544c588c8611530a..d43213fe95be76a09f7552aa68f9814f66636c40 100644 (file)
@@ -498,7 +498,7 @@ void collectPathsAndWidths (SPLPEItem const *lpeitem, std::vector<Geom::Path> &p
if (SP_IS_PATH(lpeitem)) {
c = sp_path_get_curve_for_edit(SP_PATH(lpeitem));
} else {
- c = sp_shape_get_curve(SP_SHAPE(lpeitem));
+ c = SP_SHAPE(lpeitem)->getCurve();
}
if (c) {
Geom::PathVector subpaths = c->get_pathvector();
index af4f84f597dba88b25e6cf6a2ea7845cd6abf55d..bdbe126e284bd9028be74bb4acb72c0a42ef5870 100644 (file)
{
SPCurve *curve = NULL;
if (SP_IS_SHAPE(linked_obj)) {
- curve = sp_shape_get_curve(SP_SHAPE(linked_obj));
+ curve = SP_SHAPE(linked_obj)->getCurve();
}
if (SP_IS_TEXT(linked_obj)) {
curve = SP_TEXT(linked_obj)->getNormalizedBpath();
index 8eafa1711436015595d96f336f96082004ebc7a4..1459cb4602780108c0a7eed25197a6ea08a1d0be 100644 (file)
--- a/src/lpe-tool-context.cpp
+++ b/src/lpe-tool-context.cpp
@@ -472,7 +472,7 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select
for (GSList const *i = selection->itemList(); i != NULL; i = i->next) {
if (SP_IS_PATH(i->data)) {
path = SP_PATH(i->data);
- curve = sp_shape_get_curve(SP_SHAPE(path));
+ curve = SP_SHAPE(path)->getCurve();
Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = paths_to_pw(curve->get_pathvector());
canvas_text = (SPCanvasText *) sp_canvastext_new(tmpgrp, lc->desktop, Geom::Point(0,0), "");
if (!show)
std::map<SPPath *, SPCanvasItem*>::iterator i;
for (i = lc->measuring_items->begin(); i != lc->measuring_items->end(); ++i) {
path = i->first;
- curve = sp_shape_get_curve(SP_SHAPE(path));
+ curve = SP_SHAPE(path)->getCurve();
Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = Geom::paths_to_pw(curve->get_pathvector());
SPUnitId unitid = static_cast<SPUnitId>(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX));
SPUnit unit = sp_unit_get_by_id(unitid);
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index 639c7fa00ce99896db6e337a094f3026d5549a4e..12913fd858d97fc53900b32ec71f8f4c97fe8aa4 100644 (file)
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
SPCurve *curve = NULL;
if (SP_IS_SHAPE(item)) {
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
}
if (!curve)
diff --git a/src/sp-conn-end.cpp b/src/sp-conn-end.cpp
index 3ad6954a25204497c27d4ea2f3bb24d74d47c91a..07dd852f230fe988b809d812b4ad7fc215e5fc7d 100644 (file)
--- a/src/sp-conn-end.cpp
+++ b/src/sp-conn-end.cpp
if (!SP_IS_SHAPE(item)) return false;
// make sure it has an associated curve
- SPCurve* item_curve = sp_shape_get_curve(SP_SHAPE(item));
+ SPCurve* item_curve = SP_SHAPE(item)->getCurve();
if (!item_curve) return false;
// apply transformations (up to common ancestor)
diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp
index b5f0bdab62564e45015b3413760a4887eb526531..7eb473d0310523f70046e05dac0df40caf4b92b6 100644 (file)
--- a/src/sp-ellipse.cpp
+++ b/src/sp-ellipse.cpp
ellipse->cy.update(em, ex, dy);
ellipse->rx.update(em, ex, dr);
ellipse->ry.update(em, ex, dr);
- sp_shape_set_shape((SPShape *) object);
+ ((SPShape *) object)->setShape();
}
if (((SPObjectClass *) ge_parent_class)->update)
// unconditionally read the curve from d, if any, to preserve appearance
Geom::PathVector pv = sp_svg_read_pathv(SP_OBJECT_REPR(shape)->attribute("d"));
SPCurve *cold = new SPCurve(pv);
- sp_shape_set_curve_insync (shape, cold, TRUE);
+ shape->setCurveInsync( cold, TRUE);
cold->unref();
}
return;
/* Reset the shape'scurve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
- sp_shape_set_curve_insync (shape, curve, TRUE);
+ shape->setCurveInsync( curve, TRUE);
if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) {
SPCurve *c_lpe = curve->copy();
bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe);
if (success) {
- sp_shape_set_curve_insync (shape, c_lpe, TRUE);
+ shape->setCurveInsync( c_lpe, TRUE);
}
c_lpe->unref();
}
sp_arc_modified(SPObject *object, guint flags)
{
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
- sp_shape_set_shape((SPShape *) object);
+ ((SPShape *) object)->setShape();
}
if (((SPObjectClass *) arc_parent_class)->modified)
diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp
index 29ee05f5e536442fdc55d4542c19c0cdc25c6d29..cff7a5db78edc2c90e6cd3f0a4b6ca10a0c8ac57 100644 (file)
--- a/src/sp-flowregion.cpp
+++ b/src/sp-flowregion.cpp
tr_mat = SP_ITEM(u_child)->transform;
}
if ( SP_IS_SHAPE (u_child) ) {
- curve = sp_shape_get_curve (SP_SHAPE (u_child));
+ curve = SP_SHAPE (u_child)->getCurve ();
} else if ( SP_IS_TEXT (u_child) ) {
curve = SP_TEXT (u_child)->getNormalizedBpath ();
}
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 5b15ca326c068f04ac31f63b64b9975704bdc8ea..56b9dbc217cda7d7d312fc5ccb7ba9aa6c15a469 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
if (SP_IS_PATH(subitem)) {
c = sp_path_get_original_curve(SP_PATH(subitem));
} else {
- c = sp_shape_get_curve(SP_SHAPE(subitem));
+ c = SP_SHAPE(subitem)->getCurve();
}
// only run LPEs when the shape has a curve defined
if (c) {
sp_lpe_item_perform_path_effect(SP_LPE_ITEM(topgroup), c);
- sp_shape_set_curve(SP_SHAPE(subitem), c, TRUE);
+ SP_SHAPE(subitem)->setCurve(c, TRUE);
if (write) {
Inkscape::XML::Node *repr = SP_OBJECT_REPR(subitem);
diff --git a/src/sp-line.cpp b/src/sp-line.cpp
index 6d3d2aea7ffcea8c199a1cc71eb878b2a6d3213f..b29e51b5a5bc2e5607a8b205e2b8668e32246f0c 100644 (file)
--- a/src/sp-line.cpp
+++ b/src/sp-line.cpp
line->y1.update(em, ex, h);
line->y2.update(em, ex, h);
- sp_shape_set_shape ((SPShape *) object);
+ ((SPShape *) object)->setShape ();
}
if (((SPObjectClass *) SPLineClass::static_parent_class)->update)
c->moveto(line->x1.computed, line->y1.computed);
c->lineto(line->x2.computed, line->y2.computed);
- sp_shape_set_curve_insync (shape, c, TRUE); // *_insync does not call update, avoiding infinite recursion when set_shape is called by update
+ shape->setCurveInsync (c, TRUE); // *_insync does not call update, avoiding infinite recursion when set_shape is called by update
c->unref();
}
diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp
index fdff5d7b6f377de3e47b04eca43f9b44dcb8e570..449d7d44d143a72ed332d90d3ad9ba512954917c 100644 (file)
--- a/src/sp-offset.cpp
+++ b/src/sp-offset.cpp
@@ -283,7 +283,7 @@ sp_offset_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XM
// Make sure the object has curve
- SPCurve *curve = sp_shape_get_curve (SP_SHAPE (offset));
+ SPCurve *curve = SP_SHAPE (offset)->getCurve();
if (curve == NULL) {
sp_offset_set_shape (SP_SHAPE (offset));
}
if (flags &
(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
- sp_shape_set_shape ((SPShape *) object);
+ ((SPShape *) object)->setShape ();
}
offset->isUpdating=false;
Geom::PathVector pv = sp_svg_read_pathv(res_d);
SPCurve *c = new SPCurve(pv);
g_assert(c != NULL);
- sp_shape_set_curve_insync ((SPShape *) offset, c, TRUE);
+ ((SPShape *) offset)->setCurveInsync (c, TRUE);
c->unref();
}
return;
Geom::PathVector pv = sp_svg_read_pathv(res_d);
SPCurve *c = new SPCurve(pv);
g_assert(c != NULL);
- sp_shape_set_curve_insync ((SPShape *) offset, c, TRUE);
+ ((SPShape *) offset)->setCurveInsync (c, TRUE);
c->unref();
free (res_d);
return;
}
- SPCurve *curve = sp_shape_get_curve (SP_SHAPE (offset));
+ SPCurve *curve = SP_SHAPE (offset)->getCurve();
if (curve == NULL)
{
sp_offset_set_shape (SP_SHAPE (offset));
- curve = sp_shape_get_curve (SP_SHAPE (offset));
+ curve = SP_SHAPE (offset)->getCurve();
if (curve == NULL)
return;
}
@@ -1082,7 +1082,7 @@ sp_offset_source_modified (SPObject */*iSource*/, guint /*flags*/, SPItem *item)
SPOffset *offset = SP_OFFSET(item);
offset->sourceDirty=true;
refresh_offset_source(offset);
- sp_shape_set_shape ((SPShape *) offset);
+ ((SPShape *) offset)->setShape ();
}
static void
SPCurve *curve=NULL;
if (!SP_IS_SHAPE (item) && !SP_IS_TEXT (item)) return;
if (SP_IS_SHAPE (item)) {
- curve = sp_shape_get_curve (SP_SHAPE (item));
+ curve = SP_SHAPE (item)->getCurve ();
if (curve == NULL)
return;
}
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index 5a0ff7c08ad247c712b666ca53f469543712a640..d98647b11566bcef03682d2e5146329aa31bf2d6 100644 (file)
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
Geom::PathVector pv = sp_svg_read_pathv(value);
SPCurve *curve = new SPCurve(pv);
if (curve) {
- sp_shape_set_curve((SPShape *) path, curve, TRUE);
+ ((SPShape *) path)->setCurve(curve, TRUE);
curve->unref();
}
} else {
- sp_shape_set_curve((SPShape *) path, NULL, TRUE);
+ ((SPShape *) path)->setCurve(NULL, TRUE);
}
object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
break;
SPCurve *curve = path->original_curve->copy();
/* if a path does not have an lpeitem applied, then reset the curve to the original_curve.
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
- sp_shape_set_curve_insync(shape, curve, TRUE);
+ shape->setCurveInsync(curve, TRUE);
bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM(shape), curve);
if (success && write) {
Geom::PathVector pv = sp_svg_read_pathv(value);
SPCurve *oldcurve = new SPCurve(pv);
if (oldcurve) {
- sp_shape_set_curve(shape, oldcurve, TRUE);
+ shape->setCurve(oldcurve, TRUE);
oldcurve->unref();
}
}
sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(path))) {
return sp_path_get_original_curve(path);
} else {
- return sp_shape_get_curve( (SPShape *) path );
+ return ((SPShape *) path)->getCurve();
}
}
diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp
index b947e45ec0016cfeb50be080a1d0f154e2a547c9..d5e10e10fb0da0494c79acd7c9f82514da708ccc 100644 (file)
--- a/src/sp-polygon.cpp
+++ b/src/sp-polygon.cpp
@@ -116,7 +116,7 @@ static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::Do
SPShape *shape = SP_SHAPE(object);
// Tolerable workaround: we need to update the object's curve before we set points=
// because it's out of sync when e.g. some extension attrs of the polygon or star are changed in XML editor
- sp_shape_set_shape(shape);
+ shape->setShape();
if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
repr = xml_doc->createElement("svg:polygon");
* a single-point polygon in SPCurve. TODO: add a testcase with only one coordinate pair */
curve->closepath();
}
- sp_shape_set_curve(SP_SHAPE(polygon), curve, TRUE);
+ (SP_SHAPE(polygon))->setCurve(curve, TRUE);
curve->unref();
break;
}
diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp
index b5eb81a110d9863d0b31da3f53d7fd42e4e82e69..5bf40352db8ae194f3bf1c76b46c9fbd072d1093 100644 (file)
--- a/src/sp-polyline.cpp
+++ b/src/sp-polyline.cpp
@@ -141,7 +141,7 @@ SPPolyLine::sp_polyline_set (SPObject *object, unsigned int key, const gchar *va
}
}
- sp_shape_set_curve (SP_SHAPE (polyline), curve, TRUE);
+ (SP_SHAPE (polyline))->setCurve (curve, TRUE);
curve->unref();
break;
}
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index 4e417f35b63711458111cdfea54224a66fefdd7b..5b75269dcff0aff8a856dd65e1b527e0b8acf893 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
rect->height.update(em, ex, h);
rect->rx.update(em, ex, w);
rect->ry.update(em, ex, h);
- sp_shape_set_shape((SPShape *) object);
+ ((SPShape *) object)->setShape();
flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B; // since we change the description, it's not a "just translation" anymore
}
SPRect *rect = (SPRect *) shape;
if ((rect->height.computed < 1e-18) || (rect->width.computed < 1e-18)) {
- sp_shape_set_curve_insync(SP_SHAPE(rect), NULL, TRUE);
+ SP_SHAPE(rect)->setCurveInsync( NULL, TRUE);
return;
}
}
c->closepath();
- sp_shape_set_curve_insync(SP_SHAPE(rect), c, TRUE);
+ SP_SHAPE(rect)->setCurveInsync( c, TRUE);
c->unref();
}
diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp
index 8e8e222722d6aec6f08fe8cdbd818d1091ffdcf5..3b3e1108b94be13666afe6cf343ebeb7d27eb871 100644 (file)
--- a/src/sp-shape.cpp
+++ b/src/sp-shape.cpp
#define noSHAPE_VERBOSE
-static void sp_shape_class_init (SPShapeClass *klass);
+/*static void sp_shape_class_init (SPShapeClass *klass);
static void sp_shape_init (SPShape *shape);
static void sp_shape_finalize (GObject *object);
static void sp_shape_modified (SPObject *object, unsigned int flags);
static Inkscape::XML::Node *sp_shape_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
-static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
+static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);*/
void sp_shape_print (SPItem * item, SPPrintContext * ctx);
-static NRArenaItem *sp_shape_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
+/*static NRArenaItem *sp_shape_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
static void sp_shape_hide (SPItem *item, unsigned int key);
static void sp_shape_snappoints (SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs);
static void sp_shape_update_marker_view (SPShape *shape, NRArenaItem *ai);
-static SPLPEItemClass *parent_class;
+static SPLPEItemClass *parent_class;*/
+
+SPLPEItemClass * SPShapeClass::parent_class=0;
/**
* Registers the SPShape class with Gdk and returns its type number.
*/
GType
-sp_shape_get_type (void)
+SPShape::getType (void)
{
static GType type = 0;
if (!type) {
GTypeInfo info = {
sizeof (SPShapeClass),
NULL, NULL,
- (GClassInitFunc) sp_shape_class_init,
+ (GClassInitFunc) SPShapeClass::sp_shape_class_init,
NULL, NULL,
sizeof (SPShape),
16,
* Initializes a SPShapeClass object. Establishes the function pointers to the class'
* member routines in the class vtable, and sets pointers to parent classes.
*/
-static void
-sp_shape_class_init (SPShapeClass *klass)
+void
+SPShapeClass::sp_shape_class_init (SPShapeClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
SPObjectClass *sp_object_class = SP_OBJECT_CLASS(klass);
parent_class = (SPLPEItemClass *)g_type_class_peek_parent (klass);
- gobject_class->finalize = sp_shape_finalize;
+ gobject_class->finalize = SPShape::sp_shape_finalize;
- sp_object_class->build = sp_shape_build;
- sp_object_class->release = sp_shape_release;
- sp_object_class->set = sp_shape_set;
- sp_object_class->update = sp_shape_update;
- sp_object_class->modified = sp_shape_modified;
- sp_object_class->write = sp_shape_write;
+ sp_object_class->build = SPShape::sp_shape_build;
+ sp_object_class->release = SPShape::sp_shape_release;
+ sp_object_class->set = SPShape::sp_shape_set;
+ sp_object_class->update = SPShape::sp_shape_update;
+ sp_object_class->modified = SPShape::sp_shape_modified;
+ sp_object_class->write = SPShape::sp_shape_write;
- item_class->bbox = sp_shape_bbox;
+ item_class->bbox = SPShape::sp_shape_bbox;
item_class->print = sp_shape_print;
- item_class->show = sp_shape_show;
- item_class->hide = sp_shape_hide;
- item_class->snappoints = sp_shape_snappoints;
+ item_class->show = SPShape::sp_shape_show;
+ item_class->hide = SPShape::sp_shape_hide;
+ item_class->snappoints = SPShape::sp_shape_snappoints;
lpe_item_class->update_patheffect = NULL;
klass->set_shape = NULL;
/**
* Initializes an SPShape object.
*/
-static void
-sp_shape_init (SPShape *shape)
+void
+SPShape::sp_shape_init (SPShape *shape)
{
for ( int i = 0 ; i < SP_MARKER_LOC_QTY ; i++ ) {
new (&shape->release_connect[i]) sigc::connection();
shape->curve = NULL;
}
-static void
-sp_shape_finalize (GObject *object)
+void
+SPShape::sp_shape_finalize (GObject *object)
{
SPShape *shape=(SPShape *)object;
shape->modified_connect[i].~connection();
}
- if (((GObjectClass *) (parent_class))->finalize) {
- (* ((GObjectClass *) (parent_class))->finalize)(object);
+ if (((GObjectClass *) (SPShapeClass::parent_class))->finalize) {
+ (* ((GObjectClass *) (SPShapeClass::parent_class))->finalize)(object);
}
}
*
* \see sp_object_build()
*/
-static void
-sp_shape_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
+void
+SPShape::sp_shape_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- if (((SPObjectClass *) (parent_class))->build) {
- (*((SPObjectClass *) (parent_class))->build) (object, document, repr);
+ if (((SPObjectClass *) (SPShapeClass::parent_class))->build) {
+ (*((SPObjectClass *) (SPShapeClass::parent_class))->build) (object, document, repr);
}
for (int i = 0 ; i < SP_MARKER_LOC_QTY ; i++) {
@@ -192,8 +194,8 @@ sp_shape_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
*
* \see sp_object_release()
*/
-static void
-sp_shape_release (SPObject *object)
+void
+SPShape::sp_shape_release (SPObject *object)
{
SPItem *item;
SPShape *shape;
shape->curve = shape->curve->unref();
}
- if (((SPObjectClass *) parent_class)->release) {
- ((SPObjectClass *) parent_class)->release (object);
+ if (((SPObjectClass *) SPShapeClass::parent_class)->release) {
+ ((SPObjectClass *) SPShapeClass::parent_class)->release (object);
}
}
-static void
-sp_shape_set(SPObject *object, unsigned int key, gchar const *value)
+void
+SPShape::sp_shape_set(SPObject *object, unsigned int key, gchar const *value)
{
- if (((SPObjectClass *) parent_class)->set) {
- ((SPObjectClass *) parent_class)->set(object, key, value);
+ if (((SPObjectClass *) SPShapeClass::parent_class)->set) {
+ ((SPObjectClass *) SPShapeClass::parent_class)->set(object, key, value);
}
}
-static Inkscape::XML::Node *
-sp_shape_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
+Inkscape::XML::Node *
+SPShape::sp_shape_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags)
{
- if (((SPObjectClass *)(parent_class))->write) {
- ((SPObjectClass *)(parent_class))->write(object, doc, repr, flags);
+ if (((SPObjectClass *)(SPShapeClass::parent_class))->write) {
+ ((SPObjectClass *)(SPShapeClass::parent_class))->write(object, doc, repr, flags);
}
return repr;
@@ -246,14 +248,14 @@ sp_shape_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::No
* Updates the shape when its attributes have changed. Also establishes
* marker objects to match the style settings.
*/
-static void
-sp_shape_update (SPObject *object, SPCtx *ctx, unsigned int flags)
+void
+SPShape::sp_shape_update (SPObject *object, SPCtx *ctx, unsigned int flags)
{
SPItem *item = (SPItem *) object;
SPShape *shape = (SPShape *) object;
- if (((SPObjectClass *) (parent_class))->update) {
- (* ((SPObjectClass *) (parent_class))->update) (object, ctx, flags);
+ if (((SPObjectClass *) (SPShapeClass::parent_class))->update) {
+ (* ((SPObjectClass *) (SPShapeClass::parent_class))->update) (object, ctx, flags);
}
/* This stanza checks that an object's marker style agrees with
}
}
- if (sp_shape_has_markers (shape)) {
+ if (shape->hasMarkers ()) {
/* Dimension marker views */
for (SPItemView *v = item->display; v != NULL; v = v->next) {
if (!v->arenaitem->key) {
if (shape->marker[i]) {
sp_marker_show_dimension ((SPMarker *) shape->marker[i],
NR_ARENA_ITEM_GET_KEY (v->arenaitem) + i,
- sp_shape_number_of_markers (shape, i));
+ shape->numberOfMarkers (i));
}
}
}
*
* @todo figure out what to do when both 'marker' and for instance 'marker-end' are set.
*/
-static void
-sp_shape_update_marker_view (SPShape *shape, NRArenaItem *ai)
+void
+SPShape::sp_shape_update_marker_view (SPShape *shape, NRArenaItem *ai)
{
SPStyle *style = ((SPObject *) shape)->style;
/**
* Sets modified flag for all sub-item views.
*/
-static void
-sp_shape_modified (SPObject *object, unsigned int flags)
+void
+SPShape::sp_shape_modified (SPObject *object, unsigned int flags)
{
SPShape *shape = SP_SHAPE (object);
- if (((SPObjectClass *) (parent_class))->modified) {
- (* ((SPObjectClass *) (parent_class))->modified) (object, flags);
+ if (((SPObjectClass *) (SPShapeClass::parent_class))->modified) {
+ (* ((SPObjectClass *) (SPShapeClass::parent_class))->modified) (object, flags);
}
if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
* Calculates the bounding box for item, storing it into bbox.
* This also includes the bounding boxes of any markers included in the shape.
*/
-static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags)
+void SPShape::sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags)
{
SPShape const *shape = SP_SHAPE (item);
if (shape->curve) {
@@ -585,7 +587,7 @@ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &
}
// Union with bboxes of the markers, if any
- if (sp_shape_has_markers (shape)) {
+ if (shape->hasMarkers ()) {
/** \todo make code prettier! */
Geom::PathVector const & pathv = shape->curve->get_pathvector();
// START marker
/**
* Sets style, path, and paintbox. Updates marker views, including dimensions.
*/
-static NRArenaItem *
-sp_shape_show (SPItem *item, NRArena *arena, unsigned int /*key*/, unsigned int /*flags*/)
+NRArenaItem *
+SPShape::sp_shape_show (SPItem *item, NRArena *arena, unsigned int /*key*/, unsigned int /*flags*/)
{
SPObject *object = SP_OBJECT(item);
SPShape *shape = SP_SHAPE(item);
sp_shape_set_marker (object, i, object->style->marker[i].value);
}
- if (sp_shape_has_markers (shape)) {
+ if (shape->hasMarkers ()) {
/* provide key and dimension the marker views */
if (!arenaitem->key) {
if (shape->marker[i]) {
sp_marker_show_dimension ((SPMarker *) shape->marker[i],
NR_ARENA_ITEM_GET_KEY (arenaitem) + i,
- sp_shape_number_of_markers (shape, i));
+ shape->numberOfMarkers (i));
}
}
/**
* Hides/removes marker views from the shape.
*/
-static void
-sp_shape_hide (SPItem *item, unsigned int key)
+void
+SPShape::sp_shape_hide (SPItem *item, unsigned int key)
{
SPShape *shape;
SPItemView *v;
}
}
- if (((SPItemClass *) parent_class)->hide) {
- ((SPItemClass *) parent_class)->hide (item, key);
+ if (((SPItemClass *) SPShapeClass::parent_class)->hide) {
+ ((SPItemClass *) SPShapeClass::parent_class)->hide (item, key);
}
}
* \return TRUE if the shape has any markers, or FALSE if not.
*/
int
-sp_shape_has_markers (SPShape const *shape)
+SPShape::hasMarkers () const
{
/* Note, we're ignoring 'marker' settings, which technically should apply for
all three settings. This should be fixed later such that if 'marker' is
specified, then all three should appear. */
return (
- shape->curve &&
- (shape->marker[SP_MARKER_LOC] ||
- shape->marker[SP_MARKER_LOC_START] ||
- shape->marker[SP_MARKER_LOC_MID] ||
- shape->marker[SP_MARKER_LOC_END])
+ this->curve &&
+ (this->marker[SP_MARKER_LOC] ||
+ this->marker[SP_MARKER_LOC_START] ||
+ this->marker[SP_MARKER_LOC_MID] ||
+ this->marker[SP_MARKER_LOC_END])
);
}
* \return Number of markers that the shape has of this type.
*/
int
-sp_shape_number_of_markers (SPShape *shape, int type)
+SPShape::numberOfMarkers (int type)
{
- Geom::PathVector const & pathv = shape->curve->get_pathvector();
+ Geom::PathVector const & pathv = this->curve->get_pathvector();
if (pathv.size() == 0) {
return 0;
}
switch(type) {
case SP_MARKER_LOC:
{
- if ( shape->marker[SP_MARKER_LOC] ) {
+ if ( this->marker[SP_MARKER_LOC] ) {
guint n = 0;
for(Geom::PathVector::const_iterator path_it = pathv.begin(); path_it != pathv.end(); ++path_it) {
n += path_it->size_default() + 1;
}
case SP_MARKER_LOC_START:
// there is only a start marker on the first path of a pathvector
- return shape->marker[SP_MARKER_LOC_START] ? 1 : 0;
+ return this->marker[SP_MARKER_LOC_START] ? 1 : 0;
case SP_MARKER_LOC_MID:
{
- if ( shape->marker[SP_MARKER_LOC_MID] ) {
+ if ( this->marker[SP_MARKER_LOC_MID] ) {
guint n = 0;
for(Geom::PathVector::const_iterator path_it = pathv.begin(); path_it != pathv.end(); ++path_it) {
n += path_it->size_default() + 1;
case SP_MARKER_LOC_END:
{
// there is only an end marker on the last path of a pathvector
- return shape->marker[SP_MARKER_LOC_END] ? 1 : 0;
+ return this->marker[SP_MARKER_LOC_END] ? 1 : 0;
}
default:
@@ -1113,13 +1115,13 @@ sp_shape_set_marker (SPObject *object, unsigned int key, const gchar *value)
* Calls any registered handlers for the set_shape action
*/
void
-sp_shape_set_shape (SPShape *shape)
+SPShape::setShape ()
{
- g_return_if_fail (shape != NULL);
- g_return_if_fail (SP_IS_SHAPE (shape));
+ //g_return_if_fail (shape != NULL);
+ //g_return_if_fail (SP_IS_SHAPE (shape));
- if (SP_SHAPE_CLASS (G_OBJECT_GET_CLASS (shape))->set_shape) {
- SP_SHAPE_CLASS (G_OBJECT_GET_CLASS (shape))->set_shape (shape);
+ if (SP_SHAPE_CLASS (G_OBJECT_GET_CLASS (this))->set_shape) {
+ SP_SHAPE_CLASS (G_OBJECT_GET_CLASS (this))->set_shape (this);
}
}
* This routine also triggers a request to update the display.
*/
void
-sp_shape_set_curve (SPShape *shape, SPCurve *curve, unsigned int owner)
+SPShape::setCurve (SPCurve *curve, unsigned int owner)
{
- if (shape->curve) {
- shape->curve = shape->curve->unref();
+ if (this->curve) {
+ this->curve = this->curve->unref();
}
if (curve) {
if (owner) {
- shape->curve = curve->ref();
+ this->curve = curve->ref();
} else {
- shape->curve = curve->copy();
+ this->curve = curve->copy();
}
}
- SP_OBJECT(shape)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+ SP_OBJECT(this)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
}
/**
* Return duplicate of curve (if any exists) or NULL if there is no curve
*/
SPCurve *
-sp_shape_get_curve (SPShape *shape)
+SPShape::getCurve ()
{
- if (shape->curve) {
- return shape->curve->copy();
+ if (this->curve) {
+ return this->curve->copy();
}
return NULL;
}
* Same as sp_shape_set_curve but without updating the display
*/
void
-sp_shape_set_curve_insync (SPShape *shape, SPCurve *curve, unsigned int owner)
+SPShape::setCurveInsync (SPCurve *curve, unsigned int owner)
{
- if (shape->curve) {
- shape->curve = shape->curve->unref();
+ if (this->curve) {
+ this->curve = this->curve->unref();
}
if (curve) {
if (owner) {
- shape->curve = curve->ref();
+ this->curve = curve->ref();
} else {
- shape->curve = curve->copy();
+ this->curve = curve->copy();
}
}
}
@@ -1178,7 +1180,7 @@ sp_shape_set_curve_insync (SPShape *shape, SPCurve *curve, unsigned int owner)
/**
* Return all nodes in a path that are to be considered for snapping
*/
-static void sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
+void SPShape::sp_shape_snappoints(SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
{
g_assert(item != NULL);
g_assert(SP_IS_SHAPE(item));
diff --git a/src/sp-shape.h b/src/sp-shape.h
index 4b1ded23649394f2066412c1d4be334d62b72817..0a3b3e37f6308dea5fdd6f7107998bb4a209051f 100644 (file)
--- a/src/sp-shape.h
+++ b/src/sp-shape.h
#include <sigc++/connection.h>
-#define SP_TYPE_SHAPE (sp_shape_get_type ())
+#define SP_TYPE_SHAPE (SPShape::getType ())
#define SP_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_SHAPE, SPShape))
#define SP_SHAPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_SHAPE, SPShapeClass))
#define SP_IS_SHAPE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_SHAPE))
struct SPDesktop;
-struct SPShape : public SPLPEItem {
- SPCurve *curve;
+//struct SPShape : public SPLPEItem {
+class SPShape : public SPLPEItem {
+ public:
+ SPCurve *curve;
- SPObject *marker[SP_MARKER_LOC_QTY];
- sigc::connection release_connect [SP_MARKER_LOC_QTY];
- sigc::connection modified_connect [SP_MARKER_LOC_QTY];
+ SPObject *marker[SP_MARKER_LOC_QTY];
+ sigc::connection release_connect [SP_MARKER_LOC_QTY];
+ sigc::connection modified_connect [SP_MARKER_LOC_QTY];
+
+ static GType getType (void);
+ void setShape ();
+ SPCurve * getCurve ();
+ void setCurve (SPCurve *curve, unsigned int owner);
+ void setCurveInsync (SPCurve *curve, unsigned int owner);
+ int hasMarkers () const;
+ int numberOfMarkers (int type);
+ private:
+ static void sp_shape_init (SPShape *shape);
+ static void sp_shape_finalize (GObject *object);
+
+ static void sp_shape_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr);
+ static void sp_shape_release (SPObject *object);
+
+ static void sp_shape_set(SPObject *object, unsigned key, gchar const *value);
+ static void sp_shape_update (SPObject *object, SPCtx *ctx, unsigned int flags);
+ static void sp_shape_modified (SPObject *object, unsigned int flags);
+ static Inkscape::XML::Node *sp_shape_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);
+
+ static void sp_shape_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);
+ static NRArenaItem *sp_shape_show (SPItem *item, NRArena *arena, unsigned int key, unsigned int flags);
+ static void sp_shape_hide (SPItem *item, unsigned int key);
+ static void sp_shape_snappoints (SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs);
+
+ static void sp_shape_update_marker_view (SPShape *shape, NRArenaItem *ai);
+
+
+
+ friend class SPShapeClass;
};
-struct SPShapeClass {
+//struct SPShapeClass {
+class SPShapeClass {
+ public:
SPLPEItemClass item_class;
/* Build bpath from extra shape attributes */
void (* set_shape) (SPShape *shape);
+
+ private:
+ static SPLPEItemClass *parent_class;
+ static void sp_shape_class_init (SPShapeClass *klass);
+
+ friend class SPShape;
};
-GType sp_shape_get_type (void);
+//GType sp_shape_get_type (void);
-void sp_shape_set_shape (SPShape *shape);
+//void sp_shape_set_shape (SPShape *shape);
/* Return duplicate of curve or NULL */
-SPCurve *sp_shape_get_curve (SPShape *shape);
+//SPCurve *sp_shape_get_curve (SPShape *shape);
// sets a curve, updates display
-void sp_shape_set_curve (SPShape *shape, SPCurve *curve, unsigned int owner);
+//void sp_shape_set_curve (SPShape *shape, SPCurve *curve, unsigned int owner);
// same as sp_shape_set_curve, but without updating display
-void sp_shape_set_curve_insync (SPShape *shape, SPCurve *curve, unsigned int owner);
+//void sp_shape_set_curve_insync (SPShape *shape, SPCurve *curve, unsigned int owner);
// markers API
void sp_shape_set_marker (SPObject *object, unsigned int key, const gchar *value);
-int sp_shape_has_markers (SPShape const *shape);
-int sp_shape_number_of_markers (SPShape* Shape, int type);
+//int sp_shape_has_markers (SPShape const *shape);
+//int sp_shape_number_of_markers (SPShape* Shape, int type);
Geom::Matrix sp_shape_marker_get_transform(Geom::Curve const & c1, Geom::Curve const & c2);
Geom::Matrix sp_shape_marker_get_transform_at_start(Geom::Curve const & c);
diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp
index 3acc34d2ab64d63f9c99130fa9a0480088357908..499500c44ecf24a5e307d3c5e849132005c1ee72 100644 (file)
--- a/src/sp-spiral.cpp
+++ b/src/sp-spiral.cpp
sp_spiral_update (SPObject *object, SPCtx *ctx, guint flags)
{
if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
- sp_shape_set_shape ((SPShape *) object);
+ ((SPShape *) object)->setShape ();
}
if (((SPObjectClass *) parent_class)->update)
// unconditionally read the curve from d, if any, to preserve appearance
Geom::PathVector pv = sp_svg_read_pathv(SP_OBJECT_REPR(shape)->attribute("d"));
SPCurve *cold = new SPCurve(pv);
- sp_shape_set_curve_insync (shape, cold, TRUE);
+ shape->setCurveInsync( cold, TRUE);
cold->unref();
}
return;
/* Reset the shape'scurve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
- sp_shape_set_curve_insync (shape, c, TRUE);
+ shape->setCurveInsync( c, TRUE);
if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) {
SPCurve *c_lpe = c->copy();
bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe);
if (success) {
- sp_shape_set_curve_insync (shape, c_lpe, TRUE);
+ shape->setCurveInsync( c_lpe, TRUE);
}
c_lpe->unref();
}
diff --git a/src/sp-star.cpp b/src/sp-star.cpp
index 0d74cf780e6eb9cd23663049a265ee1f4d37e67f..b956019d44b487976f793cff7ca2558db31177ee 100644 (file)
--- a/src/sp-star.cpp
+++ b/src/sp-star.cpp
if (flags & (SP_OBJECT_MODIFIED_FLAG |
SP_OBJECT_STYLE_MODIFIED_FLAG |
SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
- sp_shape_set_shape ((SPShape *) object);
+ ((SPShape *) object)->setShape ();
}
if (((SPObjectClass *) parent_class)->update)
// unconditionally read the curve from d, if any, to preserve appearance
Geom::PathVector pv = sp_svg_read_pathv(SP_OBJECT_REPR(shape)->attribute("d"));
SPCurve *cold = new SPCurve(pv);
- sp_shape_set_curve_insync (shape, cold, TRUE);
+ shape->setCurveInsync( cold, TRUE);
cold->unref();
}
return;
/* Reset the shape'scurve to the "original_curve"
* This is very important for LPEs to work properly! (the bbox might be recalculated depending on the curve in shape)*/
- sp_shape_set_curve_insync (shape, c, TRUE);
+ shape->setCurveInsync( c, TRUE);
if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(shape)) && sp_lpe_item_path_effects_enabled(SP_LPE_ITEM(shape))) {
SPCurve *c_lpe = c->copy();
bool success = sp_lpe_item_perform_path_effect(SP_LPE_ITEM (shape), c_lpe);
if (success) {
- sp_shape_set_curve_insync (shape, c_lpe, TRUE);
+ shape->setCurveInsync( c_lpe, TRUE);
}
c_lpe->unref();
}
index 914e416b3f77c357cc4db36a8098115fe2c5af98..a05dc0e93d498ddbcaef2ea23012b6d80d90e902 100644 (file)
--- a/src/sp-use-reference.cpp
+++ b/src/sp-use-reference.cpp
return;
}
if (SP_IS_SHAPE(item)) {
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
if (curve == NULL)
return;
}
diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp
index 3d1cd4b211e6f62d2318513f44aeadbaa3d570ee..13407b80b3002e1e538a1783c6c13a321fd5e812 100644 (file)
--- a/src/spiral-context.cpp
+++ b/src/spiral-context.cpp
SPDesktop *desktop = SP_EVENT_CONTEXT(sc)->desktop;
- sp_shape_set_shape(SP_SHAPE(spiral));
+ SP_SHAPE(spiral)->setShape();
SP_OBJECT(spiral)->updateRepr(SP_OBJECT_WRITE_EXT);
sp_canvas_end_forced_full_redraws(desktop->canvas);
diff --git a/src/splivarot.cpp b/src/splivarot.cpp
index d9ac792b3d680020d0896334b0e1223fb4761e23..b2fe45e19b7668cd4c6d1aeef1428ccb6e65eabd 100644 (file)
--- a/src/splivarot.cpp
+++ b/src/splivarot.cpp
SPCurve *curve = NULL;
if (SP_IS_SHAPE(item)) {
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
} else if (SP_IS_TEXT(item)) {
curve = SP_TEXT(item)->getNormalizedBpath();
}
if (res->descr_cmd.size() > 1) { // if there's 0 or 1 node left, drop this path altogether
ret_pathv = orig->MakePathVector();
- if (SP_IS_SHAPE(item) && sp_shape_has_markers (SP_SHAPE(item))) {
+ if (SP_IS_SHAPE(item) && SP_SHAPE(item)->hasMarkers ()) {
SPShape *shape = SP_SHAPE(item);
Geom::PathVector const & pathv = curve->get_pathvector();
SPCurve *curve = NULL;
if (SP_IS_SHAPE(item)) {
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
if (curve == NULL)
continue;
}
if (clip_path)
repr->setAttribute("clip-path", clip_path);
- if (SP_IS_SHAPE(item) && sp_shape_has_markers (SP_SHAPE(item))) {
+ if (SP_IS_SHAPE(item) && SP_SHAPE(item)->hasMarkers ()) {
Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
Inkscape::XML::Node *g_repr = xml_doc->createElement("svg:g");
@@ -1308,7 +1308,7 @@ sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool updat
}
if (SP_IS_SHAPE(item))
{
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
if (curve == NULL)
return;
}
@@ -1537,7 +1537,7 @@ sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset)
SPCurve *curve = NULL;
if (SP_IS_SHAPE(item)) {
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
if (curve == NULL)
continue;
}
SPCurve *curve = NULL;
if (SP_IS_SHAPE(item)) {
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
if (!curve)
return false;
}
if (SP_IS_PATH(item)) {
curve = sp_path_get_curve_for_edit(SP_PATH(item));
} else {
- curve = sp_shape_get_curve(SP_SHAPE(item));
+ curve = SP_SHAPE(item)->getCurve();
}
}
else if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item))
diff --git a/src/star-context.cpp b/src/star-context.cpp
index 2761c573aa319debce0627afc0f44218f66f97ff..61646ceee7cc79d0fe47eac6496685e2514712ed 100644 (file)
--- a/src/star-context.cpp
+++ b/src/star-context.cpp
SPDesktop *desktop = SP_EVENT_CONTEXT(sc)->desktop;
SPObject *object = SP_OBJECT(sc->item);
- sp_shape_set_shape(SP_SHAPE(sc->item));
+ (SP_SHAPE(sc->item))->setShape();
object->updateRepr(SP_OBJECT_WRITE_EXT);
index ba82b810bc42d70f512956bbc005c12de1346e4c..f102be1f73c34e93e2684439529dcf7032badc59 100644 (file)
if (_path->getRepr()->attribute("inkscape:original-d"))
sp_path_set_original_curve(_path, _spcurve, false, false);
else
- sp_shape_set_curve(SP_SHAPE(_path), _spcurve, false);
+ SP_SHAPE(_path)->setCurve(_spcurve, false);
}
}