Sandboxie/SandboxiePlus/SandMan/Views/TraceView.h

135 lines
2.6 KiB
C
Raw Normal View History

2021-10-15 16:39:43 +01:00
#pragma once
#include "../../MiscHelpers/Common/PanelView.h"
#include "../../MiscHelpers/Common/TreeviewEx.h"
#include "../Models/SbieModel.h"
2022-03-26 09:09:24 +00:00
#include "../Models/TraceModel.h"
#include "../Models/MonitorModel.h"
2021-10-15 16:39:43 +01:00
class CTraceFilterProxyModel;
2022-03-26 09:09:24 +00:00
class CTraceTree : public CPanelWidget<QTreeViewEx>
{
Q_OBJECT
public:
CTraceTree(QWidget* parent = 0);
~CTraceTree();
CTraceModel* m_pTraceModel;
public slots:
void SetFilter(const QRegExp& Exp, bool bHighLight = false, int Column = -1) {
emit FilterSet(Exp, bHighLight, Column);
}
void SelectNext() {}
signals:
void FilterSet(const QRegExp& Exp, bool bHighLight = false, int Column = -1);
};
class CMonitorList : public CPanelWidget<QTreeViewEx>
{
public:
CMonitorList(QWidget* parent = 0);
~CMonitorList();
CSortFilterProxyModel* m_pSortProxy;
CMonitorModel* m_pMonitorModel;
};
class CTraceView : public QWidget
2021-10-15 16:39:43 +01:00
{
Q_OBJECT
public:
2022-07-09 10:46:07 +01:00
CTraceView(bool bStandAlone, QWidget* parent = 0);
2021-10-15 16:39:43 +01:00
~CTraceView();
2022-04-07 19:49:13 +01:00
void AddAction(QAction* pAction);
2021-10-15 16:39:43 +01:00
public slots:
2022-07-09 10:46:07 +01:00
void Refresh();
void Clear();
2021-10-15 16:39:43 +01:00
void OnSetTree();
2022-03-26 09:09:24 +00:00
void OnSetMode();
2021-10-15 16:39:43 +01:00
void OnSetPidFilter();
void OnSetTidFilter();
void OnSetFilter();
private slots:
void UpdateFilters();
void SetFilter(const QRegExp& Exp, bool bHighLight = false, int Col = -1); // -1 = any
2021-10-16 17:24:16 +01:00
void SaveToFile();
2022-03-26 09:09:24 +00:00
protected:
2022-07-09 10:46:07 +01:00
void timerEvent(QTimerEvent* pEvent);
int m_uTimerID;
2022-03-26 09:09:24 +00:00
struct SProgInfo
{
QString Name;
QSet<quint32> Threads;
};
QMap<quint32, SProgInfo>m_PidMap;
quint64 m_LastID;
int m_LastCount;
bool m_bUpdatePending;
QMap<QString, CMonitorEntryPtr> m_MonitorMap;
2021-10-15 16:39:43 +01:00
protected:
friend int CTraceView__Filter(const CTraceEntryPtr& pEntry, void* params);
2022-03-26 09:09:24 +00:00
2021-10-15 16:39:43 +01:00
bool m_FullRefresh;
QRegExp m_FilterExp;
bool m_bHighLight;
//int m_FilterCol;
quint32 m_FilterPid;
quint32 m_FilterTid;
2021-10-30 08:46:49 +01:00
QList<quint32> m_FilterTypes;
2021-10-15 16:39:43 +01:00
quint32 m_FilterStatus;
void* m_pCurrentBox;
2022-03-26 09:09:24 +00:00
QVBoxLayout* m_pMainLayout;
CTraceTree* m_pTrace;
CMonitorList* m_pMonitor;
2021-10-15 16:39:43 +01:00
QToolBar* m_pTraceToolBar;
2022-03-26 09:09:24 +00:00
QAction* m_pMonitorMode;
2021-10-15 16:39:43 +01:00
QAction* m_pTraceTree;
QComboBox* m_pTracePid;
QComboBox* m_pTraceTid;
2021-10-30 08:46:49 +01:00
class QCheckList* m_pTraceType;
2021-10-15 16:39:43 +01:00
QComboBox* m_pTraceStatus;
2021-10-16 17:24:16 +01:00
QAction* m_pAllBoxes;
QAction* m_pSaveToFile;
2021-10-15 16:39:43 +01:00
2022-03-26 09:09:24 +00:00
QWidget* m_pView;
QStackedLayout* m_pLayout;
2022-07-09 10:46:07 +01:00
};
2022-07-11 20:12:42 +01:00
////////////////////////////////////////////////////////////////////////////////////////
// CTraceWindow
2022-07-09 10:46:07 +01:00
class CTraceWindow : public QDialog
{
Q_OBJECT
public:
CTraceWindow(QWidget *parent = Q_NULLPTR);
~CTraceWindow();
signals:
void Closed();
protected:
void closeEvent(QCloseEvent *e);
};