From 4374842b066db69414729caff4244044edafbb59 Mon Sep 17 00:00:00 2001 From: mental Date: Sun, 6 May 2007 21:30:31 +0000 Subject: [PATCH] instrument actions --- src/helper/action.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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 +#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 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(action); + aobject = NR_ACTIVE_OBJECT(action); if (aobject->callbacks) { unsigned int i; -- 2.30.2