#ifndef _LOG_
#define _LOG_

#include "misc.hh"
#include "config.hh"
#include "windows.hh"
#include <X11/Xlib.h>

struct StringNode
{
	StringNode *next;
	char *s;
	const char *cs;
	
	StringNode (char *);
	StringNode (const char *);
	~StringNode ();
};

struct LogWin
{
	MyColor hitext_color;
	MyColor text_color;
	MyColor back_color;
	MyFont font;
	StringNode *first;
	StringNode *last;
	
	int x, y, wd, ht;
	Window w;

#ifdef FONTS_XFT
	XftDraw *xft_draw;
#elif defined FONTS_XCORE
	GC gc;
#endif
	int lines, lines_max;
	int stopped;
	int dbg_ln;

	LogWin ();
	~LogWin ();
	int handle_ConfigureNotify ();
	int init ();
	int done ();
	int add (StringNode *);
	int pr (const char *, ...);
	int dbg (const char *, ...);
	int clear ();
	int stop ();
	int cont ();
	int draw ();
	int rmfirst ();
};

extern LogWin log_window;
extern SWindow *log_swindow;

#endif
