diff --git a/ChangeLog b/ChangeLog index cab3b027f..6df313d20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2010-12-22 Fred Kiefer + + * Headers/AppKit/NSDragging.h, + * Headers/AppKit/NSTableView.h, + * Headers/Additions/GNUstepGUI/GSDragView.h, + * Source/NSImageView.m, + * Source/NSColorWell.m, + * Source/NSSavePanel.m, + * Source/NSTextView.m, + * Source/NSToolbarItem.m, + * Source/NSTableView.m, + * Source/GSDragView.m: Correct the definition of NSDragOperation + and all its usages. + 2010-12-17 Doug Simons * Source/NSSearchFieldCell.m: diff --git a/Headers/Additions/GNUstepGUI/GSDragView.h b/Headers/Additions/GNUstepGUI/GSDragView.h index cfe1d8ab0..e14663a82 100644 --- a/Headers/Additions/GNUstepGUI/GSDragView.h +++ b/Headers/Additions/GNUstepGUI/GSDragView.h @@ -68,20 +68,20 @@ // Screen coordinates of mouse pointer, only valid when destWindow != nil NSPoint dragPoint; - int dragSequence; + NSInteger dragSequence; // the source of the dragging operation id dragSource; // Operations supported by the source - unsigned int dragMask; + NSDragOperation dragMask; /* User specified operation mask (key modifiers). * This is either a mask of type _NSDragOperation, * or NSDragOperationIgnoresModifiers, which * is defined as 0xffff */ - unsigned int operationMask; + NSDragOperation operationMask; // slide the image back when drag fails? BOOL slideBack; @@ -102,7 +102,7 @@ int targetWindowRef; // Operations supported by the target, only valid if targetWindowRef isn't 0 - unsigned int targetMask; + NSDragOperation targetMask; // YES if target and source are in a different application BOOL destExternal; diff --git a/Headers/AppKit/NSDragging.h b/Headers/AppKit/NSDragging.h index 0468fea9d..4e2faa1a9 100644 --- a/Headers/AppKit/NSDragging.h +++ b/Headers/AppKit/NSDragging.h @@ -38,17 +38,19 @@ @class NSImage; @class NSURL; -typedef enum _NSDragOperation { +enum _NSDragOperation { NSDragOperationNone = 0, NSDragOperationCopy = 1, NSDragOperationLink = 2, NSDragOperationGeneric = 4, NSDragOperationPrivate = 8, + NSDragOperationAll = 15, NSDragOperationMove = 16, NSDragOperationDelete = 32, - NSDragOperationAll = 63, - NSDragOperationEvery = 0xffff -} NSDragOperation; + NSDragOperationEvery = UINT_MAX +}; + +typedef unsigned int NSDragOperation; @protocol NSDraggingInfo @@ -58,9 +60,9 @@ typedef enum _NSDragOperation { - (NSWindow *)draggingDestinationWindow; - (NSPoint)draggingLocation; - (NSPasteboard *)draggingPasteboard; -- (int)draggingSequenceNumber; +- (NSInteger)draggingSequenceNumber; - (id)draggingSource; -- (unsigned int)draggingSourceOperationMask; +- (NSDragOperation)draggingSourceOperationMask; // // Image Information @@ -107,7 +109,7 @@ typedef enum _NSDragOperation { // // Querying the Source // -- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal; +- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal; - (BOOL)ignoreModifierKeysWhileDragging; // diff --git a/Headers/AppKit/NSTableView.h b/Headers/AppKit/NSTableView.h index 67bec9018..312dd2599 100644 --- a/Headers/AppKit/NSTableView.h +++ b/Headers/AppKit/NSTableView.h @@ -137,8 +137,8 @@ typedef enum _NSTableViewColumnAutoresizingStyle tile at the end */ BOOL _tilingDisabled; - unsigned int _draggingSourceOperationMaskForLocal; - unsigned int _draggingSourceOperationMaskForRemote; + NSDragOperation _draggingSourceOperationMaskForLocal; + NSDragOperation _draggingSourceOperationMaskForRemote; } /* Data Source */ @@ -314,7 +314,7 @@ typedef enum _NSTableViewColumnAutoresizingStyle tableColumns: (NSArray*)cols event: (NSEvent*)event offset: (NSPoint*)offset; -- (void) setDraggingSourceOperationMask: (unsigned int)mask +- (void) setDraggingSourceOperationMask: (NSDragOperation)mask forLocal: (BOOL)isLocal; #endif diff --git a/Source/GSDragView.m b/Source/GSDragView.m index 5a2d6034b..097be76f7 100644 --- a/Source/GSDragView.m +++ b/Source/GSDragView.m @@ -180,7 +180,7 @@ static GSDragView *sharedDragView = nil; return dragPasteboard; } -- (int) draggingSequenceNumber +- (NSInteger) draggingSequenceNumber { return dragSequence; } @@ -190,7 +190,7 @@ static GSDragView *sharedDragView = nil; return dragSource; } -- (unsigned int) draggingSourceOperationMask +- (NSDragOperation) draggingSourceOperationMask { // Mix in possible modifiers return dragMask & operationMask; @@ -250,7 +250,7 @@ static GSDragView *sharedDragView = nil; // Unset the target window targetWindowRef = 0; - targetMask = NSDragOperationAll; + targetMask = NSDragOperationEvery; destExternal = NO; NSDebugLLog(@"NSDragging", @"Start drag with %@", [pboard types]); @@ -423,7 +423,7 @@ static GSDragView *sharedDragView = nil; - (BOOL) _updateOperationMask: (NSEvent*) theEvent { unsigned int mod = [theEvent modifierFlags]; - unsigned int oldOperationMask = operationMask; + NSDragOperation oldOperationMask = operationMask; if (operationMask == NSDragOperationIgnoresModifiers) { @@ -444,7 +444,7 @@ static GSDragView *sharedDragView = nil; } else { - operationMask = NSDragOperationAll; + operationMask = NSDragOperationEvery; } return (operationMask != oldOperationMask); @@ -477,7 +477,7 @@ static GSDragView *sharedDragView = nil; NSCursor *newCursor; NSString *name; NSString *iname; - int mask; + NSDragOperation mask; mask = dragMask & operationMask; @@ -775,7 +775,7 @@ static GSDragView *sharedDragView = nil; NSDebugLLog(@"NSDragging", @"got GSAppKitDraggingStatus\n"); if ((int)[theEvent data1] == targetWindowRef) { - unsigned int newTargetMask = [theEvent data2]; + NSDragOperation newTargetMask = (NSDragOperation)[theEvent data2]; if (newTargetMask != targetMask) { @@ -919,7 +919,7 @@ static GSDragView *sharedDragView = nil; // Reset drag mask when we switch from external to internal or back if (oldDestExternal != destExternal) { - unsigned int newMask; + NSDragOperation newMask; newMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal]; if (newMask != dragMask) diff --git a/Source/NSColorWell.m b/Source/NSColorWell.m index 7dfa336d4..6538e199f 100644 --- a/Source/NSColorWell.m +++ b/Source/NSColorWell.m @@ -165,7 +165,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification = return NSDragOperationNone; } -- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag +- (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)flag { return NSDragOperationCopy; } diff --git a/Source/NSImageView.m b/Source/NSImageView.m index 5eb702e43..839571cc3 100644 --- a/Source/NSImageView.m +++ b/Source/NSImageView.m @@ -342,7 +342,7 @@ static Class imageCellClass; [super mouseDown: theEvent]; } -- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal +- (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { return NSDragOperationCopy; } diff --git a/Source/NSSavePanel.m b/Source/NSSavePanel.m index 3a71ad451..77a844092 100644 --- a/Source/NSSavePanel.m +++ b/Source/NSSavePanel.m @@ -137,7 +137,7 @@ setPath(NSBrowser *browser, NSString *path) return NSDragOperationNone; } - return NSDragOperationAll; + return NSDragOperationEvery; } - (BOOL) performDragOperation: (id)sender diff --git a/Source/NSTableView.m b/Source/NSTableView.m index 0aa04fd5f..6a0dbcb91 100644 --- a/Source/NSTableView.m +++ b/Source/NSTableView.m @@ -77,7 +77,7 @@ static NSTableViewDropOperation oldDropOperation; static NSTableViewDropOperation currentDropOperation; static int currentDropRow; static int lastQuarterPosition; -static unsigned currentDragOperation; +static NSDragOperation currentDragOperation; /* * Nib compatibility struct. This structure is used to @@ -6095,7 +6095,7 @@ This method is deprecated, use -columnIndexesInRect:. */ } -- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal +- (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { if (isLocal) { @@ -6107,7 +6107,7 @@ This method is deprecated, use -columnIndexesInRect:. */ } } -- (void) setDraggingSourceOperationMask: (unsigned int)mask +- (void) setDraggingSourceOperationMask: (NSDragOperation)mask forLocal: (BOOL)isLocal { if (isLocal) @@ -6127,11 +6127,10 @@ This method is deprecated, use -columnIndexesInRect:. */ oldDropRow = -1; lastQuarterPosition = -1; oldDraggingRect = NSMakeRect(0.,0., 0., 0.); - currentDragOperation = NSDragOperationAll; + currentDragOperation = NSDragOperationEvery; return currentDragOperation; } - - (void) draggingExited: (id ) sender { [self setNeedsDisplayInRect: oldDraggingRect]; @@ -6145,7 +6144,7 @@ This method is deprecated, use -columnIndexesInRect:. */ int row; int quarterPosition, positionInRow; int currentRow; - unsigned dragOperation; + NSDragOperation dragOperation; p = [self convertPoint: p fromView: nil]; /* This is a crude method of scrolling the view while dragging so diff --git a/Source/NSTextView.m b/Source/NSTextView.m index a93c12b13..a4838cdc0 100644 --- a/Source/NSTextView.m +++ b/Source/NSTextView.m @@ -4922,7 +4922,7 @@ other than copy/paste or dragging. */ */ // dragging of text, colors and files -- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal +- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal { return (NSDragOperationGeneric | NSDragOperationCopy); } diff --git a/Source/NSToolbarItem.m b/Source/NSToolbarItem.m index 21a7cac02..f0e6123e4 100644 --- a/Source/NSToolbarItem.m +++ b/Source/NSToolbarItem.m @@ -317,7 +317,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType"; //nothing to do } -- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal +- (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { return isLocal ? NSDragOperationGeneric : NSDragOperationNone; } @@ -808,7 +808,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType"; //nothing to do } -- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal +- (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal { return isLocal ? NSDragOperationGeneric : NSDragOperationNone; }