summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ee72fa)
raw | patch | inline | side by side (parent: 3ee72fa)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 19 Mar 2009 23:26:11 +0000 (23:26 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Thu, 19 Mar 2009 23:26:11 +0000 (23:26 +0000) |
src/live_effects/parameter/path.cpp | patch | blob | history | |
src/nodepath.cpp | patch | blob | history | |
src/shape-editor.cpp | patch | blob | history | |
src/shape-editor.h | patch | blob | history |
index 1214a1766db3281d66926d12c91bcd9475159468..5b6af68d2a33e86f3f5ef8e3a12cbd3429be93da 100644 (file)
ShapeEditor * shape_editor = dt->event_context->shape_editor;
if (!href) {
- shape_editor->set_item_lpe_path_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str());
+ shape_editor->set_item_lpe_path_parameter(item, param_effect->getLPEObj(), param_key.c_str());
} else {
// set referred item for editing
shape_editor->set_item(ref.getObject(), SH_NODEPATH);
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 1899f7978646954de604f1ee60d0e518fa312c48..b59a2d8655441acb595f84cdacdb996ef8badd18 100644 (file)
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
/**
* \brief Creates new nodepath from item
*
+ * If repr_key_in is not NULL, object *has* to be a LivePathEffectObject !
+ *
* \todo create proper constructor for nodepath::path, this method returns null a constructor cannot so this cannot be simply converted to constructor.
*/
Inkscape::NodePath::Path *sp_nodepath_new(SPDesktop *desktop, SPObject *object, bool show_handles, const char * repr_key_in, SPItem *item)
{
+ if (repr_key_in) {
+ g_assert(IS_LIVEPATHEFFECT(object));
+ }
+
Inkscape::XML::Node *repr = object->repr;
/** \todo
np->d2i = np->i2d.inverse();
np->repr = repr;
- if (repr_key_in) { // apparently the object is an LPEObject (this is a dirty check, hopefully nobody tries feeding non-lpeobjects into this method with non-null repr_key_in)
+ if (repr_key_in) { // apparently the object is an LPEObject
np->repr_key = g_strdup(repr_key_in);
np->repr_nodetypes_key = g_strconcat(np->repr_key, "-nodetypes", NULL);
Inkscape::LivePathEffect::Effect * lpe = LIVEPATHEFFECT(object)->get_lpe();
diff --git a/src/shape-editor.cpp b/src/shape-editor.cpp
index bfe407957c8f98aa982d83deb45a70bd173aa919..dc1ec1c7e2f7b8623c3aaa6a0325ac0e1660dc5b 100644 (file)
--- a/src/shape-editor.cpp
+++ b/src/shape-editor.cpp
/** Please note that this function only works for path parameters.
* All other parameters probably will crash Inkscape!
*/
-void ShapeEditor::set_item_lpe_path_parameter(SPItem *item, SPObject *lpeobject, const char * key)
+void ShapeEditor::set_item_lpe_path_parameter(SPItem *item, LivePathEffectObject *lpeobject, const char * key)
{
unset_item(SH_NODEPATH);
case SH_NODEPATH:
if ( (nodepath) && (IS_LIVEPATHEFFECT(nodepath->object)) ) {
char * key = g_strdup(nodepath->repr_key);
- set_item_lpe_path_parameter(nodepath->item, nodepath->object, key); // the above checks for nodepath, so it is indeed a path that we are editing
+ set_item_lpe_path_parameter(nodepath->item, LIVEPATHEFFECT(nodepath->object), key); // the above checks for nodepath, so it is indeed a path that we are editing
g_free(key);
} else {
set_item(SP_ITEM(obj), SH_NODEPATH);
diff --git a/src/shape-editor.h b/src/shape-editor.h
index f30f1aa12f7d0bf045c63dc2a7eb4aae5ea8d994..ef81540ae38d8bde462edaaf90ba6192fdd500ed 100644 (file)
--- a/src/shape-editor.h
+++ b/src/shape-editor.h
*/
#include <forward.h>
-#include <libnr/nr-forward.h>
+#include <2geom/forward.h>
namespace Inkscape { namespace NodePath { class Path; } }
namespace Inkscape { namespace XML { class Node; } }
-#include "libnr/nr-path-code.h"
-#include "libnr/nr-point.h"
-#include <boost/optional.hpp>
-#include <vector>
-
class KnotHolder;
class SPDesktop;
class SPNodeContext;
class ShapeEditorsCollective;
+class LivePathEffectObject;
+
+#include "libnr/nr-path-code.h"
+#include <2geom/point.h>
+#include <boost/optional.hpp>
+#include <vector>
enum SubType{
SH_NODEPATH,
~ShapeEditor();
void set_item (SPItem *item, SubType type, bool keep_knotholder = false);
- void set_item_lpe_path_parameter(SPItem *item, SPObject *lpeobject, const char * key);
+ void set_item_lpe_path_parameter(SPItem *item, LivePathEffectObject *lpeobject, const char * key);
void unset_item (SubType type, bool keep_knotholder = false);
bool has_nodepath (); //((deprecated))