forked from bruderstein/PythonScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsoleDialog.h
More file actions
98 lines (76 loc) · 2.3 KB
/
ConsoleDialog.h
File metadata and controls
98 lines (76 loc) · 2.3 KB
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
#ifndef _CONSOLEDIALOG_H
#define _CONSOLEDIALOG_H
#include "stdafx.h"
#include "DockingDlgInterface.h"
#include "PluginInterface.h"
void export_console();
class ConsoleInterface;
struct LineDetails;
class ConsoleDialog : public DockingDlgInterface
{
public:
ConsoleDialog();
~ConsoleDialog();
void init(HINSTANCE hInst, NppData nppData, ConsoleInterface *console);
void doDialog();
void hide();
BOOL CALLBACK run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
void writeText(int length, const char *text);
void writeError(int length, const char *text);
void clearText();
void setPrompt(const char *prompt);
HWND getScintillaHwnd() { return m_scintilla; };
void runEnabled(bool enabled);
private:
void createOutputWindow(HWND hParentWindow);
void runStatement();
void stopStatement();
LRESULT run_inputWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static LRESULT inputWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
void historyNext();
void historyPrevious();
void historyAdd(const char *line);
void historyEnd();
LRESULT callScintilla(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
{ return ::SendMessage(m_scintilla, message, wParam, lParam); }
/* Styler functions */
void onStyleNeeded(SCNotification* notification);
bool parsePythonErrorLine(LineDetails *lineDetails);
bool parseVSErrorLine(LineDetails *lineDetails);
bool parseGCCErrorLine(LineDetails *lineDetails);
//void styleDefaultLine(int lineNumber, int lineLength, const char *line);
void onHotspotClick(SCNotification* notification);
bool parseLine(LineDetails *lineDetails);
//HWND m_hNpp;
tTbData m_data;
HWND m_scintilla;
HWND m_hInput; // Input TextBox
ConsoleInterface *m_console;
std::string m_prompt;
WNDPROC m_originalInputWndProc;
HICON m_hTabIcon;
std::list<std::string> m_history;
std::list<std::string>::iterator m_historyIter;
std::map<int, std::string> m_changes;
int m_currentHistory;
bool m_runButtonIsRun;
HMENU m_hContext;
};
enum ErrorLevel
{
EL_UNSET,
EL_INFO,
EL_WARNING,
EL_ERROR
};
struct LineDetails
{
public:
char *line;
int lineLength;
int errorLineNo;
int filenameStart;
int filenameEnd;
ErrorLevel errorLevel;
};
#endif