1 /*
2 * Inkscape::Debug::Event - event for debug tracing
3 *
4 * Authors:
5 * MenTaLguY <mental@rydia.net>
6 *
7 * Copyright (C) 2005 MenTaLguY
8 *
9 * Released under GNU GPL, read the file 'COPYING' for more information
10 */
12 #ifndef SEEN_INKSCAPE_DEBUG_EVENT_H
13 #define SEEN_INKSCAPE_DEBUG_EVENT_H
15 #include <utility>
16 #include "util/share.h"
18 namespace Inkscape {
20 namespace Debug {
22 class Event {
23 public:
24 virtual ~Event() {}
26 enum Category {
27 CORE=0,
28 XML,
29 SPOBJECT,
30 DOCUMENT,
31 REFCOUNT,
32 EXTENSION,
33 OTHER
34 };
35 enum { N_CATEGORIES=OTHER+1 };
37 struct PropertyPair {
38 public:
39 PropertyPair() {}
40 PropertyPair(Util::shared_ptr<char> n, Util::shared_ptr<char> v)
41 : name(n), value(v) {}
42 PropertyPair(char const *n, Util::shared_ptr<char> v)
43 : name(Util::share_string(n)), value(v) {}
44 PropertyPair(Util::shared_ptr<char> n, char const *v)
45 : name(n), value(Util::share_string(v)) {}
46 PropertyPair(char const *n, char const *v)
47 : name(Util::share_string(n)),
48 value(Util::share_string(v)) {}
50 Util::shared_ptr<char> name;
51 Util::shared_ptr<char> value;
52 };
54 static Category category() { return OTHER; }
56 virtual Util::shared_ptr<char> name() const=0;
57 virtual unsigned propertyCount() const=0;
58 virtual PropertyPair property(unsigned property) const=0;
59 };
61 }
63 }
65 #endif
66 /*
67 Local Variables:
68 mode:c++
69 c-file-style:"stroustrup"
70 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
71 indent-tabs-mode:nil
72 fill-column:99
73 End:
74 */
75 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :