~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/debug/gdk-event-latency-tracker.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 */
 
11
 
 
12
#ifndef SEEN_INKSCAPE_DEBUG_GDK_EVENT_LATENCY_TRACKER_H
 
13
#define SEEN_INKSCAPE_DEBUG_GDK_EVENT_LATENCY_TRACKER_H
 
14
 
 
15
#include <gdk/gdkevents.h>
 
16
#include <glibmm/timer.h>
 
17
#include <boost/optional.hpp>
 
18
 
 
19
namespace Inkscape {
 
20
namespace Debug {
 
21
 
 
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();
 
28
 
 
29
    static GdkEventLatencyTracker &default_tracker();
 
30
 
 
31
private:
 
32
    GdkEventLatencyTracker(GdkEventLatencyTracker const &); // no copy
 
33
    void operator=(GdkEventLatencyTracker const &); // no assign
 
34
 
 
35
    double start_seconds;
 
36
    double max_latency;
 
37
    double skew;
 
38
    double last_elapsed;
 
39
    double last_seconds;
 
40
    Glib::Timer elapsed;
 
41
};
 
42
 
 
43
}
 
44
}
 
45
 
 
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 :