]> git.cworth.org Git - vogl/blobdiff - src/vogleditor/vogleditor_output.h
Merge branch 'master' of https://github.com/ValveSoftware/vogl
[vogl] / src / vogleditor / vogleditor_output.h
diff --git a/src/vogleditor/vogleditor_output.h b/src/vogleditor/vogleditor_output.h
new file mode 100644 (file)
index 0000000..bbeec1c
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef VOGLEDITOR_OUTPUT_H
+#define VOGLEDITOR_OUTPUT_H
+
+class QTextEdit;
+
+class vogleditor_output
+{
+public:
+    vogleditor_output();
+    ~vogleditor_output();
+
+    void init(QTextEdit* pTextEdit) { m_pTextEdit = pTextEdit; }
+
+    void message(const char* pMessage);
+    void warning(const char* pWarning);
+    void error(const char* pError);
+
+private:
+    QTextEdit* m_pTextEdit;
+};
+
+static vogleditor_output gs_OUTPUT;
+
+static void vogleditor_output_init(QTextEdit* pTextEdit) { gs_OUTPUT.init(pTextEdit); }
+static void vogleditor_output_message(const char* pMessage) { gs_OUTPUT.message(pMessage); }
+static void vogleditor_output_warning(const char* pWarning) { gs_OUTPUT.warning(pWarning); }
+static void vogleditor_output_error(const char* pError) { gs_OUTPUT.error(pError); }
+static void vogleditor_output_deinit() { gs_OUTPUT.init(0); }
+
+#endif // VOGLEDITOR_OUTPUT_H