6 #include "trace_file.hpp"
7 #include "trace_parser.hpp"
13 class TraceLoader : public QObject
17 TraceLoader(QObject *parent=0);
21 ApiTraceCallSignature *signature(unsigned id);
22 void addSignature(unsigned id, ApiTraceCallSignature *signature);
24 ApiTraceEnumSignature *enumSignature(unsigned id);
25 void addEnumSignature(unsigned id, ApiTraceEnumSignature *signature);
28 void loadTrace(const QString &filename);
29 void loadFrame(ApiTraceFrame *frame);
30 void findFrameStart(ApiTraceFrame *frame);
31 void findFrameEnd(ApiTraceFrame *frame);
32 void findCallIndex(int index);
33 void search(const ApiTrace::SearchRequest &request);
36 void startedParsing();
37 void parsed(int percent);
38 void guessedApi(int api);
39 void finishedParsing();
41 void framesLoaded(const QList<ApiTraceFrame*> &frames);
42 void frameContentsLoaded(ApiTraceFrame *frame,
43 const QVector<ApiTraceCall*> &calls,
44 quint64 binaryDataSize);
46 void searchResult(const ApiTrace::SearchRequest &request,
47 ApiTrace::SearchResult result,
49 void foundFrameStart(ApiTraceFrame *frame);
50 void foundFrameEnd(ApiTraceFrame *frame);
51 void foundCallIndex(ApiTraceCall *call);
53 struct FrameBookmark {
57 FrameBookmark(const trace::ParseBookmark &s)
62 trace::ParseBookmark start;
65 int numberOfFrames() const;
66 int numberOfCallsInFrame(int frameIdx) const;
69 void guessApi(const trace::Call *call);
73 void searchNext(const ApiTrace::SearchRequest &request);
74 void searchPrev(const ApiTrace::SearchRequest &request);
76 int callInFrame(int callIdx) const;
77 bool callContains(trace::Call *call,
79 Qt::CaseSensitivity sensitivity);
80 QVector<ApiTraceCall*> fetchFrameContents(ApiTraceFrame *frame);
81 bool searchCallsBackwards(const QList<trace::Call*> &calls,
83 const ApiTrace::SearchRequest &request);
86 trace::Parser m_parser;
88 typedef QMap<int, FrameBookmark> FrameBookmarks;
89 FrameBookmarks m_frameBookmarks;
90 QList<ApiTraceFrame*> m_createdFrames;
92 QHash<QString, QUrl> m_helpHash;
94 QVector<ApiTraceCallSignature*> m_signatures;
95 QVector<ApiTraceEnumSignature*> m_enumSignatures;