From: buliabyak Date: Thu, 29 Jun 2006 20:15:48 +0000 (+0000) Subject: patch from Gustav Broberg: undo annotations and history dialog X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4ec52515516e3a6bf2fbc3ed01a7e179bde16d20;p=inkscape.git patch from Gustav Broberg: undo annotations and history dialog --- diff --git a/share/icons/icons.svg b/share/icons/icons.svg index e294bdc93..20e4026e2 100644 --- a/share/icons/icons.svg +++ b/share/icons/icons.svg @@ -8,12 +8,13 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - inkscape:version="0.43+devel" + inkscape:version="0.44+devel" sodipodi:docname="icons.svg" height="1000.0000pt" width="1000.0000pt" sodipodi:version="0.32" - id="svg1"> + id="svg1" + sodipodi:docbase="/usr/local/src/inkscape/share/icons"> + transform="translate(50.0399,-119.9404)"> height="1250" /> id="path5069" /> + transform="translate(-105,-15)"> id="path5624" /> + transform="translate(-429.9517,-29.93562)"> @@ -10591,7 +10592,7 @@ http://www.inkscape.org/ + transform="translate(-429.9489,-9.94566)"> width="1250" height="1250" /> + + + + + + + + + + + + + diff --git a/share/keys/default.xml b/share/keys/default.xml index 497acf43f..ba5c85562 100644 --- a/share/keys/default.xml +++ b/share/keys/default.xml @@ -226,6 +226,9 @@ override) the bindings in the main default.xml. + + + diff --git a/share/keys/inkscape.xml b/share/keys/inkscape.xml index 497acf43f..ba5c85562 100644 --- a/share/keys/inkscape.xml +++ b/share/keys/inkscape.xml @@ -226,6 +226,9 @@ override) the bindings in the main default.xml. + + + diff --git a/share/ui/menus-bars.xml b/share/ui/menus-bars.xml index ceb9aaa50..69d786b91 100644 --- a/share/ui/menus-bars.xml +++ b/share/ui/menus-bars.xml @@ -27,6 +27,7 @@ + diff --git a/src/Makefile_insert b/src/Makefile_insert index c3182f3cc..4b797f233 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -67,6 +67,7 @@ libinkpre_a_SOURCES = \ dyna-draw-context.cpp dyna-draw-context.h \ enums.h \ event-context.cpp event-context.h \ + event-log.cpp event-log.h \ extract-uri.cpp extract-uri.h \ file.cpp file.h \ fontsize-expansion.cpp fontsize-expansion.h \ diff --git a/src/arc-context.cpp b/src/arc-context.cpp index 830f4c511..8151445b3 100644 --- a/src/arc-context.cpp +++ b/src/arc-context.cpp @@ -40,6 +40,7 @@ #include "desktop.h" #include "desktop-style.h" #include "context-fns.h" +#include "verbs.h" #include "arc-context.h" @@ -432,7 +433,8 @@ static void sp_arc_finish(SPArcContext *ac) SP_OBJECT(ac->item)->updateRepr(); sp_desktop_selection(desktop)->set(ac->item); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC, + /* TODO: annotate */ "arc-context.cpp:437"); ac->item = NULL; } diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp index 04890711b..3c46cb11e 100644 --- a/src/composite-undo-stack-observer.cpp +++ b/src/composite-undo-stack-observer.cpp @@ -42,7 +42,7 @@ CompositeUndoStackObserver::remove(UndoStackObserver& observer) } void -CompositeUndoStackObserver::notifyUndoEvent(XML::Event* log) +CompositeUndoStackObserver::notifyUndoEvent(Event* log) { this->_lock(); for(UndoObserverRecordList::iterator i = this->_active.begin(); i != _active.end(); ++i) { @@ -54,7 +54,7 @@ CompositeUndoStackObserver::notifyUndoEvent(XML::Event* log) } void -CompositeUndoStackObserver::notifyRedoEvent(XML::Event* log) +CompositeUndoStackObserver::notifyRedoEvent(Event* log) { this->_lock(); @@ -67,7 +67,7 @@ CompositeUndoStackObserver::notifyRedoEvent(XML::Event* log) } void -CompositeUndoStackObserver::notifyUndoCommitEvent(XML::Event* log) +CompositeUndoStackObserver::notifyUndoCommitEvent(Event* log) { this->_lock(); for(UndoObserverRecordList::iterator i = this->_active.begin(); i != _active.end(); ++i) { diff --git a/src/composite-undo-stack-observer.h b/src/composite-undo-stack-observer.h index fbe0ed892..02d54eb76 100644 --- a/src/composite-undo-stack-observer.h +++ b/src/composite-undo-stack-observer.h @@ -20,12 +20,8 @@ namespace Inkscape { -namespace XML { - class Event; -} - /** * Aggregates UndoStackObservers for management and triggering in an SPDocument's undo/redo * system. @@ -60,7 +56,7 @@ public: * * \param log The event log generated by the redo event. */ - void issueRedo(XML::Event* log) + void issueRedo(Event* log) { this->_observer.notifyRedoEvent(log); } @@ -71,7 +67,7 @@ public: * * \param log The event log generated by the undo event. */ - void issueUndo(XML::Event* log) + void issueUndo(Event* log) { this->_observer.notifyUndoEvent(log); } @@ -82,7 +78,7 @@ public: * * \param log The event log being committed to the undo stack. */ - void issueUndoCommit(XML::Event* log) + void issueUndoCommit(Event* log) { this->_observer.notifyUndoCommitEvent(log); } @@ -120,21 +116,21 @@ public: * * \param log The event log generated by the undo event. */ - void notifyUndoEvent(XML::Event* log); + void notifyUndoEvent(Event* log); /** * Notify all registered UndoStackObservers of a redo event. * * \param log The event log generated by the redo event. */ - void notifyRedoEvent(XML::Event* log); + void notifyRedoEvent(Event* log); /** * Notify all registered UndoStackObservers of an event log being committed to the undo stack. * * \param log The event log being committed to the undo stack. */ - void notifyUndoCommitEvent(XML::Event* log); + void notifyUndoCommitEvent(Event* log); private: // Remove an observer from a given list diff --git a/src/connector-context.cpp b/src/connector-context.cpp index 7343d6250..417734fd5 100644 --- a/src/connector-context.cpp +++ b/src/connector-context.cpp @@ -713,7 +713,8 @@ connector_handle_button_release(SPConnectorContext *const cc, GdkEventButton con cc->clickeditem->setHidden(false); sp_conn_adjust_path(SP_PATH(cc->clickeditem)); cc->clickeditem->updateRepr(); - sp_document_done(doc); + sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR, + /* TODO: annotate */ "connector-context.cpp:717"); cc_set_active_conn(cc, cc->clickeditem); sp_document_ensure_up_to_date(doc); cc->state = SP_CONNECTOR_CONTEXT_IDLE; @@ -920,7 +921,8 @@ spcc_flush_white(SPConnectorContext *cc, SPCurve *gc) sp_curve_unref(c); /* Flush pending updates */ - sp_document_done(doc); + sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR, + /* TODO: annotate */ "connector-context.cpp:925"); sp_document_ensure_up_to_date(doc); } @@ -1274,7 +1276,8 @@ void cc_selection_set_avoid(bool const set_avoid) return; } - sp_document_done(document); + sp_document_done(document, SP_VERB_CONTEXT_CONNECTOR, + /* TODO: annotate */ "connector-context.cpp:1280"); } diff --git a/src/console-output-undo-observer.cpp b/src/console-output-undo-observer.cpp index 6aa49b727..7035e89fe 100644 --- a/src/console-output-undo-observer.cpp +++ b/src/console-output-undo-observer.cpp @@ -17,21 +17,21 @@ namespace Inkscape { void -ConsoleOutputUndoObserver::notifyUndoEvent(XML::Event* log) +ConsoleOutputUndoObserver::notifyUndoEvent(Event* log) { - g_message("notifyUndoEvent (sp_document_undo) called; log=%p\n", log); + // g_message("notifyUndoEvent (sp_document_undo) called; log=%p\n", log->event); } void -ConsoleOutputUndoObserver::notifyRedoEvent(XML::Event* log) +ConsoleOutputUndoObserver::notifyRedoEvent(Event* log) { - g_message("notifyRedoEvent (sp_document_redo) called; log=%p\n", log); + // g_message("notifyRedoEvent (sp_document_redo) called; log=%p\n", log->event); } void -ConsoleOutputUndoObserver::notifyUndoCommitEvent(XML::Event* log) +ConsoleOutputUndoObserver::notifyUndoCommitEvent(Event* log) { - g_message("notifyUndoCommitEvent (sp_document_maybe_done) called; log=%p\n", log); + //g_message("notifyUndoCommitEvent (sp_document_maybe_done) called; log=%p\n", log->event); } } diff --git a/src/console-output-undo-observer.h b/src/console-output-undo-observer.h index 6ab299894..32149c15d 100644 --- a/src/console-output-undo-observer.h +++ b/src/console-output-undo-observer.h @@ -17,23 +17,16 @@ namespace Inkscape { -namespace XML { - -class Event; - -} - class ConsoleOutputUndoObserver : public UndoStackObserver { public: - ConsoleOutputUndoObserver() : UndoStackObserver() { } - ~ConsoleOutputUndoObserver() { } + ConsoleOutputUndoObserver() : UndoStackObserver() { } + ~ConsoleOutputUndoObserver() { } - void notifyUndoEvent(XML::Event* log); - void notifyRedoEvent(XML::Event* log); - void notifyUndoCommitEvent(XML::Event* log); + void notifyUndoEvent(Event* log); + void notifyRedoEvent(Event* log); + void notifyUndoCommitEvent(Event* log); }; - } #endif diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index a2dc1a492..5531abfef 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -123,7 +123,8 @@ static gint sp_dt_ruler_event(GtkWidget *widget, GdkEvent *event, SPDesktopWidge sp_repr_set_svg_double(repr, "position", guide_pos_dt); SP_OBJECT_REPR(desktop->namedview)->appendChild(repr); Inkscape::GC::release(repr); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + /* TODO: annotate */ "desktop-events.cpp:127"); } desktop->set_coordinate_status(event_dt); } @@ -202,7 +203,8 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) sp_guide_remove(guide); } moved = false; - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + /* TODO: annotate */ "desktop-events.cpp:207"); desktop->set_coordinate_status(event_dt); desktop->setPosition (event_dt); } diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index e47437c72..5f6c557f1 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -863,7 +863,8 @@ clonetiler_unclump (GtkWidget *widget, void *) g_slist_free (to_unclump); - sp_document_done (sp_desktop_document (desktop)); + sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_CLONETILER, + /* TODO: annotate */ "clonetiler.cpp:867"); } static guint @@ -915,7 +916,8 @@ clonetiler_remove (GtkWidget *widget, void *, bool do_undo = true) clonetiler_change_selection (NULL, selection, dlg); if (do_undo) - sp_document_done (sp_desktop_document (desktop)); + sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_CLONETILER, + /* TODO: annotate */ "clonetiler.cpp:920"); } static NR::Rect @@ -1294,7 +1296,8 @@ clonetiler_apply (GtkWidget *widget, void *) clonetiler_change_selection (NULL, selection, dlg); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_DIALOG_CLONETILER, + /* TODO: annotate */ "clonetiler.cpp:1300"); } static GtkWidget * diff --git a/src/dialogs/fill-style.cpp b/src/dialogs/fill-style.cpp index 1efae59e1..1bdc49f7e 100644 --- a/src/dialogs/fill-style.cpp +++ b/src/dialogs/fill-style.cpp @@ -285,7 +285,8 @@ sp_fill_style_widget_fillrule_changed ( SPPaintSelector *psel, sp_repr_css_attr_unref (css); - sp_document_done (SP_ACTIVE_DOCUMENT); + sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "fill-style.cpp:289"); } static gchar *undo_label_1 = "fill:flatcolor:1"; @@ -324,7 +325,8 @@ sp_fill_style_widget_paint_dragged (SPPaintSelector *psel, SPWidget *spw) case SP_PAINT_SELECTOR_MODE_COLOR_CMYK: { sp_paint_selector_set_flat_color (psel, SP_ACTIVE_DESKTOP, "fill", "fill-opacity"); - sp_document_maybe_done (sp_desktop_document(SP_ACTIVE_DESKTOP), undo_label); + sp_document_maybe_done (sp_desktop_document(SP_ACTIVE_DESKTOP), undo_label, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "fill-style.cpp:329"); g_object_set_data (G_OBJECT (spw), "local", GINT_TO_POINTER (TRUE)); // local change, do not update from selection break; } @@ -385,7 +387,8 @@ sp_fill_style_widget_paint_changed ( SPPaintSelector *psel, sp_repr_css_attr_unref (css); - sp_document_done (document); + sp_document_done (document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "fill-style.cpp:391"); break; } @@ -393,7 +396,8 @@ sp_fill_style_widget_paint_changed ( SPPaintSelector *psel, case SP_PAINT_SELECTOR_MODE_COLOR_CMYK: { sp_paint_selector_set_flat_color (psel, desktop, "fill", "fill-opacity"); - sp_document_maybe_done (sp_desktop_document(desktop), undo_label); + sp_document_maybe_done (sp_desktop_document(desktop), undo_label, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "fill-style.cpp:400"); // on release, toggle undo_label so that the next drag will not be lumped with this one if (undo_label == undo_label_1) @@ -459,7 +463,8 @@ sp_fill_style_widget_paint_changed ( SPPaintSelector *psel, sp_repr_css_attr_unref (css); - sp_document_done (document); + sp_document_done (document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "fill-style.cpp:467"); } break; @@ -505,7 +510,8 @@ sp_fill_style_widget_paint_changed ( SPPaintSelector *psel, } // end if - sp_document_done (document); + sp_document_done (document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "fill-style.cpp:514"); } // end if @@ -519,7 +525,8 @@ sp_fill_style_widget_paint_changed ( SPPaintSelector *psel, sp_desktop_set_style (desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (document); + sp_document_done (document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "fill-style.cpp:529"); } break; diff --git a/src/dialogs/guidelinedialog.cpp b/src/dialogs/guidelinedialog.cpp index 7be2545f0..479cab8ec 100644 --- a/src/dialogs/guidelinedialog.cpp +++ b/src/dialogs/guidelinedialog.cpp @@ -73,7 +73,8 @@ void GuidelinePropertiesDialog::_onApply() ? points : _guide->position + points ); sp_guide_moveto(*_guide, newpos, true); - sp_document_done(SP_OBJECT_DOCUMENT(_guide)); + sp_document_done(SP_OBJECT_DOCUMENT(_guide), SP_VERB_NONE, + /* TODO: annotate */ "guidelinedialog.cpp:77"); } void GuidelinePropertiesDialog::_onOK() @@ -85,7 +86,8 @@ void GuidelinePropertiesDialog::_onDelete() { SPDocument *doc = SP_OBJECT_DOCUMENT(_guide); sp_guide_remove(_guide); - sp_document_done(doc); + sp_document_done(doc, SP_VERB_NONE, + /* TODO: annotate */ "guidelinedialog.cpp:90"); } void GuidelinePropertiesDialog::_response(gint response) diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp index 51b0abd61..6f12a48f1 100644 --- a/src/dialogs/item-properties.cpp +++ b/src/dialogs/item-properties.cpp @@ -345,7 +345,8 @@ sp_item_widget_sensitivity_toggled (GtkWidget *widget, SPWidget *spw) item->setLocked(gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))); - sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "ItemDialog:insensitive"); + sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "ItemDialog:insensitive", SP_VERB_NONE, + /* TODO: annotate */ "item-properties.cpp:349"); gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (FALSE)); } @@ -363,7 +364,8 @@ sp_item_widget_hidden_toggled(GtkWidget *widget, SPWidget *spw) item->setExplicitlyHidden(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); - sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "ItemDialog:visiblity"); + sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "ItemDialog:visiblity", SP_VERB_NONE, + /* TODO: annotate */ "item-properties.cpp:368"); gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (FALSE)); } @@ -395,7 +397,8 @@ sp_item_widget_label_changed (GtkWidget *widget, SPWidget *spw) gtk_label_set_markup_with_mnemonic (GTK_LABEL (id_label), _("_Id")); SP_EXCEPTION_INIT (&ex); sp_object_setAttribute (SP_OBJECT (item), "id", id, &ex); - sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "ItemDialog:id"); + sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "ItemDialog:id", SP_VERB_NONE, + /* TODO: annotate */ "item-properties.cpp:401"); } /* Retrieve the label widget for the object's label */ @@ -409,7 +412,8 @@ sp_item_widget_label_changed (GtkWidget *widget, SPWidget *spw) SPObject *obj = (SPObject*)item; if (strcmp (label, obj->defaultLabel())) { obj->setLabel(label); - sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "inkscape:label"); + sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "inkscape:label", SP_VERB_NONE, + /* TODO: annotate */ "item-properties.cpp:416"); } /* Retrieve the title */ @@ -417,14 +421,16 @@ sp_item_widget_label_changed (GtkWidget *widget, SPWidget *spw) gchar *title = (gchar *)gtk_entry_get_text (GTK_ENTRY (w)); if (title != NULL) { obj->setTitle(title); - sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "title"); + sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "title", SP_VERB_NONE, + /* TODO: annotate */ "item-properties.cpp:425"); } /* Retrieve the description */ gchar *desc = NULL; /* TODO: get text from text buffer */ if (desc != NULL) { obj->setDesc(desc); - sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "desc"); + sp_document_maybe_done (SP_ACTIVE_DOCUMENT, "desc", SP_VERB_NONE, + /* TODO: annotate */ "item-properties.cpp:433"); } gtk_object_set_data (GTK_OBJECT (spw), "blocked", GUINT_TO_POINTER (FALSE)); diff --git a/src/dialogs/layer-properties.cpp b/src/dialogs/layer-properties.cpp index e407c7082..e35cc9550 100644 --- a/src/dialogs/layer-properties.cpp +++ b/src/dialogs/layer-properties.cpp @@ -111,7 +111,8 @@ LayerPropertiesDialog::_apply() g_assert(_strategy != NULL); _strategy->perform(*this); - sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP)); + sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE, + /* TODO: annotate */ "layer-properties.cpp:115"); _close(); } @@ -190,7 +191,8 @@ void LayerPropertiesDialog::Rename::perform(LayerPropertiesDialog &dialog) { desktop->layer_manager->renameLayer( desktop->currentLayer(), ( name.empty() ? NULL : (gchar *)name.c_str() ) ); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + /* TODO: annotate */ "layer-properties.cpp:195"); // TRANSLATORS: This means "The layer has been renamed" desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Renamed layer")); } diff --git a/src/dialogs/layers-panel.cpp b/src/dialogs/layers-panel.cpp index e89e5050d..3a7463ff3 100644 --- a/src/dialogs/layers-panel.cpp +++ b/src/dialogs/layers-panel.cpp @@ -587,7 +587,8 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol ) row[_model->_colVisible] = newValue; item->setHidden( !newValue ); item->updateRepr(); - sp_document_done( _desktop->doc() ); + sp_document_done( _desktop->doc() , SP_VERB_DIALOG_LAYERS, + /* TODO: annotate */ "layers-panel.cpp:591"); } break; @@ -597,7 +598,8 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol ) row[_model->_colLocked] = newValue; item->setLocked( newValue ); item->updateRepr(); - sp_document_done( _desktop->doc() ); + sp_document_done( _desktop->doc() , SP_VERB_DIALOG_LAYERS, + /* TODO: annotate */ "layers-panel.cpp:602"); } break; } @@ -693,7 +695,8 @@ void LayersPanel::_opacityChanged() sp_repr_css_attr_unref( css ); - sp_document_maybe_done( _desktop->doc(), "layers:opacity" ); + sp_document_maybe_done( _desktop->doc(), "layers:opacity", SP_VERB_NONE, + /* TODO: annotate */ "layers-panel.cpp:699" ); _opacityConnection.unblock(); } diff --git a/src/dialogs/object-properties.cpp b/src/dialogs/object-properties.cpp index 7be1b8a1c..f96949f5b 100644 --- a/src/dialogs/object-properties.cpp +++ b/src/dialogs/object-properties.cpp @@ -307,7 +307,8 @@ sp_fillstroke_opacity_changed (GtkAdjustment *a, SPWidget *dlg) sp_repr_css_attr_unref (css); - sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:opacity"); + sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "fillstroke:opacity", SP_VERB_NONE, + /* TODO: annotate */ "object-properties.cpp:311"); gtk_object_set_data (GTK_OBJECT (dlg), "blocked", GUINT_TO_POINTER (FALSE)); } diff --git a/src/dialogs/sp-attribute-widget.cpp b/src/dialogs/sp-attribute-widget.cpp index d7c4316e1..670da965e 100644 --- a/src/dialogs/sp-attribute-widget.cpp +++ b/src/dialogs/sp-attribute-widget.cpp @@ -156,7 +156,8 @@ sp_attribute_widget_changed (GtkEditable *editable) text = SP_OBJECT_REPR (spaw->src.object)->attribute(spaw->attribute); gtk_entry_set_text (GTK_ENTRY (spaw), text ? text : ""); } - sp_document_done (SP_OBJECT_DOCUMENT (spaw->src.object)); + sp_document_done (SP_OBJECT_DOCUMENT (spaw->src.object), SP_VERB_NONE, + /* TODO: annotate */ "sp-attribute-widget.cpp:160"); } else if (spaw->src.repr) { @@ -767,7 +768,8 @@ sp_attribute_table_entry_changed ( GtkEditable *editable, gtk_entry_set_text ( GTK_ENTRY (spat->entries[i]), text ? text : (const gchar *) ""); } - sp_document_done (SP_OBJECT_DOCUMENT (spat->src.object)); + sp_document_done (SP_OBJECT_DOCUMENT (spat->src.object), SP_VERB_NONE, + /* TODO: annotate */ "sp-attribute-widget.cpp:772"); } else if (spat->src.repr) { diff --git a/src/dialogs/stroke-style.cpp b/src/dialogs/stroke-style.cpp index 8f345d837..80099eb82 100644 --- a/src/dialogs/stroke-style.cpp +++ b/src/dialogs/stroke-style.cpp @@ -261,7 +261,8 @@ sp_stroke_style_paint_dragged(SPPaintSelector *psel, SPWidget *spw) case SP_PAINT_SELECTOR_MODE_COLOR_CMYK: { sp_paint_selector_set_flat_color (psel, SP_ACTIVE_DESKTOP, "stroke", "stroke-opacity"); - sp_document_maybe_done (sp_desktop_document(SP_ACTIVE_DESKTOP), undo_label); + sp_document_maybe_done (sp_desktop_document(SP_ACTIVE_DESKTOP), undo_label, SP_VERB_NONE, + /* TODO: annotate */ "stroke-style.cpp:265"); break; } @@ -306,7 +307,8 @@ sp_stroke_style_paint_changed(SPPaintSelector *psel, SPWidget *spw) sp_repr_css_attr_unref(css); - sp_document_done(document); + sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "stroke-style.cpp:311"); break; } @@ -314,7 +316,8 @@ sp_stroke_style_paint_changed(SPPaintSelector *psel, SPWidget *spw) case SP_PAINT_SELECTOR_MODE_COLOR_CMYK: { sp_paint_selector_set_flat_color (psel, desktop, "stroke", "stroke-opacity"); - sp_document_maybe_done (sp_desktop_document(desktop), undo_label); + sp_document_maybe_done (sp_desktop_document(desktop), undo_label, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "stroke-style.cpp:320"); // on release, toggle undo_label so that the next drag will not be lumped with this one if (undo_label == undo_label_1) @@ -365,7 +368,8 @@ sp_stroke_style_paint_changed(SPPaintSelector *psel, SPWidget *spw) } } - sp_document_done(document); + sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "stroke-style.cpp:372"); } break; @@ -408,7 +412,8 @@ sp_stroke_style_paint_changed(SPPaintSelector *psel, SPWidget *spw) } // end if - sp_document_done (document); + sp_document_done (document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "stroke-style.cpp:416"); } // end if break; @@ -421,7 +426,8 @@ sp_stroke_style_paint_changed(SPPaintSelector *psel, SPWidget *spw) sp_desktop_set_style (desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (document); + sp_document_done (document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "stroke-style.cpp:430"); } break; @@ -879,7 +885,8 @@ sp_marker_select(GtkOptionMenu *mnu, GtkWidget *spw) sp_repr_css_attr_unref(css); - sp_document_done(document); + sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "stroke-style.cpp:889"); } static gboolean stroke_width_set_unit(SPUnitSelector *, @@ -1451,7 +1458,8 @@ sp_stroke_style_scale_line(SPWidget *spw) sp_repr_css_attr_unref(css); - sp_document_done(document); + sp_document_done(document, SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "stroke-style.cpp:1462"); gtk_object_set_data(GTK_OBJECT(spw), "update", GINT_TO_POINTER(FALSE)); } @@ -1537,7 +1545,8 @@ sp_stroke_style_any_toggled(GtkToggleButton *tb, SPWidget *spw) sp_repr_css_attr_unref(css); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "stroke-style.cpp:1549"); } } diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index 50da61539..1f5ae5c7c 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -417,7 +417,8 @@ void ColorItem::_colorDefChanged(void* data) str = 0; if ( bruteForce( document, rroot, paletteName, item->def.getR(), item->def.getG(), item->def.getB() ) ) { - sp_document_done( document ); + sp_document_done( document , SP_VERB_DIALOG_SWATCHES, + /* TODO: annotate */ "swatches.cpp:421"); } } } @@ -551,7 +552,8 @@ void ColorItem::buttonClicked(bool secondary) sp_desktop_set_style(desktop, css); sp_repr_css_attr_unref(css); - sp_document_done (sp_desktop_document (desktop)); + sp_document_done (sp_desktop_document (desktop), SP_VERB_DIALOG_SWATCHES, + /* TODO: annotate */ "swatches.cpp:556"); } } diff --git a/src/dialogs/text-edit.cpp b/src/dialogs/text-edit.cpp index 30e7f7a0e..8ea0a7236 100644 --- a/src/dialogs/text-edit.cpp +++ b/src/dialogs/text-edit.cpp @@ -630,7 +630,8 @@ sp_text_edit_dialog_apply (GtkButton *button, GtkWidget *dlg) } // complete the transaction - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-edit.cpp:634"); gtk_widget_set_sensitive (apply, FALSE); sp_repr_css_attr_unref (css); g_object_set_data (G_OBJECT (dlg), "blocked", GINT_TO_POINTER (FALSE)); diff --git a/src/dialogs/tiledialog.cpp b/src/dialogs/tiledialog.cpp index 72b1cdaa8..ed8e19a05 100644 --- a/src/dialogs/tiledialog.cpp +++ b/src/dialogs/tiledialog.cpp @@ -326,7 +326,8 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h NRRect b; selection->bounds(&b); - sp_document_done (sp_desktop_document (desktop)); + sp_document_done (sp_desktop_document (desktop), SP_VERB_NONE, + /* TODO: annotate */ "tiledialog.cpp:330"); } diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp index 6b37b65d4..e515a3f37 100644 --- a/src/dialogs/xml-tree.cpp +++ b/src/dialogs/xml-tree.cpp @@ -884,7 +884,8 @@ void after_tree_move(GtkCTree *tree, if (GTK_CTREE_ROW(node)->parent == new_parent && GTK_CTREE_ROW(node)->sibling == new_sibling) { - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:888"); } else { sp_document_cancel(current_document); } @@ -1383,7 +1384,8 @@ void cmd_new_text_node(GtkObject *object, gpointer data) Inkscape::XML::Node *text = sp_repr_new_text(""); selected_repr->appendChild(text); - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1388"); set_tree_select(text); set_dt_select(text); @@ -1400,7 +1402,8 @@ void cmd_duplicate_node(GtkObject *object, gpointer data) Inkscape::XML::Node *dup = selected_repr->duplicate(); parent->addChild(dup, selected_repr); - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1406"); GtkCTreeNode *node = sp_xmlview_tree_get_repr_node(SP_XMLVIEW_TREE(tree), dup); @@ -1416,7 +1419,8 @@ void cmd_delete_node(GtkObject *object, gpointer data) g_assert(selected_repr != NULL); sp_repr_unparent(selected_repr); - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1423"); } @@ -1433,7 +1437,8 @@ void cmd_delete_attr(GtkObject *object, gpointer data) updated->updateRepr(); } - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1441"); } @@ -1465,7 +1470,8 @@ void cmd_set_attr(GtkObject *object, gpointer data) updated->updateRepr(); } - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1474"); /* TODO: actually, the row won't have been created yet. why? */ gint row = sp_xmlview_attr_list_find_row_from_key(GTK_CLIST(attributes), @@ -1494,7 +1500,8 @@ void cmd_raise_node(GtkObject *object, gpointer data) parent->changeOrder(selected_repr, ref); - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1504"); set_tree_select(selected_repr); set_dt_select(selected_repr); @@ -1510,7 +1517,8 @@ void cmd_lower_node(GtkObject *object, gpointer data) parent->changeOrder(selected_repr, selected_repr->next()); - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1521"); set_tree_select(selected_repr); set_dt_select(selected_repr); @@ -1539,7 +1547,8 @@ void cmd_indent_node(GtkObject *object, gpointer data) parent->removeChild(repr); prev->addChild(repr, ref); - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1551"); set_tree_select(repr); set_dt_select(repr); @@ -1559,7 +1568,8 @@ void cmd_unindent_node(GtkObject *object, gpointer data) parent->removeChild(repr); grandparent->addChild(repr, parent); - sp_document_done(current_document); + sp_document_done(current_document, SP_VERB_DIALOG_XML_EDITOR, + /* TODO: annotate */ "xml-tree.cpp:1572"); set_tree_select(repr); set_dt_select(repr); diff --git a/src/document-private.h b/src/document-private.h index 549a4530f..18d35f446 100644 --- a/src/document-private.h +++ b/src/document-private.h @@ -22,6 +22,8 @@ #include "composite-undo-stack-observer.h" +#include "event-log.h" + // XXX only for testing! #include "console-output-undo-observer.h" @@ -65,6 +67,9 @@ struct SPDocumentPrivate { /* Undo listener */ Inkscape::CompositeUndoStackObserver undoStackObservers; + /* Event log */ + Inkscape::EventLog event_log; + // XXX only for testing! Inkscape::ConsoleOutputUndoObserver console_output_undo_observer; }; diff --git a/src/document-undo.cpp b/src/document-undo.cpp index f37a3fcaf..35b35c888 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -22,7 +22,7 @@ * stack. Two methods exist to indicate that the given action is completed: * * \verbatim - void sp_document_done (SPDocument *document) + void sp_document_done (SPDocument *document); void sp_document_maybe_done (SPDocument *document, const unsigned char *key) \endverbatim * * Both move the recent action list into the undo stack and clear the @@ -62,6 +62,7 @@ #include "inkscape.h" #include "debug/event-tracker.h" #include "debug/simple-event.h" +#include "event.h" /* @@ -108,9 +109,9 @@ gboolean sp_document_get_undo_sensitive(SPDocument const *document) { } void -sp_document_done (SPDocument *doc) +sp_document_done (SPDocument *doc, const unsigned int event_type, Glib::ustring event_description) { - sp_document_maybe_done (doc, NULL); + sp_document_maybe_done (doc, NULL, event_type, event_description); } void @@ -121,7 +122,8 @@ sp_document_reset_key (Inkscape::Application *inkscape, SPDesktop *desktop, GtkO } void -sp_document_maybe_done (SPDocument *doc, const gchar *key) +sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int event_type, + Glib::ustring event_description) { g_assert (doc != NULL); g_assert (doc->priv != NULL); @@ -142,11 +144,14 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key) } if (key && doc->actionkey && !strcmp (key, doc->actionkey) && doc->priv->undo) { - doc->priv->undo->data = sp_repr_coalesce_log ((Inkscape::XML::Event *)doc->priv->undo->data, log); + doc->priv->undo->data = + new Inkscape::Event(sp_repr_coalesce_log (((Inkscape::Event *) + doc->priv->undo->data)->event, log)); } else { - doc->priv->undo = g_slist_prepend (doc->priv->undo, log); + Inkscape::Event *event = new Inkscape::Event(log, event_type, event_description); + doc->priv->undo = g_slist_prepend (doc->priv->undo, event); doc->priv->history_size++; - doc->priv->undoStackObservers.notifyUndoCommitEvent(log); + doc->priv->undoStackObservers.notifyUndoCommitEvent(event); } doc->actionkey = key; @@ -214,13 +219,13 @@ sp_document_undo (SPDocument *doc) finish_incomplete_transaction(*doc); if (doc->priv->undo) { - Inkscape::XML::Event *log=(Inkscape::XML::Event *)doc->priv->undo->data; + Inkscape::Event *log=(Inkscape::Event *)doc->priv->undo->data; doc->priv->undo = g_slist_remove (doc->priv->undo, log); - sp_repr_undo_log (log); + sp_repr_undo_log (log->event); doc->priv->redo = g_slist_prepend (doc->priv->redo, log); doc->rroot->setAttribute("sodipodi:modified", "true"); - doc->priv->undoStackObservers.notifyUndoEvent(log); + doc->priv->undoStackObservers.notifyUndoEvent(log); ret = TRUE; } else { @@ -258,9 +263,9 @@ sp_document_redo (SPDocument *doc) finish_incomplete_transaction(*doc); if (doc->priv->redo) { - Inkscape::XML::Event *log=(Inkscape::XML::Event *)doc->priv->redo->data; + Inkscape::Event *log=(Inkscape::Event *)doc->priv->redo->data; doc->priv->redo = g_slist_remove (doc->priv->redo, log); - sp_repr_replay_log (log); + sp_repr_replay_log (log->event); doc->priv->undo = g_slist_prepend (doc->priv->undo, log); doc->rroot->setAttribute("sodipodi:modified", "true"); @@ -291,7 +296,7 @@ sp_document_clear_undo (SPDocument *doc) doc->priv->undo = current->next; doc->priv->history_size--; - sp_repr_free_log ((Inkscape::XML::Event *)current->data); + delete ((Inkscape::Event *) current->data); g_slist_free_1 (current); } } @@ -306,7 +311,7 @@ sp_document_clear_redo (SPDocument *doc) doc->priv->redo = current->next; doc->priv->history_size--; - sp_repr_free_log ((Inkscape::XML::Event *)current->data); + delete ((Inkscape::Event *) current->data); g_slist_free_1 (current); } } diff --git a/src/document.cpp b/src/document.cpp index cf03f4188..a6b6e4e45 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -105,6 +105,8 @@ SPDocument::SPDocument() { p->undo = NULL; p->redo = NULL; + p->undoStackObservers.add(p->event_log); + priv = p; // XXX only for testing! @@ -648,6 +650,12 @@ SPDocument::removeUndoObserver(Inkscape::UndoStackObserver& observer) this->priv->undoStackObservers.remove(observer); } +Inkscape::EventLog& +SPDocument::getEventLog() const +{ + return priv->event_log; +} + SPObject *SPDocument::getObjectById(gchar const *id) { g_return_val_if_fail(id != NULL, NULL); diff --git a/src/document.h b/src/document.h index 9739b6971..f7ce73fe8 100644 --- a/src/document.h +++ b/src/document.h @@ -27,6 +27,7 @@ #include "gc-finalized.h" #include "gc-anchored.h" #include +#include "verbs.h" namespace Avoid { class Router; @@ -42,6 +43,7 @@ namespace Inkscape { struct Application; class Selection; class UndoStackObserver; + class EventLog; namespace XML { class Document; class Node; @@ -111,6 +113,8 @@ struct SPDocument : public Inkscape::GC::Managed<>, void addUndoObserver(Inkscape::UndoStackObserver& observer); void removeUndoObserver(Inkscape::UndoStackObserver& observer); + Inkscape::EventLog& getEventLog() const; + private: SPDocument(SPDocument const &); // no copy void operator=(SPDocument const &); // no assign @@ -184,8 +188,8 @@ void sp_document_request_modified (SPDocument *doc); gint sp_document_ensure_up_to_date (SPDocument *doc); /* Save all previous actions to stack, as one undo step */ -void sp_document_done (SPDocument *document); -void sp_document_maybe_done (SPDocument *document, const gchar *key); +void sp_document_done (SPDocument *document, unsigned int event_type, Glib::ustring event_description); +void sp_document_maybe_done (SPDocument *document, const gchar *keyconst, unsigned int event_type, Glib::ustring event_description); void sp_document_reset_key (Inkscape::Application *inkscape, SPDesktop *desktop, GtkObject *base); /* Cancel (and revert) current unsaved actions */ diff --git a/src/draw-context.cpp b/src/draw-context.cpp index 6bea0851b..bb1f56044 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -557,7 +557,8 @@ spdc_flush_white(SPDrawContext *dc, SPCurve *gc) item->updateRepr(); } - sp_document_done(doc); + sp_document_done(doc, SP_IS_PEN_CONTEXT(dc)? SP_VERB_CONTEXT_PEN : SP_VERB_CONTEXT_PENCIL, + /* TODO: annotate */ "draw-context.cpp:561"); } sp_curve_unref(c); diff --git a/src/dropper-context.cpp b/src/dropper-context.cpp index b05c92bc0..ba9949b8b 100644 --- a/src/dropper-context.cpp +++ b/src/dropper-context.cpp @@ -385,7 +385,8 @@ static gint sp_dropper_context_root_handler(SPEventContext *ec, GdkEvent *event) if (!(sp_desktop_selection(ec->desktop)->isEmpty())) { - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_DROPPER, + /* TODO: annotate */ "dropper-context.cpp:389"); } ret = TRUE; diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 0e330aaad..3233198f6 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -685,7 +685,8 @@ set_to_accumulated(SPDynaDrawContext *dc) dc->repr = NULL; } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_CALLIGRAPHIC, + /* TODO: annotate */ "dyna-draw-context.cpp:689"); } static void diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index aefdeefa7..2f884aa1c 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -222,7 +222,8 @@ Effect::effect (Inkscape::UI::View::View * doc) set_last_effect(this); imp->effect(this, doc); - sp_document_done(doc->doc()); + sp_document_done(doc->doc(), SP_VERB_NONE, + /* TODO: annotate */ "effect.cpp:226"); return; } diff --git a/src/file.cpp b/src/file.cpp index 679c28801..0ad55e2ac 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -511,7 +511,8 @@ sp_file_vacuum() unsigned int diff = vacuum_document (doc); - sp_document_done(doc); + sp_document_done(doc, SP_VERB_FILE_VACUUM, + /* TODO: annotate */ "file.cpp:515"); SPDesktop *dt = SP_ACTIVE_DESKTOP; if (diff > 0) { @@ -895,7 +896,8 @@ file_import(SPDocument *in_doc, gchar const *uri, Inkscape::Extension::Extension } sp_document_unref(doc); - sp_document_done(in_doc); + sp_document_done(in_doc, SP_VERB_FILE_IMPORT, + /* TODO: annotate */ "file.cpp:900"); } else { gchar *text = g_strdup_printf(_("Failed to load the requested file %s"), uri); diff --git a/src/gradient-context.cpp b/src/gradient-context.cpp index 56fe5c7d8..bf1281f82 100644 --- a/src/gradient-context.cpp +++ b/src/gradient-context.cpp @@ -160,7 +160,8 @@ static gint sp_gradient_context_root_handler(SPEventContext *event_context, GdkE sp_gradient_reset_to_userspace(priv, item); } - sp_document_done (sp_desktop_document (desktop)); + sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-context.cpp:164"); ret = TRUE; } @@ -365,7 +366,8 @@ static gint sp_gradient_context_root_handler(SPEventContext *event_context, GdkE } } // we did an undoable action - sp_document_done (sp_desktop_document (desktop)); + sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-context.cpp:370"); ret = TRUE; } break; diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 008397e89..e4c7a62da 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -382,7 +382,8 @@ 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_desktop_document (d_new->parent->desktop)); + sp_document_done (sp_desktop_document (d_new->parent->desktop), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-drag.cpp:386"); return; } } @@ -513,7 +514,8 @@ gr_knot_ungrabbed_handler (SPKnot *knot, unsigned int state, gpointer data) dragger->updateDependencies(true); // we did an undoable action - sp_document_done (sp_desktop_document (dragger->parent->desktop)); + sp_document_done (sp_desktop_document (dragger->parent->desktop), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-drag.cpp:518"); } /** @@ -1065,7 +1067,8 @@ GrDrag::selected_move (double x, double y) selected->updateDependencies(true); // we did an undoable action - sp_document_done (sp_desktop_document (desktop)); + sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-drag.cpp:1071"); } void diff --git a/src/interface.cpp b/src/interface.cpp index 2f4a4d033..91a26226f 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -1043,7 +1043,8 @@ sp_ui_drag_data_received(GtkWidget *widget, item->updateRepr(); SPDocument *doc = SP_ACTIVE_DOCUMENT; - sp_document_done( doc ); + sp_document_done( doc , SP_VERB_NONE, + /* TODO: annotate */ "interface.cpp:1047"); if ( srgbProf ) { cmsCloseProfile( srgbProf ); @@ -1084,7 +1085,8 @@ sp_ui_drag_data_received(GtkWidget *widget, item->updateRepr(); SPDocument *doc = SP_ACTIVE_DOCUMENT; - sp_document_done( doc ); + sp_document_done( doc , SP_VERB_NONE, + /* TODO: annotate */ "interface.cpp:1089"); } } } @@ -1137,7 +1139,8 @@ sp_ui_drag_data_received(GtkWidget *widget, } Inkscape::GC::release(newgroup); - sp_document_done(doc); + sp_document_done(doc, SP_VERB_NONE, + /* TODO: annotate */ "interface.cpp:1143"); break; } @@ -1196,7 +1199,8 @@ sp_ui_drag_data_received(GtkWidget *widget, desktop->currentLayer()->appendChildRepr(newImage); Inkscape::GC::release(newImage); - sp_document_done( doc ); + sp_document_done( doc , SP_VERB_NONE, + /* TODO: annotate */ "interface.cpp:1203"); break; } } 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 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"); } } diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h index 66d1acb89..b3709c9d4 100644 --- a/src/menus-skeleton.h +++ b/src/menus-skeleton.h @@ -54,6 +54,7 @@ static char const menus_skeleton[] = " \n" " \n" " \n" +" \n" " \n" " \n" " \n" @@ -130,6 +131,7 @@ static char const menus_skeleton[] = " \n" " \n" " \n" +" \n" " \n" " \n" " \n" diff --git a/src/nodepath.cpp b/src/nodepath.cpp index f9f6f1691..455a0e7d8 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -40,6 +40,7 @@ #include "libnr/nr-matrix-ops.h" #include "splivarot.h" #include "svg/svg.h" +#include "verbs.h" #include "display/bezier-utils.h" #include #include @@ -479,7 +480,8 @@ static void update_repr_internal(Inkscape::NodePath::Path *np) void sp_nodepath_update_repr(Inkscape::NodePath::Path *np) { update_repr_internal(np); - sp_document_done(sp_desktop_document(np->desktop)); + sp_document_done(sp_desktop_document(np->desktop), SP_VERB_CONTEXT_NODE, + /* TODO: annotate */ "nodepath.cpp:484"); if (np->livarot_path) { delete np->livarot_path; @@ -499,7 +501,8 @@ void sp_nodepath_update_repr(Inkscape::NodePath::Path *np) static void sp_nodepath_update_repr_keyed(Inkscape::NodePath::Path *np, gchar const *key) { update_repr_internal(np); - sp_document_maybe_done(sp_desktop_document(np->desktop), key); + sp_document_maybe_done(sp_desktop_document(np->desktop), key, SP_VERB_CONTEXT_NODE, + /* TODO: annotate */ "nodepath.cpp:505"); if (np->livarot_path) { delete np->livarot_path; @@ -541,7 +544,8 @@ static void stamp_repr(Inkscape::NodePath::Path *np) // move to the saved position new_repr->setPosition(pos > 0 ? pos : 0); - sp_document_done(sp_desktop_document(np->desktop)); + sp_document_done(sp_desktop_document(np->desktop), SP_VERB_CONTEXT_NODE, + /* TODO: annotate */ "nodepath.cpp:548"); Inkscape::GC::release(new_repr); g_free(svgpath); @@ -2003,7 +2007,8 @@ void sp_node_delete_preserve(GList *nodes_to_delete) //delete this nodepath's object, not the entire selection! (though at this time, this //does not matter) sp_selection_delete(); - sp_document_done (document); + sp_document_done (document, SP_VERB_CONTEXT_NODE, + /* TODO: annotate */ "nodepath.cpp:2011"); } else { sp_nodepath_update_repr(nodepath); sp_nodepath_update_statusbar(nodepath); @@ -2039,7 +2044,8 @@ void sp_node_selected_delete() sp_nodepath_get_node_count(nodepath) < 2) { SPDocument *document = sp_desktop_document (nodepath->desktop); sp_selection_delete(); - sp_document_done (document); + sp_document_done (document, SP_VERB_CONTEXT_NODE, + /* TODO: annotate */ "nodepath.cpp:2048"); return; } diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index ba181476f..61e61bee3 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -135,7 +135,8 @@ sp_selected_path_combine(void) // move to the position of the topmost, reduced by the number of deleted items repr->setPosition(topmost > 0 ? topmost + 1 : 0); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_COMBINE, + /* TODO: annotate */ "path-chemistry.cpp:139"); selection->set(repr); @@ -228,7 +229,8 @@ sp_selected_path_break_apart(void) } if (did) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_BREAK_APART, + /* TODO: annotate */ "path-chemistry.cpp:233"); } else { sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No path(s) to break apart in the selection.")); return; @@ -294,7 +296,8 @@ sp_selected_path_to_curves0(gboolean interactive, guint32 text_grouping_policy) if (interactive) { if (did) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_TO_CURVE, + /* TODO: annotate */ "path-chemistry.cpp:300"); } else { sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No objects to convert to path in the selection.")); return; @@ -371,7 +374,8 @@ sp_selected_path_reverse() } if (did) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_REVERSE, + /* TODO: annotate */ "path-chemistry.cpp:378"); } else { sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No paths to reverse in the selection.")); } diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h index 3edfe4918..f8759d8c2 100644 --- a/src/preferences-skeleton.h +++ b/src/preferences-skeleton.h @@ -155,6 +155,7 @@ static char const preferences_skeleton[] = " \n" " \n" " \n" +" \n" " \n" " \n" " \n" diff --git a/src/rect-context.cpp b/src/rect-context.cpp index ffd57c415..7e1b76e2c 100644 --- a/src/rect-context.cpp +++ b/src/rect-context.cpp @@ -486,7 +486,8 @@ static void sp_rect_finish(SPRectContext *rc) SP_OBJECT(rc->item)->updateRepr(); sp_desktop_selection(dt)->set(rc->item); - sp_document_done(sp_desktop_document(dt)); + sp_document_done(sp_desktop_document(dt), SP_VERB_CONTEXT_RECT, + /* TODO: annotate */ "rect-context.cpp:490"); rc->item = NULL; } diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 352a0b6ad..ca2768a88 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -213,7 +213,8 @@ void sp_selection_delete() if (tools_isactive (desktop, TOOLS_TEXT)) if (sp_text_delete_selection(desktop->event_context)) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "selection-chemistry.cpp:217"); return; } @@ -238,7 +239,8 @@ void sp_selection_delete() */ tools_switch ( desktop, tools_active ( desktop ) ); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DELETE, + /* TODO: annotate */ "selection-chemistry.cpp:243"); } /* fixme: sequencing */ @@ -276,7 +278,8 @@ void sp_selection_duplicate() Inkscape::GC::release(copy); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_DUPLICATE, + /* TODO: annotate */ "selection-chemistry.cpp:282"); selection->setReprList(newsel); @@ -300,7 +303,8 @@ void sp_edit_clear_all() items = g_slist_remove(items, items->data); } - sp_document_done(doc); + sp_document_done(doc, SP_VERB_EDIT_CLEAR_ALL, + /* TODO: annotate */ "selection-chemistry.cpp:307"); } GSList * @@ -501,7 +505,8 @@ void sp_selection_group() // Move to the position of the topmost, reduced by the number of items deleted from topmost_parent group->setPosition(topmost + 1); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_GROUP, + /* TODO: annotate */ "selection-chemistry.cpp:509"); selection->set(group); Inkscape::GC::release(group); @@ -562,7 +567,8 @@ void sp_selection_ungroup() g_slist_free(items); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_UNGROUP, + /* TODO: annotate */ "selection-chemistry.cpp:571"); } static SPGroup * @@ -663,7 +669,8 @@ sp_selection_raise() rev = g_slist_remove(rev, child); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_RAISE, + /* TODO: annotate */ "selection-chemistry.cpp:673"); } void sp_selection_raise_to_top() @@ -698,7 +705,8 @@ void sp_selection_raise_to_top() g_slist_free(rl); - sp_document_done(document); + sp_document_done(document, SP_VERB_SELECTION_TO_FRONT, + /* TODO: annotate */ "selection-chemistry.cpp:709"); } void @@ -754,7 +762,8 @@ sp_selection_lower() rev = g_slist_remove(rev, child); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_LOWER, + /* TODO: annotate */ "selection-chemistry.cpp:766"); } @@ -802,7 +811,8 @@ void sp_selection_lower_to_bottom() g_slist_free(rl); - sp_document_done(document); + sp_document_done(document, SP_VERB_SELECTION_TO_BACK, + /* TODO: annotate */ "selection-chemistry.cpp:815"); } void @@ -1110,7 +1120,8 @@ void sp_selection_paste(bool in_place) sp_selection_move_relative(selection, m); } - sp_document_done(document); + sp_document_done(document, SP_VERB_EDIT_PASTE, + /* TODO: annotate */ "selection-chemistry.cpp:1124"); } void sp_selection_paste_style() @@ -1136,7 +1147,8 @@ void sp_selection_paste_style() sp_desktop_set_style (desktop, style_clipboard); - sp_document_done(sp_desktop_document (desktop)); + sp_document_done(sp_desktop_document (desktop), SP_VERB_EDIT_PASTE_STYLE, + /* TODO: annotate */ "selection-chemistry.cpp:1151"); } void sp_selection_paste_size (bool apply_x, bool apply_y) @@ -1171,7 +1183,8 @@ void sp_selection_paste_size (bool apply_x, bool apply_y) apply_x? scale_x : (desktop->isToolboxButtonActive ("lock")? scale_y : 1.0), apply_y? scale_y : (desktop->isToolboxButtonActive ("lock")? scale_x : 1.0))); - sp_document_done(sp_desktop_document (desktop)); + sp_document_done(sp_desktop_document (desktop), SP_VERB_EDIT_PASTE_SIZE, + /* TODO: annotate */ "selection-chemistry.cpp:1187"); } void sp_selection_paste_size_separately (bool apply_x, bool apply_y) @@ -1211,7 +1224,8 @@ void sp_selection_paste_size_separately (bool apply_x, bool apply_y) } - sp_document_done(sp_desktop_document (desktop)); + sp_document_done(sp_desktop_document (desktop), SP_VERB_EDIT_PASTE_SIZE_SEPARATELY, + /* TODO: annotate */ "selection-chemistry.cpp:1228"); } void sp_selection_to_next_layer () @@ -1246,7 +1260,8 @@ void sp_selection_to_next_layer () g_slist_free (copied); if (temp_clip) g_slist_free (temp_clip); if (next) dt->setCurrentLayer(next); - sp_document_done(sp_desktop_document (dt)); + sp_document_done(sp_desktop_document (dt), SP_VERB_LAYER_MOVE_TO_NEXT, + /* TODO: annotate */ "selection-chemistry.cpp:1264"); } else { no_more = true; } @@ -1290,7 +1305,8 @@ void sp_selection_to_prev_layer () g_slist_free (copied); if (temp_clip) g_slist_free (temp_clip); if (next) dt->setCurrentLayer(next); - sp_document_done(sp_desktop_document (dt)); + sp_document_done(sp_desktop_document (dt), SP_VERB_LAYER_MOVE_TO_PREV, + /* TODO: annotate */ "selection-chemistry.cpp:1309"); } else { no_more = true; } @@ -1437,7 +1453,8 @@ void sp_selection_remove_transform() l = l->next; } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_FLATTEN, + /* TODO: annotate */ "selection-chemistry.cpp:1457"); } void @@ -1545,7 +1562,8 @@ void sp_selection_rotate_90_cw() sp_item_rotate_rel(item, rot_neg_90); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_ROTATE_90_CCW, + /* TODO: annotate */ "selection-chemistry.cpp:1566"); } @@ -1572,7 +1590,8 @@ void sp_selection_rotate_90_ccw() sp_item_rotate_rel(item, rot_neg_90); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_ROTATE_90_CW, + /* TODO: annotate */ "selection-chemistry.cpp:1594"); } void @@ -1588,7 +1607,9 @@ sp_selection_rotate(Inkscape::Selection *selection, gdouble const angle_degrees) sp_document_maybe_done(sp_desktop_document(selection->desktop()), ( ( angle_degrees > 0 ) ? "selector:rotate:ccw" - : "selector:rotate:cw" )); + : "selector:rotate:cw" ), + SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1612"); } /** @@ -1615,7 +1636,9 @@ sp_selection_rotate_screen(Inkscape::Selection *selection, gdouble angle) sp_document_maybe_done(sp_desktop_document(selection->desktop()), ( (angle > 0) ? "selector:rotate:ccw" - : "selector:rotate:cw" )); + : "selector:rotate:cw" ), + SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1641"); } void @@ -1639,7 +1662,9 @@ sp_selection_scale(Inkscape::Selection *selection, gdouble grow) sp_document_maybe_done(sp_desktop_document(selection->desktop()), ( (grow > 0) ? "selector:scale:larger" - : "selector:scale:smaller" )); + : "selector:scale:smaller" ), + SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1667"); } void @@ -1657,7 +1682,8 @@ sp_selection_scale_times(Inkscape::Selection *selection, gdouble times) NR::Point const center(selection->bounds().midpoint()); sp_selection_scale_relative(selection, center, NR::scale(times, times)); - sp_document_done(sp_desktop_document(selection->desktop())); + sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1685"); } void @@ -1672,11 +1698,14 @@ sp_selection_move(gdouble dx, gdouble dy) sp_selection_move_relative(selection, dx, dy); if (dx == 0) { - sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical"); + sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1702"); } else if (dy == 0) { - sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal"); + sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1705"); } else { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1707"); } } @@ -1697,11 +1726,14 @@ sp_selection_move_screen(gdouble dx, gdouble dy) sp_selection_move_relative(selection, zdx, zdy); if (dx == 0) { - sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical"); + sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:vertical", SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1730"); } else if (dy == 0) { - sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal"); + sp_document_maybe_done(sp_desktop_document(desktop), "selector:move:horizontal", SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1733"); } else { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "selection-chemistry.cpp:1735"); } } @@ -1961,7 +1993,8 @@ sp_selection_clone() Inkscape::GC::release(clone); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_CLONE, + /* TODO: annotate */ "selection-chemistry.cpp:1996"); selection->setReprList(newsel); @@ -2012,7 +2045,8 @@ sp_selection_unlink() desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No clones to unlink in the selection.")); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_UNLINK_CLONE, + /* TODO: annotate */ "selection-chemistry.cpp:2048"); } void @@ -2157,7 +2191,8 @@ sp_selection_tile(bool apply) g_slist_free (items); - sp_document_done (document); + sp_document_done (document, SP_VERB_EDIT_TILE, + /* TODO: annotate */ "selection-chemistry.cpp:2194"); } void @@ -2228,7 +2263,8 @@ sp_selection_untile() if (!did) { desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No pattern fills in the selection.")); } else { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_EDIT_UNTILE, + /* TODO: annotate */ "selection-chemistry.cpp:2266"); selection->setList(new_select); } } @@ -2377,7 +2413,8 @@ sp_selection_create_bitmap_copy () gdk_pixbuf_unref (pb); // Complete undoable transaction - sp_document_done (document); + sp_document_done (document, SP_VERB_SELECTION_CREATE_BITMAP, + /* TODO: annotate */ "selection-chemistry.cpp:2416"); } g_free (filename); @@ -2502,7 +2539,8 @@ sp_selection_set_mask(bool apply_clip_path, bool apply_to_layer) g_slist_free (mask_items); g_slist_free (apply_to_items); - sp_document_done (document); + sp_document_done (document, SP_VERB_OBJECT_SET_MASK, + /* TODO: annotate */ "selection-chemistry.cpp:2542"); } void sp_selection_unset_mask(bool apply_clip_path) { @@ -2582,7 +2620,8 @@ void sp_selection_unset_mask(bool apply_clip_path) { g_slist_free (items_to_move); } - sp_document_done (document); + sp_document_done (document, SP_VERB_OBJECT_UNSET_MASK, + /* TODO: annotate */ "selection-chemistry.cpp:2623"); } void fit_canvas_to_selection(SPDesktop *desktop) { @@ -2625,7 +2664,8 @@ void fit_canvas_to_selection_or_drawing(SPDesktop *desktop) { fit_canvas_to_selection(desktop); } - sp_document_done(doc); + sp_document_done(doc, SP_VERB_FIT_CANVAS_TO_DRAWING, + /* TODO: annotate */ "selection-chemistry.cpp:2667"); }; /* diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 6b61beac4..3f40103e7 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -39,6 +39,7 @@ #include "seltrans.h" #include "selection-chemistry.h" #include "sp-metrics.h" +#include "verbs.h" #include #include "display/sp-ctrlline.h" #include "prefs-utils.h" @@ -222,7 +223,8 @@ void Inkscape::SelTrans::setCenter(NR::Point const &p) it->setCenter(p); SP_OBJECT(it)->updateRepr(); } - sp_document_maybe_done (sp_desktop_document(_desktop), "center::move"); + sp_document_maybe_done (sp_desktop_document(_desktop), "center::move", SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "seltrans.cpp:227"); _updateHandles(); } @@ -340,7 +342,8 @@ void Inkscape::SelTrans::ungrab() } } - sp_document_done(sp_desktop_document(_desktop)); + sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "seltrans.cpp:346"); updh = false; } @@ -436,7 +439,8 @@ void Inkscape::SelTrans::stamp() Inkscape::GC::release(copy_repr); l = l->next; } - sp_document_done(sp_desktop_document(_desktop)); + sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "seltrans.cpp:443"); } if ( fixup && _stamp_cache ) { @@ -621,7 +625,8 @@ void Inkscape::SelTrans::handleClick(SPKnot *knot, guint state, SPSelTransHandle _center_is_set = false; // center has changed _updateHandles(); } - sp_document_maybe_done (sp_desktop_document(_desktop), "center::unset"); + sp_document_maybe_done (sp_desktop_document(_desktop), "center::unset", SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "seltrans.cpp:629"); } break; default: diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp index 3e4568de0..8a39eb0b4 100644 --- a/src/sp-flowtext.cpp +++ b/src/sp-flowtext.cpp @@ -613,7 +613,8 @@ void SPFlowtext::convert_to_text() selection->set(new_item); item->deleteObject(); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + /* TODO: annotate */ "sp-flowtext.cpp:617"); } SPItem *SPFlowtext::get_frame(SPItem *after) diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index a4aa83ad2..e91349ad9 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -444,7 +444,8 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) items = g_slist_remove (items, items->data); } - if (do_done) sp_document_done (doc); + if (do_done) sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "sp-item-group.cpp:448"); } /* diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp index 92c338d84..1dc6bd6cb 100644 --- a/src/spiral-context.cpp +++ b/src/spiral-context.cpp @@ -458,7 +458,8 @@ sp_spiral_finish(SPSpiralContext *sc) SP_OBJECT(spiral)->updateRepr(NULL, SP_OBJECT_WRITE_EXT); sp_desktop_selection(desktop)->set(sc->item); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SPIRAL, + /* TODO: annotate */ "spiral-context.cpp:462"); sc->item = NULL; } diff --git a/src/splivarot.cpp b/src/splivarot.cpp index ed7e34147..9083f9b06 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -405,7 +405,8 @@ sp_selected_path_boolop(bool_op bop) { SP_OBJECT(l->data)->deleteObject(); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + /* TODO: annotate */ "splivarot.cpp:409"); selection->clear(); delete res; @@ -540,7 +541,18 @@ sp_selected_path_boolop(bool_op bop) Inkscape::GC::release(repr); } - sp_document_done(sp_desktop_document(desktop)); + unsigned int operation_verb = SP_VERB_NONE; + switch(bop) { + case bool_op_union : operation_verb = SP_VERB_SELECTION_UNION; break; + case bool_op_inters : operation_verb = SP_VERB_SELECTION_INTERSECT; break; + case bool_op_diff : operation_verb = SP_VERB_SELECTION_DIFF; break; + case bool_op_symdiff : operation_verb = SP_VERB_SELECTION_SYMDIFF; break; + case bool_op_cut : operation_verb = SP_VERB_SELECTION_CUT; break; + case bool_op_slice : operation_verb = SP_VERB_SELECTION_SLICE; break; + } + + sp_document_done(sp_desktop_document(desktop), operation_verb, + /* TODO: annotate */ "splivarot.cpp:555"); delete res; } @@ -830,7 +842,8 @@ sp_selected_path_outline() } if (did) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_OUTLINE, + /* TODO: annotate */ "splivarot.cpp:846"); } else { // TRANSLATORS: "to outline" means "to convert stroke to path" desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No stroked paths to outline in the selection.")); @@ -1034,7 +1047,8 @@ sp_selected_path_create_offset_object(int expand, bool updating) { // pas vraiment de points sur le resultat // donc il ne reste rien - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + /* TODO: annotate */ "splivarot.cpp:1051"); selection->clear(); delete res; @@ -1098,7 +1112,8 @@ sp_selected_path_create_offset_object(int expand, bool updating) selection->set(nitem); } - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + /* TODO: annotate */ "splivarot.cpp:1116"); delete res; delete orig; @@ -1340,7 +1355,8 @@ sp_selected_path_do_offset(bool expand, double prefOffset) } if (did) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_NONE, + /* TODO: annotate */ "splivarot.cpp:1359"); } else { desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No paths to inset/outset in the selection.")); return; @@ -1500,7 +1516,8 @@ sp_selected_path_simplify_selection(float threshold, bool justCoalesce, if (didSomething) - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_SIMPLIFY, + /* TODO: annotate */ "splivarot.cpp:1520"); else desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No paths to simplify in the selection.")); diff --git a/src/star-context.cpp b/src/star-context.cpp index 603365feb..74b252860 100644 --- a/src/star-context.cpp +++ b/src/star-context.cpp @@ -470,7 +470,8 @@ sp_star_finish (SPStarContext * sc) object->updateRepr(NULL, SP_OBJECT_WRITE_EXT); sp_desktop_selection(desktop)->set(sc->item); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR, + /* TODO: annotate */ "star-context.cpp:474"); sc->item = NULL; } diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 21c74d1a7..453ddfc19 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -153,7 +153,8 @@ text_put_on_path() SP_OBJECT_REPR(text)->setAttribute("x", NULL); SP_OBJECT_REPR(text)->setAttribute("y", NULL); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-chemistry.cpp:157"); g_slist_free(text_reprs); } @@ -190,7 +191,8 @@ text_remove_from_path() sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No texts-on-paths in the selection.")); } else { selection->setList(g_slist_copy((GSList *) selection->itemList())); // reselect to update statusbar description - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-chemistry.cpp:195"); } } @@ -237,7 +239,8 @@ text_remove_all_kerns() if (!did) { sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("Select text(s) to remove kerns from.")); } else { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-chemistry.cpp:243"); } } @@ -305,7 +308,8 @@ text_flow_into_shape() SP_OBJECT(text)->deleteObject (true); - sp_document_done(doc); + sp_document_done(doc, SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-chemistry.cpp:312"); sp_desktop_selection(desktop)->set(SP_ITEM(root_object)); @@ -390,7 +394,8 @@ text_unflow () g_slist_free (old_objs); g_slist_free (new_objs); - sp_document_done(doc); + sp_document_done(doc, SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-chemistry.cpp:398"); } diff --git a/src/text-context.cpp b/src/text-context.cpp index 945813f1b..1185e08ef 100644 --- a/src/text-context.cpp +++ b/src/text-context.cpp @@ -50,6 +50,7 @@ #include "rubberband.h" #include "sp-metrics.h" #include "context-fns.h" +#include "verbs.h" #include "text-editing.h" @@ -510,7 +511,8 @@ sp_text_context_setup_text(SPTextContext *tc) Inkscape::GC::release(rtext); text_item->transform = SP_ITEM(ec->desktop->currentRoot())->getRelativeTransform(ec->desktop->currentLayer()); text_item->updateRepr(); - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:515"); } /** @@ -548,7 +550,8 @@ insert_uni_char(SPTextContext *const tc) tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, u); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_done(sp_desktop_document(tc->desktop)); + sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_DIALOG_TRANSFORM, + /* TODO: annotate */ "text-context.cpp:554"); } } @@ -711,7 +714,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) SPItem *ft = create_flowtext_with_internal_frame (desktop, tc->p0, p1); sp_desktop_selection(desktop)->set(ft); ec->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Flowed text is created.")); - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:718"); } else { ec->desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("The frame is too small for the current font size. Flowed text not created.")); } @@ -840,7 +844,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); ec->desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("No-break space")); - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:848"); return TRUE; } break; @@ -876,7 +881,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_repr_css_set_property(css, "font-weight", "normal"); sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css); sp_repr_css_attr_unref(css); - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:885"); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); return TRUE; @@ -893,7 +899,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_repr_css_set_property(css, "font-style", "normal"); sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css); sp_repr_css_attr_unref(css); - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:903"); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); return TRUE; @@ -924,7 +931,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) tc->text_sel_start = tc->text_sel_end = sp_te_insert_line(tc->text, tc->text_sel_start); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:935"); return TRUE; case GDK_BackSpace: if (tc->text) { // if nascent_object, do nothing, but return TRUE; same for all other delete and move keys @@ -933,7 +941,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) tc->text_sel_start = tc->text_sel_end = sp_te_delete(tc->text, tc->text_sel_start, tc->text_sel_end); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:945"); } return TRUE; case GDK_Delete: @@ -944,7 +953,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) tc->text_sel_start = tc->text_sel_end = sp_te_delete(tc->text, tc->text_sel_start, tc->text_sel_end); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:957"); } return TRUE; case GDK_Left: @@ -958,7 +968,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, NR::Point(-1, 0)); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:left"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:left", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:972"); } else { cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorLeftWithControl : &Inkscape::Text::Layout::iterator::cursorLeft; @@ -977,7 +988,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, NR::Point(1, 0)); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:right"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:right", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:992"); } else { cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorRightWithControl : &Inkscape::Text::Layout::iterator::cursorRight; @@ -996,7 +1008,9 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, NR::Point(0, -1)); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:up"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:up", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1012"); + } else { cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorUpWithControl : &Inkscape::Text::Layout::iterator::cursorUp; @@ -1015,7 +1029,9 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_te_adjust_kerning_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, NR::Point(0, 1)); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:down"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "kern:down", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1033"); + } else { cursor_movement_operator = MOD__CTRL ? &Inkscape::Text::Layout::iterator::cursorDownWithControl : &Inkscape::Text::Layout::iterator::cursorDown; @@ -1069,7 +1085,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) } else { sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -90); } - sp_document_maybe_done(sp_desktop_document(ec->desktop), "textrot:ccw"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "textrot:ccw", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1089"); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); return TRUE; @@ -1089,7 +1106,8 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) } else { sp_te_adjust_rotation(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 90); } - sp_document_maybe_done(sp_desktop_document(ec->desktop), "textrot:cw"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "textrot:cw", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1110"); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); return TRUE; @@ -1105,13 +1123,17 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -10); else sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -1); - sp_document_maybe_done(sp_desktop_document(ec->desktop), "linespacing:dec"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "linespacing:dec", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1127"); + } else { if (MOD__SHIFT) sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -10); else sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, -1); - sp_document_maybe_done(sp_desktop_document(ec->desktop), "letterspacing:dec"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "letterspacing:dec", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1135"); + } sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); @@ -1128,13 +1150,17 @@ sp_text_context_root_handler(SPEventContext *const ec, GdkEvent *const event) sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 10); else sp_te_adjust_linespacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 1); - sp_document_maybe_done(sp_desktop_document(ec->desktop), "linespacing:inc"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "linespacing:inc", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1154"); + } else { if (MOD__SHIFT) sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 10); else sp_te_adjust_tspan_letterspacing_screen(tc->text, tc->text_sel_start, tc->text_sel_end, ec->desktop, 1); - sp_document_maybe_done(sp_desktop_document(ec->desktop), "letterspacing:inc"); + sp_document_maybe_done(sp_desktop_document(ec->desktop), "letterspacing:inc", SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1162"); + } sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); @@ -1236,7 +1262,8 @@ sp_text_paste_inline(SPEventContext *ec) tc->text_sel_start = tc->text_sel_end = sp_te_insert_line(tc->text, tc->text_sel_start); begin = end + 1; } - sp_document_done(sp_desktop_document(ec->desktop)); + sp_document_done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1266"); return true; } @@ -1349,7 +1376,8 @@ sp_text_context_style_set(SPCSSAttr const *css, SPTextContext *tc) return false; // will get picked up by the parent and applied to the whole text object sp_te_apply_style(tc->text, tc->text_sel_start, tc->text_sel_end, css); - sp_document_done(sp_desktop_document(tc->desktop)); + sp_document_done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1380"); sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); @@ -1547,7 +1575,8 @@ sptc_commit(GtkIMContext *imc, gchar *string, SPTextContext *tc) sp_text_context_update_cursor(tc); sp_text_context_update_text_selection(tc); - sp_document_done(SP_OBJECT_DOCUMENT(tc->text)); + sp_document_done(SP_OBJECT_DOCUMENT(tc->text), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "text-context.cpp:1579"); } diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp index ae4191a6d..13885eb5b 100644 --- a/src/trace/trace.cpp +++ b/src/trace/trace.cpp @@ -563,7 +563,8 @@ void Tracer::traceThread() } //## inform the document, so we can undo - sp_document_done(doc); + sp_document_done(doc, SP_VERB_NONE, + /* TODO: annotate */ "trace.cpp:567"); engine = NULL; diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index a86ce2ddc..c17fd7269 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -168,7 +168,8 @@ sp_item_create_link(GtkMenuItem *menuitem, SPItem *item) SP_OBJECT(item)->deleteObject(false); repr->addChild(child, NULL); child->setAttribute("id", id); - sp_document_done(SP_OBJECT_DOCUMENT(object)); + sp_document_done(SP_OBJECT_DOCUMENT(object), SP_VERB_NONE, + /* TODO: annotate */ "context-menu.cpp:172"); sp_object_attributes_dialog(object, "SPAnchor"); diff --git a/src/ui/dialog/Makefile_insert b/src/ui/dialog/Makefile_insert index 4e40b645d..4a76a68ca 100644 --- a/src/ui/dialog/Makefile_insert +++ b/src/ui/dialog/Makefile_insert @@ -42,6 +42,9 @@ ui_dialog_libuidialog_a_SOURCES = \ ui/dialog/transformation.h \ ui/dialog/tree-editor.cpp \ ui/dialog/tree-editor.h \ + ui/dialog/undo-history.cpp \ + ui/dialog/undo-history.h \ + $(inkboard_dialogs) \ ui/dialog/xml-editor.cpp \ ui/dialog/xml-editor.h \ ui/dialog/aboutbox.cpp \ diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 08e197586..a7b2aa991 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -215,7 +215,8 @@ private : prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation); if (changed) { - sp_document_done ( sp_desktop_document (desktop) ); + sp_document_done ( sp_desktop_document (desktop) , SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + /* TODO: annotate */ "align-and-distribute.cpp:219" ); } @@ -374,7 +375,8 @@ private : prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation); if (changed) { - sp_document_done ( sp_desktop_document (desktop) ); + sp_document_done ( sp_desktop_document (desktop), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + /* TODO: annotate */ "align-and-distribute.cpp:379"); } } guint _index; @@ -484,7 +486,8 @@ private : // restore compensation setting prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation); - sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP)); + sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + /* TODO: annotate */ "align-and-distribute.cpp:490"); } }; @@ -513,7 +516,8 @@ private : // restore compensation setting prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation); - sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP)); + sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + /* TODO: annotate */ "align-and-distribute.cpp:520"); } }; @@ -542,7 +546,8 @@ private : // restore compensation setting prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation); - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + /* TODO: annotate */ "align-and-distribute.cpp:550"); } }; @@ -605,7 +610,8 @@ private : // restore compensation setting prefs_set_int_attribute("options.clonecompensation", "value", saved_compensation); - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + /* TODO: annotate */ "align-and-distribute.cpp:614"); } }; @@ -717,7 +723,8 @@ private : } if (changed) { - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + /* TODO: annotate */ "align-and-distribute.cpp:727"); } } }; diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp index f4099b050..d685f2e59 100644 --- a/src/ui/dialog/dialog-manager.cpp +++ b/src/ui/dialog/dialog-manager.cpp @@ -32,7 +32,7 @@ #include "ui/dialog/text-properties.h" #include "ui/dialog/tracedialog.h" #include "ui/dialog/transformation.h" - +#include "ui/dialog/undo-history.h" #include "ui/dialog/xml-editor.h" #include "dialogs/tiledialog.h" @@ -85,6 +85,7 @@ DialogManager::DialogManager() { registerFactory("TileDialog", &create); registerFactory("Trace", &create); registerFactory("Transformation", &create); + registerFactory("UndoHistory", &create); registerFactory("XmlEditor", &create); } diff --git a/src/ui/dialog/session-player.cpp b/src/ui/dialog/session-player.cpp index 97ef5618e..921d71bb8 100644 --- a/src/ui/dialog/session-player.cpp +++ b/src/ui/dialog/session-player.cpp @@ -182,7 +182,8 @@ SessionPlaybackDialogImpl::_respCallback(int resp) switch (result) { case Gtk::RESPONSE_OK: this->_sm->clearDocument(); - sp_document_done(sp_desktop_document(this->_desktop)); + sp_document_done(sp_desktop_document(this->_desktop), SP_VERB_NONE, + /* TODO: annotate */ "session-player.cpp:186"); this->_sm->loadSessionFile(sessionfiledlg.get_filename()); this->_openfile.set_text(this->_sfp->filename()); break; diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 8fa2c5dcb..2cd21a560 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -581,7 +581,8 @@ Transformation::applyPageMove(Inkscape::Selection *selection) x - bbox.min()[NR::X], y - bbox.min()[NR::Y]); } - sp_document_done ( sp_desktop_document (selection->desktop()) ); + sp_document_done ( sp_desktop_document (selection->desktop()) , SP_VERB_DIALOG_TRANSFORM, + /* TODO: annotate */ "transformation.cpp:585"); } void @@ -632,7 +633,8 @@ Transformation::applyPageScale(Inkscape::Selection *selection) sp_selection_scale_relative(selection, center, scale); } - sp_document_done(sp_desktop_document(selection->desktop())); + sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + /* TODO: annotate */ "transformation.cpp:637"); } void @@ -650,7 +652,8 @@ Transformation::applyPageRotate(Inkscape::Selection *selection) sp_selection_rotate_relative(selection, center, angle); } - sp_document_done(sp_desktop_document(selection->desktop())); + sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + /* TODO: annotate */ "transformation.cpp:656"); } void @@ -702,7 +705,8 @@ Transformation::applyPageSkew(Inkscape::Selection *selection) } } - sp_document_done(sp_desktop_document(selection->desktop())); + sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + /* TODO: annotate */ "transformation.cpp:709"); } @@ -728,7 +732,8 @@ Transformation::applyPageTransform(Inkscape::Selection *selection) sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform } - sp_document_done(sp_desktop_document(selection->desktop())); + sp_document_done(sp_desktop_document(selection->desktop()), SP_VERB_DIALOG_TRANSFORM, + /* TODO: annotate */ "transformation.cpp:736"); } diff --git a/src/ui/icons.cpp b/src/ui/icons.cpp index aa8c5d53c..c65066c36 100644 --- a/src/ui/icons.cpp +++ b/src/ui/icons.cpp @@ -65,6 +65,12 @@ init() icons->add(Stock::VACUUM_DEFS, _vacuum_defs); // Edit menu + // Undo History + Gtk::IconSet _undo_history; + src.set_icon_name("UndoHistory"); + src.set_filename(get_icon_path("undo-history.svg")); + _undo_history.add_source(src); + icons->add(Stock::UNDO_HISTORY, _undo_history); // Paste In Place Gtk::IconSet _paste_in_place; src.set_icon_name("PasteInPlace"); diff --git a/src/ui/stock.cpp b/src/ui/stock.cpp index b7dbddcc9..7ceb86660 100644 --- a/src/ui/stock.cpp +++ b/src/ui/stock.cpp @@ -21,6 +21,7 @@ Gtk::StockID const IMPORT("import"); Gtk::StockID const EXPORT("export"); Gtk::StockID const VACUUM_DEFS("vacuum-defs"); // Edit menu +Gtk::StockID const UNDO_HISTORY("undo-history"); Gtk::StockID const PASTE_IN_PLACE("paste-in-place"); Gtk::StockID const PASTE_STYLE("paste-style"); Gtk::StockID const DUPLICATE("duplicate"); diff --git a/src/ui/stock.h b/src/ui/stock.h index d990186cb..069ab66f3 100644 --- a/src/ui/stock.h +++ b/src/ui/stock.h @@ -24,6 +24,7 @@ extern Gtk::StockID const IMPORT; extern Gtk::StockID const EXPORT; extern Gtk::StockID const VACUUM_DEFS; // Edit menu +extern Gtk::StockID const UNDO_HISTORY; extern Gtk::StockID const PASTE_IN_PLACE; extern Gtk::StockID const PASTE_STYLE; extern Gtk::StockID const DUPLICATE; diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp index 55f63b443..8eb96b291 100644 --- a/src/ui/view/edit-widget.cpp +++ b/src/ui/view/edit-widget.cpp @@ -408,6 +408,10 @@ EditWidget::initMenuActions() Gtk::Stock::REDO, Glib::ustring(), _("PLACEHOLDER, do not translate"))); + _act_grp->add(Gtk::Action::create("UndoHistory", + Stock::UNDO_HISTORY, Glib::ustring(), + _("PLACEHOLDER, do not translate"))); + _act_grp->add(Gtk::Action::create("Cut", Gtk::Stock::CUT, Glib::ustring(), _("PLACEHOLDER, do not translate"))); diff --git a/src/ui/widget/color-picker.cpp b/src/ui/widget/color-picker.cpp index f79334e31..d5c4899c6 100644 --- a/src/ui/widget/color-picker.cpp +++ b/src/ui/widget/color-picker.cpp @@ -126,7 +126,8 @@ sp_color_picker_color_mod(SPColorSelector *csel, GObject *cp) (ptr->_preview).setRgba32 (rgba); if (ptr->_undo && SP_ACTIVE_DESKTOP) - sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP)); + sp_document_done(sp_desktop_document(SP_ACTIVE_DESKTOP), SP_VERB_NONE, + /* TODO: annotate */ "color-picker.cpp:130"); ptr->on_changed (rgba); _in_use = false; diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index 1b4048ab0..6563040dc 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -97,7 +97,8 @@ EntityLineEntry::on_changed() SPDocument *doc = SP_ACTIVE_DOCUMENT; char const *text = reinterpret_cast(_packable)->get_text().c_str(); if (rdf_set_work_entity (doc, _entity, text)) - sp_document_done (doc); + sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "entity-entry.cpp:101"); _wr->setUpdating (false); } @@ -141,7 +142,8 @@ EntityMultiLineEntry::on_changed() Gtk::TextView *tv = reinterpret_cast(s->get_child()); char const *text = tv->get_buffer()->get_text().c_str(); if (rdf_set_work_entity (doc, _entity, text)) - sp_document_done (doc); + sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "entity-entry.cpp:146"); _wr->setUpdating (false); } diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 72c4663e4..50c49e912 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -61,7 +61,8 @@ LicenseItem::on_toggled() _wr.setUpdating (true); rdf_set_license (SP_ACTIVE_DOCUMENT, _lic->details ? _lic : 0); - sp_document_done (SP_ACTIVE_DOCUMENT); + sp_document_done (SP_ACTIVE_DOCUMENT, SP_VERB_NONE, + /* TODO: annotate */ "licensor.cpp:65"); _wr.setUpdating (false); reinterpret_cast(_eep->_packable)->set_text (_lic->uri); _eep->on_changed(); diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index b6b8503c4..5882d4651 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -297,7 +297,8 @@ PageSizer::setDim (double w, double h) SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); sp_document_set_width (doc, w, &_px_unit); sp_document_set_height (doc, h, &_px_unit); - sp_document_done (doc); + sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "page-sizer.cpp:301"); } _landscape = w>h; diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 1bfcb1f84..4ac73e484 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -33,6 +33,7 @@ #include "sp-namedview.h" #include "registered-widget.h" +#include "verbs.h" namespace Inkscape { namespace UI { @@ -98,7 +99,8 @@ RegisteredCheckButton::on_toggled() sp_repr_set_boolean(repr, _key.c_str(), _button->get_active()); doc->rroot->setAttribute("sodipodi:modified", "true"); sp_document_set_undo_sensitive (doc, saved); - sp_document_done (doc); + sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "registered-widget.cpp:103"); _wr->setUpdating (false); } @@ -156,7 +158,8 @@ RegisteredUnitMenu::on_changed() repr->setAttribute(_key.c_str(), os.str().c_str()); doc->rroot->setAttribute("sodipodi:modified", "true"); sp_document_set_undo_sensitive (doc, saved); - sp_document_done (doc); + sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "registered-widget.cpp:162"); _wr->setUpdating (false); } @@ -223,7 +226,8 @@ RegisteredScalarUnit::on_value_changed() repr->setAttribute(_key.c_str(), os.str().c_str()); doc->rroot->setAttribute("sodipodi:modified", "true"); sp_document_set_undo_sensitive (doc, saved); - sp_document_done (doc); + sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "registered-widget.cpp:230"); _wr->setUpdating (false); } @@ -333,7 +337,8 @@ RegisteredSuffixedInteger::on_value_changed() os << value; repr->setAttribute(_key.c_str(), os.str().c_str()); - sp_document_done(sp_desktop_document(dt)); + sp_document_done(sp_desktop_document(dt), SP_VERB_NONE, + /* TODO: annotate */ "registered-widget.cpp:341"); _wr->setUpdating (false); } @@ -396,7 +401,8 @@ RegisteredRadioButtonPair::on_value_changed() repr->setAttribute(_key.c_str(), second ? "true" : "false"); doc->rroot->setAttribute("sodipodi:modified", "true"); sp_document_set_undo_sensitive (doc, saved); - sp_document_done (doc); + sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "registered-widget.cpp:405"); _wr->setUpdating (false); } diff --git a/src/ui/widget/ruler.cpp b/src/ui/widget/ruler.cpp index eab05ca44..30a1761bd 100644 --- a/src/ui/widget/ruler.cpp +++ b/src/ui/widget/ruler.cpp @@ -29,6 +29,7 @@ #include "desktop-handles.h" #include "document.h" #include "sp-namedview.h" +#include "verbs.h" namespace Inkscape { namespace UI { @@ -152,7 +153,8 @@ Ruler::on_button_release_event(GdkEventButton *evb) sp_repr_set_svg_double(repr, "position", guide_pos_dt); SP_OBJECT_REPR(_dt->namedview)->appendChild(repr); Inkscape::GC::release(repr); - sp_document_done(sp_desktop_document(_dt)); + sp_document_done(sp_desktop_document(_dt), SP_VERB_NONE, + /* TODO: annotate */ "ruler.cpp:157"); } _dt->set_coordinate_status(event_dt); } diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index a2e57d600..ad4c7a9cd 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -35,6 +35,7 @@ #include "svg/svg-color.h" #include "svg/css-ostringstream.h" #include "helper/units.h" +#include "verbs.h" static gdouble const _sw_presets[] = { 32 , 16 , 10 , 8 , 6 , 4 , 3 , 2 , 1.5 , 1 , 0.75 , 0.5 , 0.25 , 0.1 }; static gchar* const _sw_presets_str[] = {"32", "16", "10", "8", "6", "4", "3", "2", "1.5", "1", "0.75", "0.5", "0.25", "0.1"}; @@ -425,7 +426,8 @@ void SelectedStyle::dragDataReceived( GtkWidget *widget, sp_repr_css_set_property( css, (tracker->item == SS_FILL) ? "fill":"stroke", c ); sp_desktop_set_style( tracker->parent->_desktop, css ); sp_repr_css_attr_unref( css ); - sp_document_done( sp_desktop_document(tracker->parent->_desktop) ); + sp_document_done( sp_desktop_document(tracker->parent->_desktop) , SP_VERB_NONE, + /* TODO: annotate */ "selected-style.cpp:429"); } } break; @@ -437,7 +439,8 @@ void SelectedStyle::on_fill_remove() { sp_repr_css_set_property (css, "fill", "none"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:442"); } void SelectedStyle::on_stroke_remove() { @@ -445,7 +448,8 @@ void SelectedStyle::on_stroke_remove() { sp_repr_css_set_property (css, "stroke", "none"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:451"); } void SelectedStyle::on_fill_unset() { @@ -453,7 +457,8 @@ void SelectedStyle::on_fill_unset() { sp_repr_css_unset_property (css, "fill"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:460"); } void SelectedStyle::on_stroke_unset() { @@ -461,7 +466,8 @@ void SelectedStyle::on_stroke_unset() { sp_repr_css_unset_property (css, "stroke"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:469"); } void SelectedStyle::on_fill_opaque() { @@ -469,7 +475,8 @@ void SelectedStyle::on_fill_opaque() { sp_repr_css_set_property (css, "fill-opacity", "1"); sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:478"); } void SelectedStyle::on_stroke_opaque() { @@ -477,7 +484,8 @@ void SelectedStyle::on_stroke_opaque() { sp_repr_css_set_property (css, "stroke-opacity", "1"); sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:487"); } void SelectedStyle::on_fill_lastused() { @@ -488,7 +496,8 @@ void SelectedStyle::on_fill_lastused() { sp_repr_css_set_property (css, "fill", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:499"); } void SelectedStyle::on_stroke_lastused() { @@ -499,7 +508,8 @@ void SelectedStyle::on_stroke_lastused() { sp_repr_css_set_property (css, "stroke", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:511"); } void SelectedStyle::on_fill_lastselected() { @@ -509,7 +519,8 @@ void SelectedStyle::on_fill_lastselected() { sp_repr_css_set_property (css, "fill", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:522"); } void SelectedStyle::on_stroke_lastselected() { @@ -519,7 +530,8 @@ void SelectedStyle::on_stroke_lastselected() { sp_repr_css_set_property (css, "stroke", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:533"); } void SelectedStyle::on_fill_invert() { @@ -538,7 +550,8 @@ void SelectedStyle::on_fill_invert() { sp_repr_css_set_property (css, "fill", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:553"); } void SelectedStyle::on_stroke_invert() { @@ -557,7 +570,8 @@ void SelectedStyle::on_stroke_invert() { sp_repr_css_set_property (css, "stroke", c); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:573"); } void SelectedStyle::on_fill_white() { @@ -568,7 +582,8 @@ void SelectedStyle::on_fill_white() { sp_repr_css_set_property (css, "fill-opacity", "1"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:585"); } void SelectedStyle::on_stroke_white() { @@ -579,7 +594,8 @@ void SelectedStyle::on_stroke_white() { sp_repr_css_set_property (css, "stroke-opacity", "1"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:597"); } void SelectedStyle::on_fill_black() { @@ -590,7 +606,8 @@ void SelectedStyle::on_fill_black() { sp_repr_css_set_property (css, "fill-opacity", "1.0"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:609"); } void SelectedStyle::on_stroke_black() { @@ -601,7 +618,8 @@ void SelectedStyle::on_stroke_black() { sp_repr_css_set_property (css, "stroke-opacity", "1.0"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:621"); } void SelectedStyle::on_fill_copy() { @@ -643,7 +661,8 @@ void SelectedStyle::on_fill_paste() { sp_repr_css_set_property (css, "fill", text.c_str()); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:664"); } } @@ -660,7 +679,8 @@ void SelectedStyle::on_stroke_paste() { sp_repr_css_set_property (css, "stroke", text.c_str()); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:682"); } } @@ -715,7 +735,8 @@ void SelectedStyle::on_fillstroke_swap() { sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:738"); } void SelectedStyle::on_fill_edit() { @@ -782,7 +803,8 @@ SelectedStyle::on_opacity_click(GdkEventButton *event) sp_repr_css_set_property (css, "opacity", opacity); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document (_desktop)); + sp_document_done (sp_desktop_document (_desktop), SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:806"); return true; } @@ -815,7 +837,8 @@ void SelectedStyle::on_popup_preset(int i) { sp_repr_css_set_property (css, "stroke-width", os.str().c_str()); sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - sp_document_done (sp_desktop_document(_desktop)); + sp_document_done (sp_desktop_document(_desktop), SP_VERB_DIALOG_SWATCHES, + /* TODO: annotate */ "selected-style.cpp:840"); } void @@ -1055,7 +1078,8 @@ void SelectedStyle::on_opacity_changed () { sp_repr_css_set_property (css, "opacity", os.str().c_str()); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - sp_document_maybe_done (sp_desktop_document (_desktop), "fillstroke:opacity"); + sp_document_maybe_done (sp_desktop_document (_desktop), "fillstroke:opacity", SP_VERB_DIALOG_FILL_STROKE, + /* TODO: annotate */ "selected-style.cpp:1082"); spinbutton_defocus(GTK_OBJECT(_opacity_sb.gobj())); _opacity_blocked = false; } diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index 654936814..b7839284a 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -169,7 +169,8 @@ ToleranceSlider::update (double val) repr->setAttribute(_key.c_str(), os.str().c_str()); doc->rroot->setAttribute("sodipodi:modified", "true"); sp_document_set_undo_sensitive (doc, saved); - sp_document_done (doc); + sp_document_done (doc, SP_VERB_NONE, + /* TODO: annotate */ "tolerance-slider.cpp:173"); _wr->setUpdating (false); } diff --git a/src/undo-stack-observer.h b/src/undo-stack-observer.h index f9e3d9dd0..cd17c4675 100644 --- a/src/undo-stack-observer.h +++ b/src/undo-stack-observer.h @@ -16,12 +16,8 @@ namespace Inkscape { -namespace XML { - class Event; -} - /** * Observes changes made to the undo and redo stacks. * @@ -44,23 +40,23 @@ public: /** * Triggered when the user issues an undo command. * - * \param log Pointer to an XML::Event describing the undone event. + * \param log Pointer to an Event describing the undone event. */ - virtual void notifyUndoEvent(XML::Event* log) = 0; + virtual void notifyUndoEvent(Event* log) = 0; /** * Triggered when the user issues a redo command. * - * \param log Pointer to an XML::Event describing the redone event. + * \param log Pointer to an Event describing the redone event. */ - virtual void notifyRedoEvent(XML::Event* log) = 0; + virtual void notifyRedoEvent(Event* log) = 0; /** * Triggered when a set of transactions is committed to the undo log. * - * \param log Pointer to an XML::Event describing the committed events. + * \param log Pointer to an Event describing the committed events. */ - virtual void notifyUndoCommitEvent(XML::Event* log) = 0; + virtual void notifyUndoCommitEvent(Event* log) = 0; }; } diff --git a/src/verbs.cpp b/src/verbs.cpp index 5649d0895..6c529cfcb 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1073,7 +1073,8 @@ LayerVerb::perform(SPAction *action, void *data, void *pdata) SPObject *next=Inkscape::next_layer(dt->currentRoot(), dt->currentLayer()); if (next) { dt->setCurrentLayer(next); - sp_document_done(sp_desktop_document(dt)); + sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_NEXT, + /* TODO: annotate */ "verbs.cpp:1077"); dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Moved to next layer.")); } else { dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move past last layer.")); @@ -1084,7 +1085,8 @@ LayerVerb::perform(SPAction *action, void *data, void *pdata) SPObject *prev=Inkscape::previous_layer(dt->currentRoot(), dt->currentLayer()); if (prev) { dt->setCurrentLayer(prev); - sp_document_done(sp_desktop_document(dt)); + sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_PREV, + /* TODO: annotate */ "verbs.cpp:1089"); dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Moved to previous layer.")); } else { dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot move past first layer.")); @@ -1140,7 +1142,8 @@ LayerVerb::perform(SPAction *action, void *data, void *pdata) message = g_strdup_printf(_("Lowered layer %s."), layer->defaultLabel()); break; }; - sp_document_done(sp_desktop_document(dt)); + sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_LOWER, + /* TODO: annotate */ "verbs.cpp:1146"); if (message) { dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message); g_free((void *) message); @@ -1173,7 +1176,8 @@ LayerVerb::perform(SPAction *action, void *data, void *pdata) dt->setCurrentLayer(survivor); } - sp_document_done(sp_desktop_document(dt)); + sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DELETE, + /* TODO: annotate */ "verbs.cpp:1180"); // TRANSLATORS: this means "The layer has been deleted." dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Deleted layer.")); @@ -1232,7 +1236,8 @@ ObjectVerb::perform( SPAction *action, void *data, void *pdata ) } else { sp_selection_scale_relative(sel, center, NR::scale(-1.0, 1.0)); } - sp_document_done(sp_desktop_document(dt)); + sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_HORIZONTAL, + /* TODO: annotate */ "verbs.cpp:1240"); break; case SP_VERB_OBJECT_FLIP_VERTICAL: if (tools_isactive(dt, TOOLS_NODES)) { @@ -1240,7 +1245,8 @@ ObjectVerb::perform( SPAction *action, void *data, void *pdata ) } else { sp_selection_scale_relative(sel, center, NR::scale(1.0, -1.0)); } - sp_document_done(sp_desktop_document(dt)); + sp_document_done(sp_desktop_document(dt), SP_VERB_OBJECT_FLIP_VERTICAL, + /* TODO: annotate */ "verbs.cpp:1249"); break; case SP_VERB_OBJECT_SET_MASK: sp_selection_set_mask(false, false); @@ -1562,6 +1568,9 @@ DialogVerb::perform(SPAction *action, void *data, void *pdata) case SP_VERB_DIALOG_SCRIPT: dt->_dlg_mgr->showDialog("Script"); break; + case SP_VERB_DIALOG_UNDO_HISTORY: + dt->_dlg_mgr->showDialog("UndoHistory"); + break; case SP_VERB_DIALOG_TOGGLE: inkscape_dialogs_toggle(); break; @@ -2242,6 +2251,8 @@ Verb *Verb::_base_verbs[] = { N_("Precisely control objects' transformations"), "object_trans"), new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."), N_("Align and distribute objects"), "object_align"), + new DialogVerb(SP_VERB_DIALOG_UNDO_HISTORY, "DialogUndoHistory", N_("Undo _History..."), + N_("Undo History"), "edit_undo_history"), new DialogVerb(SP_VERB_DIALOG_TEXT, "DialogText", N_("_Text and Font..."), N_("View and select font family, font size and other text properties"), "object_font"), new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."), diff --git a/src/verbs.h b/src/verbs.h index 37f6f424b..8474203f6 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -187,6 +187,7 @@ enum { SP_VERB_DIALOG_SWATCHES, SP_VERB_DIALOG_TRANSFORM, SP_VERB_DIALOG_ALIGN_DISTRIBUTE, + SP_VERB_DIALOG_UNDO_HISTORY, SP_VERB_DIALOG_TEXT, SP_VERB_DIALOG_XML_EDITOR, SP_VERB_DIALOG_FIND, @@ -307,6 +308,8 @@ public: gchar const * get_id (void) { return _id; } /** \brief Accessor to get the internal variable. */ gchar const * get_name (void) { return _name; } + /** \brief Accessor to get the internal variable. */ + gchar const * get_image (void) { return _image; } /** \brief Set the name after initialization. */ gchar const * set_name (gchar const * name) { _name = name; return _name; } diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp index 2ba59b10c..da84eafca 100644 --- a/src/widgets/gradient-toolbar.cpp +++ b/src/widgets/gradient-toolbar.cpp @@ -142,7 +142,8 @@ gr_item_activate (GtkMenuItem *menuitem, gpointer data) gr_apply_gradient (selection, ev? ev->get_drag() : NULL, gr); - sp_document_done (sp_desktop_document (desktop)); + sp_document_done (sp_desktop_document (desktop), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-toolbar.cpp:146"); } gchar * @@ -414,7 +415,8 @@ gr_fork (GtkWidget *button, GtkWidget *widget) SPGradient *gr_new = sp_gradient_fork_vector_if_necessary (gr); if (gr_new != gr) { gr_apply_gradient (selection, ev? ev->get_drag() : NULL, gr_new); - sp_document_done (document); + sp_document_done (document, SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-toolbar.cpp:419"); } } } diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index 5befb11d0..be1adcfe0 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -346,7 +346,8 @@ sp_gvs_gradient_activate (GtkMenuItem *mi, SPGradientVectorSelector *gvs) if (norm != gr) { /* We do extra undo push here */ /* If handler has already done it, it is just NOP */ - sp_document_done (SP_OBJECT_DOCUMENT (norm)); + sp_document_done (SP_OBJECT_DOCUMENT (norm), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-vector.cpp:350"); } } @@ -637,7 +638,8 @@ offadjustmentChanged( GtkAdjustment *adjustment, GtkWidget *vb) stop->offset = adjustment->value; sp_repr_set_css_double(SP_OBJECT_REPR(stop), "offset", stop->offset); - sp_document_done (SP_OBJECT_DOCUMENT (stop)); + sp_document_done (SP_OBJECT_DOCUMENT (stop), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-vector.cpp:642"); blocked = FALSE; } @@ -709,7 +711,8 @@ sp_grd_ed_add_stop (GtkWidget *widget, GtkWidget *vb) GtkWidget *offslide =GTK_WIDGET (g_object_get_data (G_OBJECT (vb), "offslide")); gtk_widget_set_sensitive (offslide, TRUE); gtk_widget_set_sensitive (GTK_WIDGET (offspin), TRUE); - sp_document_done (SP_OBJECT_DOCUMENT (gradient)); + sp_document_done (SP_OBJECT_DOCUMENT (gradient), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-vector.cpp:715"); } static void @@ -740,7 +743,8 @@ sp_grd_ed_del_stop (GtkWidget *widget, GtkWidget *vb) SP_OBJECT_REPR(gradient)->removeChild(SP_OBJECT_REPR(stop)); sp_gradient_vector_widget_load_gradient (vb, gradient); update_stop_list(GTK_WIDGET(mnu), gradient, NULL); - sp_document_done (SP_OBJECT_DOCUMENT (gradient)); + sp_document_done (SP_OBJECT_DOCUMENT (gradient), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-vector.cpp:747"); } } @@ -1116,7 +1120,8 @@ sp_gradient_vector_color_changed (SPColorSelector *csel, GtkObject *object) // g_snprintf (c, 256, "stop-color:#%06x;stop-opacity:%g;", rgb >> 8, (gdouble) alpha); //SP_OBJECT_REPR (stop)->setAttribute("style", c); - sp_document_done (SP_OBJECT_DOCUMENT (ngr)); + sp_document_done (SP_OBJECT_DOCUMENT (ngr), SP_VERB_CONTEXT_GRADIENT, + /* TODO: annotate */ "gradient-vector.cpp:1124"); blocked = FALSE; } diff --git a/src/widgets/layer-selector.cpp b/src/widgets/layer-selector.cpp index 94a891dc2..3b732c90d 100644 --- a/src/widgets/layer-selector.cpp +++ b/src/widgets/layer-selector.cpp @@ -30,6 +30,7 @@ #include "dialogs/layer-properties.h" #include "layer-manager.h" #include "xml/node-event-vector.h" +#include "verbs.h" namespace Inkscape { namespace Widgets { @@ -577,14 +578,16 @@ void LayerSelector::_prepareLabelRenderer( void LayerSelector::_lockLayer(bool lock) { if ( _layer && SP_IS_ITEM(_layer) ) { SP_ITEM(_layer)->setLocked(lock); - sp_document_maybe_done(sp_desktop_document(_desktop), "LayerSelector:lock"); + sp_document_maybe_done(sp_desktop_document(_desktop), "LayerSelector:lock", SP_VERB_NONE, + /* TODO: annotate */ "layer-selector.cpp:582"); } } void LayerSelector::_hideLayer(bool hide) { if ( _layer && SP_IS_ITEM(_layer) ) { SP_ITEM(_layer)->setHidden(hide); - sp_document_maybe_done(sp_desktop_document(_desktop), "LayerSelector:hide"); + sp_document_maybe_done(sp_desktop_document(_desktop), "LayerSelector:hide", SP_VERB_NONE, + /* TODO: annotate */ "layer-selector.cpp:590"); } } diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index 6bcb24d2d..2f42d590f 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -219,7 +219,8 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) NR::Matrix scaler = get_scale_transform_with_stroke (bbox, strokewidth, transform_stroke, x0, y0, x1, y1); sp_selection_apply_affine(selection, scaler); - sp_document_maybe_done (document, actionkey); + sp_document_maybe_done (document, actionkey, SP_VERB_CONTEXT_SELECT, + /* TODO: annotate */ "select-toolbar.cpp:223"); // defocus spinbuttons by moving focus to the canvas, unless "stay" is on spinbutton_defocus(GTK_OBJECT(spw)); diff --git a/src/widgets/sp-xmlview-content.cpp b/src/widgets/sp-xmlview-content.cpp index ffec0b723..7961a4511 100644 --- a/src/widgets/sp-xmlview-content.cpp +++ b/src/widgets/sp-xmlview-content.cpp @@ -160,6 +160,7 @@ sp_xmlview_content_changed (GtkTextBuffer *tb, SPXMLViewContent *text) text->repr->setContent(data); g_free (data); text->blocked = FALSE; - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_NONE, + /* TODO: annotate */ "sp-xmlview-content.cpp:164"); } } diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index c8e484e3b..7ff4f115e 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -850,7 +850,8 @@ sp_stb_magnitude_value_changed(GtkAdjustment *adj, GtkWidget *tbl) modmade = true; } } - if (modmade) sp_document_done(sp_desktop_document(desktop)); + if (modmade) sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR, + /* TODO: annotate */ "toolbox.cpp:854"); g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE)); @@ -894,7 +895,8 @@ sp_stb_proportion_value_changed(GtkAdjustment *adj, GtkWidget *tbl) } } - if (modmade) sp_document_done(sp_desktop_document(desktop)); + if (modmade) sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR, + /* TODO: annotate */ "toolbox.cpp:899"); g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE)); @@ -947,7 +949,8 @@ sp_stb_sides_flat_state_changed(GtkWidget *widget, GtkObject *tbl) } } } - if (modmade) sp_document_done(sp_desktop_document(desktop)); + if (modmade) sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR, + /* TODO: annotate */ "toolbox.cpp:953"); g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE)); @@ -983,7 +986,8 @@ sp_stb_rounded_value_changed(GtkAdjustment *adj, GtkWidget *tbl) modmade = true; } } - if (modmade) sp_document_done(sp_desktop_document(desktop)); + if (modmade) sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR, + /* TODO: annotate */ "toolbox.cpp:990"); g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE)); @@ -1020,7 +1024,8 @@ sp_stb_randomized_value_changed(GtkAdjustment *adj, GtkWidget *tbl) modmade = true; } } - if (modmade) sp_document_done(sp_desktop_document(desktop)); + if (modmade) sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_STAR, + /* TODO: annotate */ "toolbox.cpp:1028"); g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE)); @@ -1359,7 +1364,8 @@ sp_rtb_value_changed(GtkAdjustment *adj, GtkWidget *tbl, gchar const *value_name sp_rtb_sensitivize (tbl); if (modmade) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_RECT, + /* TODO: annotate */ "toolbox.cpp:1368"); } g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE)); @@ -1675,7 +1681,8 @@ sp_spl_tb_value_changed(GtkAdjustment *adj, GtkWidget *tbl, gchar const *value_n g_free(namespaced_name); if (modmade) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_SPIRAL, + /* TODO: annotate */ "toolbox.cpp:1685"); } g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE)); @@ -2236,7 +2243,8 @@ sp_arctb_startend_value_changed(GtkAdjustment *adj, GtkWidget *tbl, gchar const sp_arctb_sensitivize (tbl, adj->value, other->value); if (modmade) { - sp_document_maybe_done(sp_desktop_document(desktop), value_name); + sp_document_maybe_done(sp_desktop_document(desktop), value_name, SP_VERB_CONTEXT_ARC, + /* TODO: annotate */ "toolbox.cpp:2247"); } // defocus spinbuttons by moving focus to the canvas, unless "stay" is on @@ -2308,7 +2316,8 @@ sp_arctb_open_state_changed(GtkWidget *widget, GtkObject *tbl) } if (modmade) { - sp_document_done(sp_desktop_document(desktop)); + sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_ARC, + /* TODO: annotate */ "toolbox.cpp:2320"); } g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE)); @@ -3011,7 +3020,8 @@ sp_text_toolbox_family_changed (GtkTreeSelection *selection, sp_desktop_set_style (desktop, css, true, true); } - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "toolbox.cpp:3024"); sp_repr_css_attr_unref (css); free (family); gtk_widget_hide (GTK_WIDGET (g_object_get_data (G_OBJECT(tbl), "warning-image"))); @@ -3093,7 +3103,8 @@ sp_text_toolbox_anchoring_toggled (GtkRadioButton *button, } sp_desktop_set_style (desktop, css, true, true); - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "toolbox.cpp:3107"); sp_repr_css_attr_unref (css); gtk_widget_grab_focus (GTK_WIDGET(desktop->canvas)); @@ -3138,7 +3149,8 @@ sp_text_toolbox_style_toggled (GtkToggleButton *button, } sp_desktop_set_style (desktop, css, true, true); - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "toolbox.cpp:3153"); sp_repr_css_attr_unref (css); gtk_widget_grab_focus (GTK_WIDGET(desktop->canvas)); @@ -3184,7 +3196,8 @@ sp_text_toolbox_orientation_toggled (GtkRadioButton *button, } sp_desktop_set_style (desktop, css, true, true); - sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP)); + sp_document_done (sp_desktop_document (SP_ACTIVE_DESKTOP), SP_VERB_CONTEXT_TEXT, + /* TODO: annotate */ "toolbox.cpp:3200"); sp_repr_css_attr_unref (css); gtk_widget_grab_focus (GTK_WIDGET(desktop->canvas)); @@ -3279,7 +3292,8 @@ sp_text_toolbox_size_changed (GtkComboBox *cbox, } sp_desktop_set_style (desktop, css, true, true); - sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:size"); + sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:size", SP_VERB_NONE, + /* TODO: annotate */ "toolbox.cpp:3296"); sp_repr_css_attr_unref (css); @@ -3833,7 +3847,8 @@ static void connector_spacing_changed(GtkAdjustment *adj, GtkWidget *tbl) g_slist_free(items); } - sp_document_done(doc); + sp_document_done(doc, SP_VERB_CONTEXT_CONNECTOR, + /* TODO: annotate */ "toolbox.cpp:3851"); g_object_set_data(G_OBJECT(tbl), "freeze", GINT_TO_POINTER(FALSE));