Initial implementation of NSCursor.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2180 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Scott Christley 1997-02-12 22:21:43 +00:00
parent 4fc633ec79
commit 0aa42f2776
12 changed files with 410 additions and 72 deletions

View file

@ -263,7 +263,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
e = [self nextEventMatchingMask:NSAnyEventMask untilDate:nil
inMode:nil dequeue:YES];
if (e)
[self postEvent:e atStart:YES];
[self sendEvent: e];
else
{
// Null event
@ -440,7 +440,7 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
if (![event_queue isEmpty])
{
j = [event_queue count];
for (i = j-1;i > 0; --i)
for (i = j-1;i >= 0; --i)
{
e = [event_queue objectAtIndex: i];
if ([self event: e matchMask: mask])
@ -469,13 +469,32 @@ NSString *NSApplicationWillUpdateNotification = @"ApplicationWillUpdate";
}
}
// Unhide the cursor if necessary
{
NSEventType type;
// Only if we should unhide when mouse moves
if ([NSCursor isHiddenUntilMouseMoves])
{
// Make sure the event is a mouse event before unhiding
type = [e type];
if ((type == NSLeftMouseDown) || (type == NSLeftMouseUp)
|| (type == NSRightMouseDown) || (type == NSRightMouseUp)
|| (type == NSMouseMoved))
[NSCursor unhide];
}
}
[self setCurrentEvent: e];
return e;
}
- (void)postEvent:(NSEvent *)event atStart:(BOOL)flag
{
[self sendEvent:event];
if (flag)
[event_queue appendObject: event];
else
[event_queue enqueueObject: event];
}
//