Small bug corrections.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18337 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2004-01-08 12:03:33 +00:00
parent a9e055f495
commit d053e9a8ae
3 changed files with 20 additions and 211 deletions

View file

@ -1,3 +1,13 @@
2004-01-08 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSActionCell.m (-initWithCoder:) Don't decode the control
view, as this may be a Gorm placeholder or otherwise invalid.
* Source/GSDisplayServer.m:
(-discardEventsMatchingMask:beforeEvent:),
(getEventMatchingMask:beforeDate:inMode:dequeue:) Use function
NSEventMaskFromType instead of explicit switch statement where a
few entries where missing.
2004-01-08 01:24 Alexander Malmberg <alexander@malmberg.org>
* Source/NSActionCell.m (-setObjectValue:): Change the argument type
@ -24,7 +34,7 @@
Source/NSBitmapImageRep+PNM.m, Source/NSBitmapImageRep+PNM.h:
New files with image loaders for JPEG, PNG, and PNM.
2003-01-07 Fred Kiefer <FredKiefer@gmx.de>
2004-01-07 Fred Kiefer <FredKiefer@gmx.de>
* Headers/Additions/GNUstepGUI/GSHbox.h:
* Headers/Additions/GNUstepGUI/GSVbox.h:

View file

@ -787,114 +787,7 @@ GSCurrentServer(void)
[event_queue getObjects: events range: r];
for (i = 0; i < end; i++)
{
BOOL matched = NO;
switch ([events[i] type])
{
case NSLeftMouseDown:
if (mask & NSLeftMouseDownMask)
matched = YES;
break;
case NSLeftMouseUp:
if (mask & NSLeftMouseUpMask)
matched = YES;
break;
case NSOtherMouseDown:
if (mask & NSOtherMouseDownMask)
matched = YES;
break;
case NSOtherMouseUp:
if (mask & NSOtherMouseUpMask)
matched = YES;
break;
case NSRightMouseDown:
if (mask & NSRightMouseDownMask)
matched = YES;
break;
case NSRightMouseUp:
if (mask & NSRightMouseUpMask)
matched = YES;
break;
case NSMouseMoved:
if (mask & NSMouseMovedMask)
matched = YES;
break;
case NSMouseEntered:
if (mask & NSMouseEnteredMask)
matched = YES;
break;
case NSMouseExited:
if (mask & NSMouseExitedMask)
matched = YES;
break;
case NSLeftMouseDragged:
if (mask & NSLeftMouseDraggedMask)
matched = YES;
break;
case NSOtherMouseDragged:
if (mask & NSOtherMouseDraggedMask)
matched = YES;
break;
case NSRightMouseDragged:
if (mask & NSRightMouseDraggedMask)
matched = YES;
break;
case NSKeyDown:
if (mask & NSKeyDownMask)
matched = YES;
break;
case NSKeyUp:
if (mask & NSKeyUpMask)
matched = YES;
break;
case NSFlagsChanged:
if (mask & NSFlagsChangedMask)
matched = YES;
break;
case NSAppKitDefined:
if (mask & NSAppKitDefinedMask)
matched = YES;
break;
case NSSystemDefined:
if (mask & NSSystemDefinedMask)
matched = YES;
break;
case NSApplicationDefined:
if (mask & NSApplicationDefinedMask)
matched = YES;
break;
case NSPeriodic:
if (mask & NSPeriodicMask)
matched = YES;
break;
case NSCursorUpdate:
if (mask & NSCursorUpdateMask)
matched = YES;
break;
default:
break;
}
if (matched)
if (mask & NSEventMaskFromType([events[i] type]))
{
event = events[i];
break;
@ -957,106 +850,8 @@ GSCurrentServer(void)
if ([event timestamp] < when)
{
BOOL shouldRemove = NO;
if (mask == NSAnyEventMask)
{
shouldRemove = YES;
}
else
{
switch ([event type])
{
case NSLeftMouseDown:
if (mask & NSLeftMouseDownMask)
shouldRemove = YES;
break;
case NSLeftMouseUp:
if (mask & NSLeftMouseUpMask)
shouldRemove = YES;
break;
case NSOtherMouseDown:
if (mask & NSOtherMouseDownMask)
shouldRemove = YES;
break;
case NSOtherMouseUp:
if (mask & NSOtherMouseUpMask)
shouldRemove = YES;
break;
case NSRightMouseDown:
if (mask & NSRightMouseDownMask)
shouldRemove = YES;
break;
case NSRightMouseUp:
if (mask & NSRightMouseUpMask)
shouldRemove = YES;
break;
case NSMouseMoved:
if (mask & NSMouseMovedMask)
shouldRemove = YES;
break;
case NSMouseEntered:
if (mask & NSMouseEnteredMask)
shouldRemove = YES;
break;
case NSMouseExited:
if (mask & NSMouseExitedMask)
shouldRemove = YES;
break;
case NSLeftMouseDragged:
if (mask & NSLeftMouseDraggedMask)
shouldRemove = YES;
break;
case NSOtherMouseDragged:
if (mask & NSOtherMouseDraggedMask)
shouldRemove = YES;
break;
case NSRightMouseDragged:
if (mask & NSRightMouseDraggedMask)
shouldRemove = YES;
break;
case NSKeyDown:
if (mask & NSKeyDownMask)
shouldRemove = YES;
break;
case NSKeyUp:
if (mask & NSKeyUpMask)
shouldRemove = YES;
break;
case NSFlagsChanged:
if (mask & NSFlagsChangedMask)
shouldRemove = YES;
break;
case NSPeriodic:
if (mask & NSPeriodicMask)
shouldRemove = YES;
break;
case NSCursorUpdate:
if (mask & NSCursorUpdateMask)
shouldRemove = YES;
break;
default:
break;
}
}
if (shouldRemove)
if ((mask == NSAnyEventMask) ||
(mask & NSEventMaskFromType([event type])))
[event_queue removeObjectAtIndex: index];
}
}

View file

@ -319,16 +319,20 @@ static Class controlClass;
[aCoder encodeValueOfObjCType: @encode(int) at: &_tag];
[aCoder encodeConditionalObject: _target];
[aCoder encodeValueOfObjCType: @encode(SEL) at: &_action];
// This is only encoded for backward compatibility and wont be decoded.
[aCoder encodeConditionalObject: _control_view];
}
- (id) initWithCoder: (NSCoder*)aDecoder
{
[super initWithCoder: aDecoder];
id dummy;
self = [super initWithCoder: aDecoder];
[aDecoder decodeValueOfObjCType: @encode(int) at: &_tag];
_target = [aDecoder decodeObject];
[aDecoder decodeValueOfObjCType: @encode(SEL) at: &_action];
_control_view = [aDecoder decodeObject];
// Don't decode _control_view, as this may no longe be valid.
dummy = [aDecoder decodeObject];
return self;
}