00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00035 #ifndef PGLOG_H
00036 #define PGLOG_H
00037
00038 #include <stdarg.h>
00039 #include "SDL.h"
00040 #include "paragui.h"
00041 #include "pglabel.h"
00042
00044 typedef enum {
00045 PG_LOG_NONE,
00046 PG_LOG_ERR,
00047 PG_LOG_WRN,
00048 PG_LOG_MSG,
00049 PG_LOG_DBG
00050 } PG_LOG_LEVEL;
00051
00056 #define PG_LOGMTH_STDOUT 1
00057
00061 #define PG_LOGMTH_STDERR 2
00062
00066 #define PG_LOGMTH_CONSOLE 4
00067
00068 #ifdef __cplusplus
00069
00075 namespace PG_LogConsole {
00087 DECLSPEC void LogVA(PG_LOG_LEVEL id, const char *Text, va_list ap);
00088
00092 DECLSPEC void Done();
00093
00100 DECLSPEC void Update();
00101
00109 DECLSPEC void SetLogLevel(PG_LOG_LEVEL newlevel);
00110
00114 DECLSPEC void Show();
00115
00119 DECLSPEC void Hide();
00120
00124 DECLSPEC void Toggle();
00125
00131 DECLSPEC void SetMethod(int method);
00132
00138 DECLSPEC int GetMethod();
00139
00146 DECLSPEC void SetConsoleKey(SDLKey key);
00147
00153 DECLSPEC SDLKey GetConsoleKey();
00154
00161 DECLSPEC void SetTitle(const char* title, PG_Label::TextAlign alignment = PG_Label::CENTER);
00162
00168 DECLSPEC void SetMaxLogLines(Uint32 max);
00169 }
00170
00171 #endif
00172
00173 #ifdef __cplusplus
00174 extern "C" {
00175 #endif
00176
00183 DECLSPEC void PG_Log(PG_LOG_LEVEL id, const char *Text, ...);
00184
00190 DECLSPEC void PG_LogMSG(const char *fmt, ...);
00191
00197 DECLSPEC void PG_LogERR(const char *fmt, ...);
00198
00204 DECLSPEC void PG_LogWRN(const char *fmt, ...);
00205
00211 DECLSPEC void PG_LogDBG(const char *fmt, ...);
00212
00213 #ifdef __cplusplus
00214 }
00215 #endif
00216
00217 #endif // PGLOG_H
00218
00219
00220
00221
00222
00223