diff options
| author | MenTaLguY <mental@rydia.net> | 2007-05-06 21:30:31 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-05-06 21:30:31 +0000 |
| commit | 2bfdd538c7375f94b468271fd6aac8a5cdaf6f70 (patch) | |
| tree | 4a891dae432746de7aabd1ca7c9b3b12dbdc7b7c /src/helper | |
| parent | add INTERACTION to filters in the environment variable (diff) | |
| download | inkscape-2bfdd538c7375f94b468271fd6aac8a5cdaf6f70.tar.gz inkscape-2bfdd538c7375f94b468271fd6aac8a5cdaf6f70.zip | |
instrument actions
(bzr r2978)
Diffstat (limited to 'src/helper')
| -rw-r--r-- | src/helper/action.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/helper/action.cpp b/src/helper/action.cpp index 1c8c7ec15..908c63638 100644 --- a/src/helper/action.cpp +++ b/src/helper/action.cpp @@ -13,6 +13,9 @@ #include <string.h> +#include "debug/logger.h" +#include "debug/timestamp.h" +#include "debug/simple-event.h" #include "helper/action.h" static void sp_action_class_init (SPActionClass *klass); @@ -110,6 +113,27 @@ sp_action_new(Inkscape::UI::View::View *view, return action; } +namespace { + +using Inkscape::Debug::SimpleEvent; +using Inkscape::Debug::Event; +using Inkscape::Util::share_static_string; +using Inkscape::Debug::timestamp; + +typedef SimpleEvent<Event::INTERACTION> ActionEventBase; + +class ActionEvent : public ActionEventBase { +public: + ActionEvent(SPAction const *action) + : ActionEventBase(share_static_string("action")) + { + _addProperty(share_static_string("timestamp"), timestamp()); + _addProperty(share_static_string("verb"), action->id); + } +}; + +} + /** \return None \brief Executes an action @@ -132,6 +156,8 @@ sp_action_perform (SPAction *action, void * data) nr_return_if_fail (action != NULL); nr_return_if_fail (SP_IS_ACTION (action)); + Inkscape::Debug::Logger::write<ActionEvent>(action); + aobject = NR_ACTIVE_OBJECT(action); if (aobject->callbacks) { unsigned int i; |
