summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4c6e0ee)
raw | patch | inline | side by side (parent: 4c6e0ee)
author | mental <mental@users.sourceforge.net> | |
Thu, 10 May 2007 01:18:27 +0000 (01:18 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Thu, 10 May 2007 01:18:27 +0000 (01:18 +0000) |
src/debug/event.h | patch | blob | history | |
src/debug/logger.cpp | patch | blob | history | |
src/debug/simple-event.h | patch | blob | history |
diff --git a/src/debug/event.h b/src/debug/event.h
index 9a695470769f189119908c3f1df0ab599f29cd17..ad56751fc33493544cd892f3a98ebf4815d95e78 100644 (file)
--- a/src/debug/event.h
+++ b/src/debug/event.h
virtual Util::ptr_shared<char> name() const=0;
virtual unsigned propertyCount() const=0;
virtual PropertyPair property(unsigned property) const=0;
+
+ virtual void generateChildEvents() const=0;
};
}
diff --git a/src/debug/logger.cpp b/src/debug/logger.cpp
index 5d62f9a88149c185dcf734694faeb30ea1b268f0..4bd0a3b0868ba6c595dc2865f5e1fa1ea19857dd 100644 (file)
--- a/src/debug/logger.cpp
+++ b/src/debug/logger.cpp
tag_stack().push_back(name);
empty_tag = true;
+
+ event.generateChildEvents();
}
void Logger::_skip() {
index ce803b1cebb1624152726c872447438eef70afb7..115c1e2f479a7fbda64fe5f414796fed6efb0114 100644 (file)
--- a/src/debug/simple-event.h
+++ b/src/debug/simple-event.h
#ifndef SEEN_INKSCAPE_DEBUG_SIMPLE_EVENT_H
#define SEEN_INKSCAPE_DEBUG_SIMPLE_EVENT_H
+#include <stdarg.h>
#include <vector>
+#include "glib/gstrfuncs.h"
#include "gc-alloc.h"
#include "debug/event.h"
return _properties[property];
}
+ void generateChildEvents() const {}
+
protected:
void _addProperty(Util::ptr_shared<char> name,
Util::ptr_shared<char> value)
void _addProperty(char const *name, char const *value) {
_addProperty(Util::share_string(name), Util::share_string(value));
}
+ void _addProperty(Util::ptr_shared<char> name, unsigned long value) {
+ _addFormattedProperty(name, "%ul", value);
+ }
+ void _addProperty(char const *name, unsigned long value) {
+ _addProperty(Util::share_string(name), value);
+ }
private:
Util::ptr_shared<char> _name;
std::vector<PropertyPair, GC::Alloc<PropertyPair, GC::AUTO> > _properties;
+
+ void _addFormattedProperty(Util::ptr_shared<char> name, char const *format, ...)
+ {
+ va_list args;
+ va_start(args, format);
+ gchar *value=g_strdup_vprintf(format, args);
+ va_end(args);
+ _addProperty(name, value);
+ g_free(value);
+ }
};
}