
#import "EventObjects.h"

@implementation KeyEvent

- initFromEvent:(NXEvent *)e
{
	[super init];
	event = *e;
	return self;
}

- setEvent:(NXEvent *)e			{ event = *e; return self; }

- (int)type						{ return event.type; }
- location:(NXPoint *)p			{*p = event.location; return self; }
- (long)time					{ return event.time; }
- (int)flags					{ return event.flags; }
- (unsigned int)window			{ return event.window; }
- (DPSContext)dpsContext		{ return event.ctxt; }

- (short)reserved				{ return event.data.key.reserved; }
- (short)repeat					{ return event.data.key.repeat; }
- (unsigned short)charSet		{ return event.data.key.charSet; }
- (unsigned short)charCode		{ return event.data.key.charCode; }
- (unsigned short)keyCode		{ return event.data.key.keyCode; }
- (short)keyData				{ return event.data.key.keyData; }

@end

@implementation MouseEvent

- initFromEvent:(NXEvent *)e
{
	[super init];
	event = *e;
	return self;
}

- setEvent:(NXEvent *)e			{ event = *e; return self; }

- (int)type						{ return event.type; }
- location:(NXPoint *)p			{*p = event.location; return self; }
- (long)time					{ return event.time; }
- (int)flags					{ return event.flags; }
- (unsigned int)window			{ return event.window; }
- (DPSContext)dpsContext		{ return event.ctxt; }

- (short)reserved 				{ return event.data.mouse.reserved; }
- (short)eventNum 				{ return event.data.mouse.eventNum; }
- (int)click 					{ return event.data.mouse.click; }
- (unsigned char)pressure 		{ return event.data.mouse.pressure; }
- (char)reserved1 				{ return event.data.mouse.reserved1; }
- (short)reserved2 				{ return event.data.mouse.reserved2; }

@end

@implementation TrackingEvent

- initFromEvent:(NXEvent *)e
{
	[super init];
	event = *e;
	return self;
}

- setEvent:(NXEvent *)e			{ event = *e; return self; }

- (int)type						{ return event.type; }
- location:(NXPoint *)p			{*p = event.location; return self; }
- (long)time					{ return event.time; }
- (int)flags					{ return event.flags; }
- (unsigned int)window			{ return event.window; }
- (DPSContext)dpsContext		{ return event.ctxt; }

- (short)reserved 				{ return event.data.tracking.reserved; }
- (short)eventNum 				{ return event.data.tracking.eventNum; }
- (int)trackingNum 				{ return event.data.tracking.trackingNum; }
- (int)userData 				{ return event.data.tracking.userData; }

@end

