From 5a86ba19f529e433846b5a6fef0f9f038b70d900 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 4 Dec 2001 17:57:25 +0000 Subject: Log system git-svn-id: http://svn.leocad.org/trunk@273 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/console.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 common/console.h (limited to 'common/console.h') diff --git a/common/console.h b/common/console.h new file mode 100644 index 0000000..d3aac8a --- /dev/null +++ b/common/console.h @@ -0,0 +1,42 @@ +#ifndef _CONSOLE_H_ +#define _CONSOLE_H_ + +typedef enum +{ + LC_CONSOLE_ERROR, + LC_CONSOLE_WARNING, + LC_CONSOLE_DEBUG, + LC_CONSOLE_MISC +} LC_CONSOLE_LEVEL; + +typedef void (*CONSOLECALLBACK) (LC_CONSOLE_LEVEL level, const char* text, void* user_data); + +class Console +{ +public: + Console (); + virtual ~Console (); + + void Print (LC_CONSOLE_LEVEL level, const char* format, ...); + void PrintMisc (const char* format, ...); + void PrintDebug (const char* format, ...); + void PrintWarning (const char* format, ...); + void PrintError (const char* format, ...); + + void SetWindowCallback (CONSOLECALLBACK func, void* data) + { m_pWindowFunc = func; m_pWindowFuncData = data; }; + +protected: + void InternalPrint (LC_CONSOLE_LEVEL level, const char* text); + + CONSOLECALLBACK m_pWindowFunc; + void* m_pWindowFuncData; + + // variables + bool use_tty; + bool use_file; +}; + +extern Console console; + +#endif // _CONSOLE_H_ -- cgit v1.2.3