Correct the definition of NSDragOperation and all its usages.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31754 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2010-12-22 16:16:14 +00:00
parent b3c6e86043
commit 0efb94944b
11 changed files with 49 additions and 34 deletions

View file

@ -1,3 +1,17 @@
2010-12-22 Fred Kiefer <FredKiefer@gmx.de>
* 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 <doug.simons@testplant.com> 2010-12-17 Doug Simons <doug.simons@testplant.com>
* Source/NSSearchFieldCell.m: * Source/NSSearchFieldCell.m:

View file

@ -68,20 +68,20 @@
// Screen coordinates of mouse pointer, only valid when destWindow != nil // Screen coordinates of mouse pointer, only valid when destWindow != nil
NSPoint dragPoint; NSPoint dragPoint;
int dragSequence; NSInteger dragSequence;
// the source of the dragging operation // the source of the dragging operation
id dragSource; id dragSource;
// Operations supported by the source // Operations supported by the source
unsigned int dragMask; NSDragOperation dragMask;
/* User specified operation mask (key modifiers). /* User specified operation mask (key modifiers).
* This is either a mask of type _NSDragOperation, * This is either a mask of type _NSDragOperation,
* or NSDragOperationIgnoresModifiers, which * or NSDragOperationIgnoresModifiers, which
* is defined as 0xffff * is defined as 0xffff
*/ */
unsigned int operationMask; NSDragOperation operationMask;
// slide the image back when drag fails? // slide the image back when drag fails?
BOOL slideBack; BOOL slideBack;
@ -102,7 +102,7 @@
int targetWindowRef; int targetWindowRef;
// Operations supported by the target, only valid if targetWindowRef isn't 0 // 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 // YES if target and source are in a different application
BOOL destExternal; BOOL destExternal;

View file

@ -38,17 +38,19 @@
@class NSImage; @class NSImage;
@class NSURL; @class NSURL;
typedef enum _NSDragOperation { enum _NSDragOperation {
NSDragOperationNone = 0, NSDragOperationNone = 0,
NSDragOperationCopy = 1, NSDragOperationCopy = 1,
NSDragOperationLink = 2, NSDragOperationLink = 2,
NSDragOperationGeneric = 4, NSDragOperationGeneric = 4,
NSDragOperationPrivate = 8, NSDragOperationPrivate = 8,
NSDragOperationAll = 15,
NSDragOperationMove = 16, NSDragOperationMove = 16,
NSDragOperationDelete = 32, NSDragOperationDelete = 32,
NSDragOperationAll = 63, NSDragOperationEvery = UINT_MAX
NSDragOperationEvery = 0xffff };
} NSDragOperation;
typedef unsigned int NSDragOperation;
@protocol NSDraggingInfo @protocol NSDraggingInfo
@ -58,9 +60,9 @@ typedef enum _NSDragOperation {
- (NSWindow *)draggingDestinationWindow; - (NSWindow *)draggingDestinationWindow;
- (NSPoint)draggingLocation; - (NSPoint)draggingLocation;
- (NSPasteboard *)draggingPasteboard; - (NSPasteboard *)draggingPasteboard;
- (int)draggingSequenceNumber; - (NSInteger)draggingSequenceNumber;
- (id)draggingSource; - (id)draggingSource;
- (unsigned int)draggingSourceOperationMask; - (NSDragOperation)draggingSourceOperationMask;
// //
// Image Information // Image Information
@ -107,7 +109,7 @@ typedef enum _NSDragOperation {
// //
// Querying the Source // Querying the Source
// //
- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal; - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal;
- (BOOL)ignoreModifierKeysWhileDragging; - (BOOL)ignoreModifierKeysWhileDragging;
// //

View file

@ -137,8 +137,8 @@ typedef enum _NSTableViewColumnAutoresizingStyle
tile at the end */ tile at the end */
BOOL _tilingDisabled; BOOL _tilingDisabled;
unsigned int _draggingSourceOperationMaskForLocal; NSDragOperation _draggingSourceOperationMaskForLocal;
unsigned int _draggingSourceOperationMaskForRemote; NSDragOperation _draggingSourceOperationMaskForRemote;
} }
/* Data Source */ /* Data Source */
@ -314,7 +314,7 @@ typedef enum _NSTableViewColumnAutoresizingStyle
tableColumns: (NSArray*)cols tableColumns: (NSArray*)cols
event: (NSEvent*)event event: (NSEvent*)event
offset: (NSPoint*)offset; offset: (NSPoint*)offset;
- (void) setDraggingSourceOperationMask: (unsigned int)mask - (void) setDraggingSourceOperationMask: (NSDragOperation)mask
forLocal: (BOOL)isLocal; forLocal: (BOOL)isLocal;
#endif #endif

View file

@ -180,7 +180,7 @@ static GSDragView *sharedDragView = nil;
return dragPasteboard; return dragPasteboard;
} }
- (int) draggingSequenceNumber - (NSInteger) draggingSequenceNumber
{ {
return dragSequence; return dragSequence;
} }
@ -190,7 +190,7 @@ static GSDragView *sharedDragView = nil;
return dragSource; return dragSource;
} }
- (unsigned int) draggingSourceOperationMask - (NSDragOperation) draggingSourceOperationMask
{ {
// Mix in possible modifiers // Mix in possible modifiers
return dragMask & operationMask; return dragMask & operationMask;
@ -250,7 +250,7 @@ static GSDragView *sharedDragView = nil;
// Unset the target window // Unset the target window
targetWindowRef = 0; targetWindowRef = 0;
targetMask = NSDragOperationAll; targetMask = NSDragOperationEvery;
destExternal = NO; destExternal = NO;
NSDebugLLog(@"NSDragging", @"Start drag with %@", [pboard types]); NSDebugLLog(@"NSDragging", @"Start drag with %@", [pboard types]);
@ -423,7 +423,7 @@ static GSDragView *sharedDragView = nil;
- (BOOL) _updateOperationMask: (NSEvent*) theEvent - (BOOL) _updateOperationMask: (NSEvent*) theEvent
{ {
unsigned int mod = [theEvent modifierFlags]; unsigned int mod = [theEvent modifierFlags];
unsigned int oldOperationMask = operationMask; NSDragOperation oldOperationMask = operationMask;
if (operationMask == NSDragOperationIgnoresModifiers) if (operationMask == NSDragOperationIgnoresModifiers)
{ {
@ -444,7 +444,7 @@ static GSDragView *sharedDragView = nil;
} }
else else
{ {
operationMask = NSDragOperationAll; operationMask = NSDragOperationEvery;
} }
return (operationMask != oldOperationMask); return (operationMask != oldOperationMask);
@ -477,7 +477,7 @@ static GSDragView *sharedDragView = nil;
NSCursor *newCursor; NSCursor *newCursor;
NSString *name; NSString *name;
NSString *iname; NSString *iname;
int mask; NSDragOperation mask;
mask = dragMask & operationMask; mask = dragMask & operationMask;
@ -775,7 +775,7 @@ static GSDragView *sharedDragView = nil;
NSDebugLLog(@"NSDragging", @"got GSAppKitDraggingStatus\n"); NSDebugLLog(@"NSDragging", @"got GSAppKitDraggingStatus\n");
if ((int)[theEvent data1] == targetWindowRef) if ((int)[theEvent data1] == targetWindowRef)
{ {
unsigned int newTargetMask = [theEvent data2]; NSDragOperation newTargetMask = (NSDragOperation)[theEvent data2];
if (newTargetMask != targetMask) if (newTargetMask != targetMask)
{ {
@ -919,7 +919,7 @@ static GSDragView *sharedDragView = nil;
// Reset drag mask when we switch from external to internal or back // Reset drag mask when we switch from external to internal or back
if (oldDestExternal != destExternal) if (oldDestExternal != destExternal)
{ {
unsigned int newMask; NSDragOperation newMask;
newMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal]; newMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal];
if (newMask != dragMask) if (newMask != dragMask)

View file

@ -165,7 +165,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
return NSDragOperationNone; return NSDragOperationNone;
} }
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)flag
{ {
return NSDragOperationCopy; return NSDragOperationCopy;
} }

View file

@ -342,7 +342,7 @@ static Class imageCellClass;
[super mouseDown: theEvent]; [super mouseDown: theEvent];
} }
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal
{ {
return NSDragOperationCopy; return NSDragOperationCopy;
} }

View file

@ -137,7 +137,7 @@ setPath(NSBrowser *browser, NSString *path)
return NSDragOperationNone; return NSDragOperationNone;
} }
return NSDragOperationAll; return NSDragOperationEvery;
} }
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender - (BOOL) performDragOperation: (id<NSDraggingInfo>)sender

View file

@ -77,7 +77,7 @@ static NSTableViewDropOperation oldDropOperation;
static NSTableViewDropOperation currentDropOperation; static NSTableViewDropOperation currentDropOperation;
static int currentDropRow; static int currentDropRow;
static int lastQuarterPosition; static int lastQuarterPosition;
static unsigned currentDragOperation; static NSDragOperation currentDragOperation;
/* /*
* Nib compatibility struct. This structure is used to * 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) if (isLocal)
{ {
@ -6107,7 +6107,7 @@ This method is deprecated, use -columnIndexesInRect:. */
} }
} }
- (void) setDraggingSourceOperationMask: (unsigned int)mask - (void) setDraggingSourceOperationMask: (NSDragOperation)mask
forLocal: (BOOL)isLocal forLocal: (BOOL)isLocal
{ {
if (isLocal) if (isLocal)
@ -6127,11 +6127,10 @@ This method is deprecated, use -columnIndexesInRect:. */
oldDropRow = -1; oldDropRow = -1;
lastQuarterPosition = -1; lastQuarterPosition = -1;
oldDraggingRect = NSMakeRect(0.,0., 0., 0.); oldDraggingRect = NSMakeRect(0.,0., 0., 0.);
currentDragOperation = NSDragOperationAll; currentDragOperation = NSDragOperationEvery;
return currentDragOperation; return currentDragOperation;
} }
- (void) draggingExited: (id <NSDraggingInfo>) sender - (void) draggingExited: (id <NSDraggingInfo>) sender
{ {
[self setNeedsDisplayInRect: oldDraggingRect]; [self setNeedsDisplayInRect: oldDraggingRect];
@ -6145,7 +6144,7 @@ This method is deprecated, use -columnIndexesInRect:. */
int row; int row;
int quarterPosition, positionInRow; int quarterPosition, positionInRow;
int currentRow; int currentRow;
unsigned dragOperation; NSDragOperation dragOperation;
p = [self convertPoint: p fromView: nil]; p = [self convertPoint: p fromView: nil];
/* This is a crude method of scrolling the view while dragging so /* This is a crude method of scrolling the view while dragging so

View file

@ -4922,7 +4922,7 @@ other than copy/paste or dragging. */
*/ */
// dragging of text, colors and files // dragging of text, colors and files
- (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal - (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
{ {
return (NSDragOperationGeneric | NSDragOperationCopy); return (NSDragOperationGeneric | NSDragOperationCopy);
} }

View file

@ -317,7 +317,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
//nothing to do //nothing to do
} }
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal
{ {
return isLocal ? NSDragOperationGeneric : NSDragOperationNone; return isLocal ? NSDragOperationGeneric : NSDragOperationNone;
} }
@ -808,7 +808,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
//nothing to do //nothing to do
} }
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal - (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal
{ {
return isLocal ? NSDragOperationGeneric : NSDragOperationNone; return isLocal ? NSDragOperationGeneric : NSDragOperationNone;
} }