mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
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:
parent
3a9b7dbab3
commit
de9abfb7ee
11 changed files with 49 additions and 34 deletions
14
ChangeLog
14
ChangeLog
|
@ -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>
|
||||
|
||||
* Source/NSSearchFieldCell.m:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
//
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -165,7 +165,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
|||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag
|
||||
- (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)flag
|
||||
{
|
||||
return NSDragOperationCopy;
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ static Class imageCellClass;
|
|||
[super mouseDown: theEvent];
|
||||
}
|
||||
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)isLocal
|
||||
- (NSDragOperation) draggingSourceOperationMaskForLocal: (BOOL)isLocal
|
||||
{
|
||||
return NSDragOperationCopy;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ setPath(NSBrowser *browser, NSString *path)
|
|||
return NSDragOperationNone;
|
||||
}
|
||||
|
||||
return NSDragOperationAll;
|
||||
return NSDragOperationEvery;
|
||||
}
|
||||
|
||||
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
||||
|
|
|
@ -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 <NSDraggingInfo>) 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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue