mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 12:00:52 +00:00
Added [copyWithZone:], [mouseLocation] and dummy implemntation of
[deltaX], [deltaY] and [deltaZ]. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10633 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4153511677
commit
c5d2a33f21
1 changed files with 57 additions and 0 deletions
|
@ -409,6 +409,14 @@ static Class eventClass;
|
|||
/*
|
||||
* Getting Mouse Event Information
|
||||
*/
|
||||
+ (NSPoint)mouseLocation
|
||||
{
|
||||
float x, y;
|
||||
|
||||
PSmouselocation(&x, &y);
|
||||
return NSMakePoint(x, y);
|
||||
}
|
||||
|
||||
- (int) clickCount
|
||||
{
|
||||
/* Make sure it is one of the right event types */
|
||||
|
@ -495,6 +503,36 @@ static Class eventClass;
|
|||
return event_data.misc.sub_type;;
|
||||
}
|
||||
|
||||
/*
|
||||
* Scroll event data
|
||||
*/
|
||||
- (float)deltaX
|
||||
{
|
||||
if (event_type != NSScrollWheel)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"deltaX requested for invalid event type"];
|
||||
// FIXME
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
- (float)deltaY
|
||||
{
|
||||
if (event_type != NSScrollWheel)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"deltaY requested for invalid event type"];
|
||||
// FIXME
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
- (float)deltaZ
|
||||
{
|
||||
if (event_type != NSScrollWheel)
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"deltaZ requested for invalid event type"];
|
||||
// FIXME
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
/*
|
||||
* NSCoding protocol
|
||||
*/
|
||||
|
@ -605,6 +643,25 @@ static Class eventClass;
|
|||
return self;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copying protocol
|
||||
*/
|
||||
|
||||
- (id) copyWithZone: (NSZone*)zone
|
||||
{
|
||||
NSEvent *e = (NSEvent*)NSCopyObject (self, 0, zone);
|
||||
|
||||
if ((event_type == NSKeyUp) || (event_type == NSKeyDown))
|
||||
{
|
||||
event_data.key.char_keys = [event_data.key.char_keys copyWithZone: zone];
|
||||
event_data.key.unmodified_keys = [event_data.key.unmodified_keys copyWithZone: zone];
|
||||
}
|
||||
else if (event_type == NSCursorUpdate)
|
||||
event_data.tracking.user_data = [event_data.tracking.user_data copyWithZone: zone];
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
- (NSString*) description
|
||||
{
|
||||
const char* eventTypes[] = {
|
||||
|
|
Loading…
Reference in a new issue