mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 20:31:56 +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
8b04150a2a
commit
da2fb3ab34
1 changed files with 57 additions and 0 deletions
|
@ -409,6 +409,14 @@ static Class eventClass;
|
||||||
/*
|
/*
|
||||||
* Getting Mouse Event Information
|
* Getting Mouse Event Information
|
||||||
*/
|
*/
|
||||||
|
+ (NSPoint)mouseLocation
|
||||||
|
{
|
||||||
|
float x, y;
|
||||||
|
|
||||||
|
PSmouselocation(&x, &y);
|
||||||
|
return NSMakePoint(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
- (int) clickCount
|
- (int) clickCount
|
||||||
{
|
{
|
||||||
/* Make sure it is one of the right event types */
|
/* Make sure it is one of the right event types */
|
||||||
|
@ -495,6 +503,36 @@ static Class eventClass;
|
||||||
return event_data.misc.sub_type;;
|
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
|
* NSCoding protocol
|
||||||
*/
|
*/
|
||||||
|
@ -605,6 +643,25 @@ static Class eventClass;
|
||||||
return self;
|
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
|
- (NSString*) description
|
||||||
{
|
{
|
||||||
const char* eventTypes[] = {
|
const char* eventTypes[] = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue