]> git.cworth.org Git - vogl/blob - src/vogleditor/vogleditor_output.h
UI: Update vogleditor_output so that it can be used from other files without having...
[vogl] / src / vogleditor / vogleditor_output.h
1 #ifndef VOGLEDITOR_OUTPUT_H
2 #define VOGLEDITOR_OUTPUT_H
3
4 class QTextEdit;
5
6 class vogleditor_output
7 {
8 public:
9     vogleditor_output();
10     ~vogleditor_output();
11
12     void init(QTextEdit* pTextEdit) { m_pTextEdit = pTextEdit; }
13
14     void message(const char* pMessage);
15     void warning(const char* pWarning);
16     void error(const char* pError);
17
18 private:
19     QTextEdit* m_pTextEdit;
20 };
21
22 extern vogleditor_output gs_OUTPUT;
23
24 static void vogleditor_output_init(QTextEdit* pTextEdit) { gs_OUTPUT.init(pTextEdit); }
25 static void vogleditor_output_message(const char* pMessage) { gs_OUTPUT.message(pMessage); }
26 static void vogleditor_output_warning(const char* pWarning) { gs_OUTPUT.warning(pWarning); }
27 static void vogleditor_output_error(const char* pError) { gs_OUTPUT.error(pError); }
28 static void vogleditor_output_deinit() { gs_OUTPUT.init(0); }
29
30 #endif // VOGLEDITOR_OUTPUT_H