X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=gui%2Fretracer.h;h=d6da7ac5fd5e385cfca96bcab85553122a958b86;hb=95b4056d6a126a90e8e4e046e250ee4d75a1e8db;hp=1b5a4bd04313ed0ed3406eb42588397583bdc60f;hpb=b39e1c64410931066aa8d648fa9c765121a6ea42;p=apitrace diff --git a/gui/retracer.h b/gui/retracer.h index 1b5a4bd..d6da7ac 100644 --- a/gui/retracer.h +++ b/gui/retracer.h @@ -1,70 +1,13 @@ #ifndef RETRACER_H #define RETRACER_H +#include "trace_api.hpp" +#include "apitracecall.h" + #include #include class ApiTraceState; -namespace QJson { - class Parser; -} - -struct RetraceError { - int callIndex; - QString type; - QString message; -}; - -/* internal class used by the retracer to run - * in the thread */ -class RetraceProcess : public QObject -{ - Q_OBJECT -public: - RetraceProcess(QObject *parent=0); - ~RetraceProcess(); - - QProcess *process() const; - - QString fileName() const; - void setFileName(const QString &name); - - bool isBenchmarking() const; - void setBenchmarking(bool bench); - - bool isDoubleBuffered() const; - void setDoubleBuffered(bool db); - - void setCaptureAtCallNumber(qlonglong num); - qlonglong captureAtCallNumber() const; - - bool captureState() const; - void setCaptureState(bool enable); - -public slots: - void start(); - void terminate(); - -signals: - void finished(const QString &output); - void error(const QString &msg); - void foundState(const ApiTraceState &state); - void retraceErrors(const QList &errors); - -private slots: - void replayFinished(); - void replayError(QProcess::ProcessError err); - -private: - QString m_fileName; - bool m_benchmarking; - bool m_doubleBuffered; - bool m_captureState; - qlonglong m_captureCall; - - QProcess *m_process; - QJson::Parser *m_jsonParser; -}; class Retracer : public QThread { @@ -75,6 +18,8 @@ public: QString fileName() const; void setFileName(const QString &name); + void setAPI(trace::API api); + bool isBenchmarking() const; void setBenchmarking(bool bench); @@ -87,22 +32,26 @@ public: bool captureState() const; void setCaptureState(bool enable); + bool captureThumbnails() const; + void setCaptureThumbnails(bool enable); + signals: void finished(const QString &output); - void foundState(const ApiTraceState &state); + void foundState(ApiTraceState *state); + void foundThumbnails(const QList &thumbnails); void error(const QString &msg); - void retraceErrors(const QList &errors); + void retraceErrors(const QList &errors); protected: virtual void run(); -private slots: - void cleanup(); private: QString m_fileName; + trace::API m_api; bool m_benchmarking; bool m_doubleBuffered; bool m_captureState; + bool m_captureThumbnails; qlonglong m_captureCall; QProcessEnvironment m_processEnvironment;