
#include "BIEventLoop.h"

namespace BAL
{

class BCEventLoopDirectFB : public BAL::BIEventLoop
{
public:
	BCEventLoopDirectFB();
	virtual ~BCEventLoopDirectFB();

	virtual bool isInitialized() const;
	virtual void quit();
	virtual bool WaitEvent(BAL::BIEvent*&);
	virtual bool PushEvent(BAL::BIEvent*);

protected:
#ifdef OWB_CONSOLE_INPUT
	// key not const because replacement may occur
	BAL::BIEvent* CreateEventFromStdin(int key);
	struct timeval  m_timeout;
	fd_set          m_fdSet;
#endif
	BAL::BIEvent* CreateEventFromDirectFBEvent(const DFBEvent&);

private:
	bool m_isInitialized;
	Vector<BAL::BIEvent *> m_event;
	IDirectFBEventBuffer *m_eventBuffer;
};

}

