2009-12-09 17:22:50 +03:00
|
|
|
#ifndef PRINTUTILS_H_
|
|
|
|
#define PRINTUTILS_H_
|
|
|
|
|
|
|
|
#include <QString>
|
2010-01-06 13:48:51 +03:00
|
|
|
#include <QList>
|
|
|
|
|
2010-02-28 23:54:55 +03:00
|
|
|
typedef void (OutputHandlerFunc)(const QString &msg, void *userdata);
|
|
|
|
extern OutputHandlerFunc *outputhandler;
|
|
|
|
extern void *outputhandler_data;
|
|
|
|
|
|
|
|
void set_output_handler(OutputHandlerFunc *newhandler, void *userdata);
|
|
|
|
|
2010-01-06 13:48:51 +03:00
|
|
|
extern QList<QString> print_messages_stack;
|
|
|
|
void print_messages_push();
|
|
|
|
void print_messages_pop();
|
2009-12-09 17:22:50 +03:00
|
|
|
|
|
|
|
void PRINT(const QString &msg);
|
|
|
|
#define PRINTF(_fmt, ...) do { QString _m; _m.sprintf(_fmt, ##__VA_ARGS__); PRINT(_m); } while (0)
|
|
|
|
#define PRINTA(_fmt, ...) do { QString _m = QString(_fmt).arg(__VA_ARGS__); PRINT(_m); } while (0)
|
|
|
|
|
2010-01-06 13:48:51 +03:00
|
|
|
void PRINT_NOCACHE(const QString &msg);
|
|
|
|
#define PRINTF_NOCACHE(_fmt, ...) do { QString _m; _m.sprintf(_fmt, ##__VA_ARGS__); PRINT_NOCACHE(_m); } while (0)
|
|
|
|
#define PRINTA_NOCACHE(_fmt, ...) do { QString _m = QString(_fmt).arg(__VA_ARGS__); PRINT_NOCACHE(_m); } while (0)
|
|
|
|
|
2009-12-09 17:22:50 +03:00
|
|
|
#endif
|