]> git.cworth.org Git - apitrace/blobdiff - gui/mainwindow.h
gui/mainwindow: Add functions that toggle actions enables and use it.
[apitrace] / gui / mainwindow.h
index d898f3ca7e04d0b9d3dd9bb292705006155a7296..78267efca4c9f5cd98bb4eb0b48a5bc980ae3ceb 100644 (file)
@@ -29,8 +29,12 @@ class Retracer;
 class SearchWidget;
 class ShadersSourceWidget;
 class TraceProcess;
+class TrimProcess;
+class ProfileDialog;
 class VertexDataInterpreter;
 
+namespace trace { struct Profile; }
+
 class MainWindow : public QMainWindow
 {
     Q_OBJECT
@@ -43,18 +47,23 @@ public slots:
 
 private slots:
     void callItemSelected(const QModelIndex &index);
+    void callItemActivated(const QModelIndex &index);
     void createTrace();
     void openTrace();
     void replayStart();
+    void replayProfile();
     void replayStop();
-    void replayFinished(const QString &output);
+    void replayFinished(const QString &message);
     void replayStateFound(ApiTraceState *state);
+    void replayProfileFound(trace::Profile *state);
     void replayThumbnailsFound(const QList<QImage> &thumbnails);
     void replayError(const QString &msg);
     void startedLoadingTrace();
     void loadProgess(int percent);
     void finishedLoadingTrace();
     void lookupState();
+    void showThumbnails();
+    void trim();
     void showSettings();
     void openHelp(const QUrl &url);
     void showSurfacesMenu(const QPoint &pos);
@@ -64,6 +73,8 @@ private slots:
     void slotJumpTo(int callNum);
     void createdTrace(const QString &path);
     void traceError(const QString &msg);
+    void createdTrim(const QString &path);
+    void trimError(const QString &msg);
     void slotSearch();
     void slotSearchNext(const QString &str, Qt::CaseSensitivity sensitivity);
     void slotSearchPrev(const QString &str, Qt::CaseSensitivity sensitivity);
@@ -87,8 +98,10 @@ private slots:
 private:
     void initObjects();
     void initConnections();
+    void updateActionsState(bool traceLoaded, bool stopped = true);
     void newTraceFile(const QString &fileName);
     void replayTrace(bool dumpState, bool dumpThumbnails);
+    void trimEvent();
     void fillStateForFrame();
 
     /* there's a difference between selected frame/call and
@@ -100,6 +113,8 @@ private:
     ApiTraceFrame *currentFrame() const;
     ApiTraceCall *currentCall() const;
 
+protected:
+    virtual void closeEvent(QCloseEvent * event);
 
 private:
     Ui_MainWindow m_ui;
@@ -118,6 +133,8 @@ private:
 
     ApiTraceEvent *m_stateEvent;
 
+    ApiTraceEvent *m_trimEvent;
+
     Retracer *m_retracer;
 
     VertexDataInterpreter *m_vdataInterpreter;
@@ -127,9 +144,13 @@ private:
 
     TraceProcess *m_traceProcess;
 
+    TrimProcess *m_trimProcess;
+
     ArgumentsEditor *m_argsEditor;
 
     ApiTraceEvent *m_nonDefaultsLookupEvent;
+
+    ProfileDialog* m_profileDialog;
 };