#ifndef COMMANDS_H
#define COMMANDS_H

struct CmdItem
{
	CmdItem *next;

	CmdItem ();
	virtual ~CmdItem () {};
};

//********************************************************************

struct CmdQueue
{
	CmdItem *first;
	CmdItem *last;

	int dont_exec;

	CmdQueue ();
	~CmdQueue ();
	int add (CmdItem *);
	int exec ();
};

//********************************************************************

struct Cmd: CmdItem
{
	virtual int exec () {};
};

struct Menu;

struct CBeep	: Cmd { int exec (); };
struct CQuit	: Cmd { int exec (); };
struct CRestart	: Cmd { char *cmd; CRestart (); int exec (); };
struct CExec	: Cmd { char *cmd; CExec (); int exec (); };
struct CPopup	: Cmd { Menu *menu; CPopup (); int exec (); };
struct CScroll		: Cmd { int type, dx, dy; CScroll (int); int exec (); };
struct CMoveCursor	: Cmd { int dx, dy; CMoveCursor (); int exec (); };
struct CRaisePager	: Cmd { int exec (); };
struct CSeqSwitch	: Cmd { int exec (); };
struct CNop		: Cmd { int exec (); };
struct CToggleLock	: Cmd { int exec (); };

struct CLogCmd		: Cmd { int cmd; CLogCmd (int); int exec (); };

#define CL_RAISE	51
#define CL_CLEAR	52
#define CL_STOP		53
#define CL_CONT		54

struct SWindow;

struct WinCmd: Cmd
{
	int cmd;
	SWindow *sw;

	WinCmd (SWindow *, int);
	WinCmd (int);
	int exec_case ();
	int exec ();
};

#define CW_CLOSE	101
#define CW_DESTROY	102
#define CW_MOVE		103
#define CW_RAISE_MOVE	104
#define CW_RESIZE	105
#define CW_CENTER	106
#define CW_MAX		107
#define CW_VMAX		108
#define CW_HMAX		109
#define CW_HIDE		110
#define CW_STICK_WINDOW	111
#define CW_STICK_DESK	112
#define CW_RAISE	113
#define CW_LOWER	114
#define CW_FOCUS	115
#define CW_SWITCH_TO	116

//********************************************************************

extern CmdQueue cq;

#endif // COMMANDS_H
