forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmemcheck.h
167 lines (140 loc) · 4.56 KB
/
memcheck.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//
// Copyright : (C) 2015 Eran Ifrah
// File name : memcheck.h
//
// -------------------------------------------------------------------------
// A
// _____ _ _ _ _
// / __ \ | | | | (_) |
// | / \/ ___ __| | ___| | _| |_ ___
// | | / _ \ / _ |/ _ \ | | | __/ _ )
// | \__/\ (_) | (_| | __/ |___| | || __/
// \____/\___/ \__,_|\___\_____/_|\__\___|
//
// F i l e
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
/**
* @file
* @author pavel.iqx
* @date 2014
* @copyright GNU General Public License v2
*/
#ifndef _MEMCHECK_H_
#define _MEMCHECK_H_
#include <wx/process.h>
#include "plugin.h"
#include "memcheckui.h"
#include "imemcheckprocessor.h"
#include "TerminalEmulator.h"
#include "clTabTogglerHelper.h"
class MemCheckOutputView;
class MemCheckPlugin : public IPlugin
{
public:
MemCheckPlugin(IManager* manager);
virtual ~MemCheckPlugin();
//--------------------------------------------
// Abstract methods
//--------------------------------------------
virtual clToolBar* CreateToolBar(wxWindow* parent);
virtual void CreatePluginMenu(wxMenu* pluginsMenu);
virtual void HookPopupMenu(wxMenu* menu, MenuType type);
virtual void UnHookPopupMenu(wxMenu* menu, MenuType type);
virtual void UnPlug();
MemCheckSettings* const GetSettings()
{
return m_settings;
};
virtual IMemCheckProcessor* GetProcessor()
{
return m_memcheckProcessor;
}
/**
* @brief true if test is not runnging and GUI can respond, otherwise if test is runnign user can't listing errors
* and managing supp file
* @param event
* @return Plugin status.
*/
bool IsReady(wxUpdateUIEvent& event);
/**
* @brief stop the current running process using SIGTERM
*/
void StopProcess();
/**
* @brief return true if a test is currently running
* @return
*/
// bool IsRunning() const { return m_process != NULL; }
bool IsRunning() const
{
return m_terminal.IsRunning();
}
protected:
MemCheckIcons16 m_icons16;
MemCheckIcons24 m_icons24;
IMemCheckProcessor* m_memcheckProcessor;
MemCheckSettings* m_settings;
TerminalEmulator m_terminal;
MemCheckOutputView* m_outputView; ///< Main plugin UI pane.
clTabTogglerHelper::Ptr_t m_tabHelper;
protected:
void OnWorkspaceLoaded(wxCommandEvent& event);
void OnWorkspaceClosed(wxCommandEvent& event);
/**
* @brief After settings dialogue is closed, settings are reapplied in plugin.
*/
void ApplySettings(bool loadLastErrors = true);
/**
* @brief After test ends Output notebook is opened. This opens MemCheck notebook.
*/
void SwitchToMyPage();
/**
* @brief User wants test active project.
* @param event
*/
void OnCheckAtiveProject(wxCommandEvent& event);
/**
* @brief stop the currently running process
* @param event
*/
void OnStopProcess(wxCommandEvent& event);
void OnStopProcessUI(wxUpdateUIEvent& event);
/**
* @brief User wants test some project in workspace tree.
* @param event
*/
void OnCheckPopupProject(wxCommandEvent& event);
/**
* @brief User wants test project to which belongs file in active editor.
* @param event
*/
void OnCheckPopupEditor(wxCommandEvent& event);
/**
* @brief Executes the test.
* @param projectName
*/
void CheckProject(const wxString& projectName);
void OnProcessOutput(clCommandEvent& event);
void OnProcessTerminated(clCommandEvent& event);
/**
* @brief Analyse can be made independent of CodeLite and log can be load from file.
* @param event
*/
void OnImportLog(wxCommandEvent& event);
/**
* @brief Settings dialog invoked.
* @param event
*/
void OnSettings(wxCommandEvent& event);
void OnMemCheckUI(wxUpdateUIEvent& event);
};
#endif // memcheck