mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 03:11:18 +00:00
Check whether the drag source supports methods before calling them.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31787 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
05820e79ac
commit
caeca26669
2 changed files with 45 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2010-12-27 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/GSDragView.m: Check whether the drag source supports
|
||||
methods before calling them.
|
||||
|
||||
2010-12-27 Nicola Pero <nicola.pero@meta-innovation.com>
|
||||
|
||||
* Source/NSGraphicsContext.m ([-subclassResponsibility:]): Use
|
||||
|
|
|
@ -217,9 +217,18 @@ static GSDragView *sharedDragView = nil;
|
|||
return loc;
|
||||
}
|
||||
|
||||
- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
|
||||
- (NSArray *) namesOfPromisedFilesDroppedAtDestination: (NSURL *)dropDestination
|
||||
{
|
||||
return [[self draggingSource] namesOfPromisedFilesDroppedAtDestination: dropDestination];
|
||||
if ([dragSource respondsToSelector:
|
||||
@selector(namesOfPromisedFilesDroppedAtDestination:)])
|
||||
{
|
||||
return [dragSource namesOfPromisedFilesDroppedAtDestination:
|
||||
dropDestination];
|
||||
}
|
||||
else
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) isDragging
|
||||
|
@ -646,7 +655,17 @@ static GSDragView *sharedDragView = nil;
|
|||
[self _updateOperationMask: theEvent];
|
||||
}
|
||||
|
||||
dragMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal];
|
||||
|
||||
if ([dragSource respondsToSelector:
|
||||
@selector(draggingSourceOperationMaskForLocal:)])
|
||||
{
|
||||
dragMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal];
|
||||
}
|
||||
else
|
||||
{
|
||||
dragMask = NSDragOperationCopy | NSDragOperationLink |
|
||||
NSDragOperationGeneric | NSDragOperationPrivate;
|
||||
}
|
||||
|
||||
// --- Setup the event loop ------------------------------------------
|
||||
[self _updateAndMoveImageToCorrectPosition];
|
||||
|
@ -874,7 +893,13 @@ static GSDragView *sharedDragView = nil;
|
|||
|
||||
//--- Move drag image to the new position -----------------------------------
|
||||
[self _moveDraggedImageToNewPosition];
|
||||
|
||||
|
||||
if ([dragSource respondsToSelector:
|
||||
@selector(draggedImage:movedTo:)])
|
||||
{
|
||||
[dragSource draggedImage: [self draggedImage] movedTo: dragPosition];
|
||||
}
|
||||
|
||||
//--- Determine target window ---------------------------------------------
|
||||
destWindow = [self windowAcceptingDnDunder: dragPosition
|
||||
windowRef: &mouseWindowRef];
|
||||
|
@ -921,7 +946,17 @@ static GSDragView *sharedDragView = nil;
|
|||
{
|
||||
NSDragOperation newMask;
|
||||
|
||||
newMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal];
|
||||
if ([dragSource respondsToSelector:
|
||||
@selector(draggingSourceOperationMaskForLocal:)])
|
||||
{
|
||||
newMask = [dragSource draggingSourceOperationMaskForLocal: !destExternal];
|
||||
}
|
||||
else
|
||||
{
|
||||
newMask = NSDragOperationCopy | NSDragOperationLink |
|
||||
NSDragOperationGeneric | NSDragOperationPrivate;
|
||||
}
|
||||
|
||||
if (newMask != dragMask)
|
||||
{
|
||||
dragMask = newMask;
|
||||
|
|
Loading…
Reference in a new issue