summaryrefslogtreecommitdiffstats
path: root/src/knotholder.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2006-06-29 20:15:48 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2006-06-29 20:15:48 +0000
commitef0a7b603c667abc8599c3abf88c4408acb05228 (patch)
tree7ddfd39557009044f41538d865cf3365e0ffe3fd /src/knotholder.cpp
parentSmall bugfixes. (diff)
downloadinkscape-ef0a7b603c667abc8599c3abf88c4408acb05228.tar.gz
inkscape-ef0a7b603c667abc8599c3abf88c4408acb05228.zip
patch from Gustav Broberg: undo annotations and history dialog
(bzr r1315)
Diffstat (limited to 'src/knotholder.cpp')
-rw-r--r--src/knotholder.cpp38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/knotholder.cpp b/src/knotholder.cpp
index ff6a81970..7b30a2814 100644
--- a/src/knotholder.cpp
+++ b/src/knotholder.cpp
@@ -20,6 +20,15 @@
#include "knot.h"
#include "knotholder.h"
#include "knot-holder-entity.h"
+#include "rect-context.h"
+#include "sp-rect.h"
+#include "arc-context.h"
+#include "sp-ellipse.h"
+#include "star-context.h"
+#include "sp-star.h"
+#include "spiral-context.h"
+#include "sp-spiral.h"
+
#include <libnr/nr-matrix-div.h>
class SPDesktop;
@@ -221,8 +230,20 @@ static void knot_clicked_handler(SPKnot *knot, guint state, gpointer data)
knotholder_update_knots(knot_holder, item);
g_object_unref(knot_holder);
+ unsigned int object_verb = SP_VERB_NONE;
+
+ if (SP_IS_RECT(item))
+ object_verb = SP_VERB_CONTEXT_RECT;
+ else if (SP_IS_GENERICELLIPSE(item))
+ object_verb = SP_VERB_CONTEXT_ARC;
+ else if (SP_IS_STAR(item))
+ object_verb = SP_VERB_CONTEXT_STAR;
+ else if (SP_IS_SPIRAL(item))
+ object_verb = SP_VERB_CONTEXT_SPIRAL;
+
// for drag, this is done by ungrabbed_handler, but for click we must do it here
- sp_document_done(SP_OBJECT_DOCUMENT(knot_holder->item));
+ sp_document_done(SP_OBJECT_DOCUMENT(knot_holder->item), object_verb,
+ /* TODO: annotate */ "knotholder.cpp:246");
}
static void knot_moved_handler(SPKnot *knot, NR::Point const *p, guint state, gpointer data)
@@ -255,7 +276,20 @@ static void knot_ungrabbed_handler(SPKnot *knot, unsigned int state, SPKnotHolde
} else {
SPObject *object = (SPObject *) kh->item;
object->updateRepr(object->repr, SP_OBJECT_WRITE_EXT);
- sp_document_done(SP_OBJECT_DOCUMENT (object));
+
+ unsigned int object_verb = SP_VERB_NONE;
+
+ if (SP_IS_RECT(object))
+ object_verb = SP_VERB_CONTEXT_RECT;
+ else if (SP_IS_GENERICELLIPSE(object))
+ object_verb = SP_VERB_CONTEXT_ARC;
+ else if (SP_IS_STAR(object))
+ object_verb = SP_VERB_CONTEXT_STAR;
+ else if (SP_IS_SPIRAL(object))
+ object_verb = SP_VERB_CONTEXT_SPIRAL;
+
+ sp_document_done(SP_OBJECT_DOCUMENT (object), object_verb,
+ /* TODO: annotate */ "knotholder.cpp:292");
}
}