1 /*
2 * Inkscape::Debug::GdkEventLatencyTracker - tracks backlog of GDK events
3 *
4 * Authors:
5 * MenTaLguY <mental@rydia.net>
6 *
7 * Copyright (C) 2008 MenTaLguY
8 *
9 * Released under GNU GPL, read the file 'COPYING' for more information
10 */
12 #ifndef SEEN_INKSCAPE_DEBUG_GDK_EVENT_LATENCY_TRACKER_H
13 #define SEEN_INKSCAPE_DEBUG_GDK_EVENT_LATENCY_TRACKER_H
15 #include <gdk/gdkevents.h>
16 #include <glibmm/timer.h>
17 #include <boost/optional.hpp>
19 namespace Inkscape {
20 namespace Debug {
22 class GdkEventLatencyTracker {
23 public:
24 GdkEventLatencyTracker();
25 boost::optional<double> process(GdkEvent const *e);
26 double maxLatency() const { return max_latency; }
27 double getSkew();
29 static GdkEventLatencyTracker &default_tracker();
31 private:
32 GdkEventLatencyTracker(GdkEventLatencyTracker const &); // no copy
33 void operator=(GdkEventLatencyTracker const &); // no assign
35 double start_seconds;
36 double max_latency;
37 double skew;
38 double last_elapsed;
39 double last_seconds;
40 Glib::Timer elapsed;
41 };
43 }
44 }
46 #endif
47 /*
48 Local Variables:
49 mode:c++
50 c-file-style:"stroustrup"
51 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
52 indent-tabs-mode:nil
53 fill-column:99
54 End:
55 */
56 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :