]> git.cworth.org Git - apitrace/blob - gui/retracer.h
qapitrace: Adjust PATH only once and for all.
[apitrace] / gui / retracer.h
1 #ifndef RETRACER_H
2 #define RETRACER_H
3
4 #include "trace_api.hpp"
5 #include "apitracecall.h"
6
7 #include <QThread>
8 #include <QProcess>
9
10 class ApiTraceState;
11
12 namespace trace { struct Profile; }
13
14 class Retracer : public QThread
15 {
16     Q_OBJECT
17 public:
18     Retracer(QObject *parent=0);
19
20     QString fileName() const;
21     void setFileName(const QString &name);
22
23     void setAPI(trace::API api);
24
25     bool isBenchmarking() const;
26     void setBenchmarking(bool bench);
27
28     bool isDoubleBuffered() const;
29     void setDoubleBuffered(bool db);
30
31     bool isProfilingGpu() const;
32     bool isProfilingCpu() const;
33     bool isProfilingPixels() const;
34     bool isProfiling() const;
35     void setProfiling(bool gpu, bool cpu, bool pixels);
36
37     void setCaptureAtCallNumber(qlonglong num);
38     qlonglong captureAtCallNumber() const;
39
40     bool captureState() const;
41     void setCaptureState(bool enable);
42
43     bool captureThumbnails() const;
44     void setCaptureThumbnails(bool enable);
45
46 signals:
47     void finished(const QString &output);
48     void foundState(ApiTraceState *state);
49     void foundProfile(trace::Profile *profile);
50     void foundThumbnails(const QList<QImage> &thumbnails);
51     void error(const QString &msg);
52     void retraceErrors(const QList<ApiTraceError> &errors);
53
54 protected:
55     virtual void run();
56
57 private:
58     QString m_fileName;
59     trace::API m_api;
60     bool m_benchmarking;
61     bool m_doubleBuffered;
62     bool m_captureState;
63     bool m_captureThumbnails;
64     qlonglong m_captureCall;
65     bool m_profileGpu;
66     bool m_profileCpu;
67     bool m_profilePixels;
68 };
69
70 #endif