#include "eexpose.h"

using namespace event;

const char* EExpose::eventType="Expose";
const EField* EExpose::eventFields[]=
{
	&EField::SERIAL,
	&EField::ID,
	&EField::TIME,
	&EField::ROOT_WINDOW,
	&EField::SUB_WINDOW,
	&EField::TYPE,
	&EField::WIDGET_PATHNAME,
	&EField::SENDEVENT,

	&EField::COUNT,
	&EField::HEIGHT,
	&EField::WIDTH,

	&EField::END
};

int EExpose::preprocessEvent(EHeader& header,Tcl_Interp* interp,int objc,Tcl_Obj* CONST objv[])
{
	int count;
	int height;
	int width;

	int index=10;

	Tcl_GetIntFromObj(interp,objv[index++],&count);
	Tcl_GetIntFromObj(interp,objv[index++],&height);
	Tcl_GetIntFromObj(interp,objv[index++],&width);

	for(t_listeners::iterator it=listeners.begin();it!=listeners.end();it++)
	{
		(*it)->onExpose(header,count,height,width);
	}

	return TCL_OK;
}
