#ifndef TERMINAL_TILE_H
#define TERMINAL_TILE_H

#include "pikbdlistener.h"
#include "piscreentile.h"


class TileTerminal: public PIScreenTile {
	PIOBJECT_SUBCLASS(TileTerminal, PIScreenTile)

public:
	TileTerminal(const PIString & n);

	void setContent(const PIVector<PIVector<PIScreenTypes::Cell>> & c) { cells = c; }

	EVENT(resizeRequest)
	EVENT1(keyPressed, PIKbdListener::KeyEvent, k)
	EVENT(closeRequest)

private:
	void drawEvent(PIScreenDrawer * d) override;
	bool keyEvent(PIKbdListener::KeyEvent key) override;
	void resizeEvent(int w, int h) override;

	PIVector<PIVector<PIScreenTypes::Cell>> cells;
	char lastp[3];
};


#endif // TERMINAL_TILE_H
