-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNSWindow+DragAndDropDelegation.m
58 lines (44 loc) · 1.84 KB
/
NSWindow+DragAndDropDelegation.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// NSWindow+DragAndDropDelegation.m
// This file is part of the "SWApplicationSupport" project, and is distributed under the MIT License.
//
// Created by Samuel Williams on 3/04/08.
// Copyright 2008 Samuel Williams. All rights reserved.
//
#import "NSWindow+DragAndDropDelegation.h"
@implementation NSWindow (DragAndDropDelegation)
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender {
//NSLog (@"%s", __PRETTY_FUNCTION__);
if ([[self delegate] respondsToSelector:@selector(window:draggingEntered:)])
return [[self delegate] window:self draggingEntered:sender];
return 0;
}
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender {
//NSLog (@"%s", __PRETTY_FUNCTION__);
if ([[self delegate] respondsToSelector:@selector(window:draggingUpdated:)])
return [[self delegate] window:self draggingUpdated:sender];
return 0;
}
- (void)draggingExited:(id <NSDraggingInfo>)sender {
//NSLog (@"%s", __PRETTY_FUNCTION__);
if ([[self delegate] respondsToSelector:@selector(window:draggingExited:)])
[[self delegate] window:self draggingExited:sender];
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
//NSLog (@"%s", __PRETTY_FUNCTION__);
if ([[self delegate] respondsToSelector:@selector(window:performDragOperation:)])
return [[self delegate] window:self performDragOperation:sender];
return NO;
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender {
//NSLog (@"%s", __PRETTY_FUNCTION__);
if ([[self delegate] respondsToSelector:@selector(window:prepareForDragOperation:)])
return [[self delegate] window:self prepareForDragOperation:sender];
return NO;
}
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender {
//NSLog (@"%s", __PRETTY_FUNCTION__);
if ([[self delegate] respondsToSelector:@selector(window:concludeDragOperation:)])
[[self delegate] window:self concludeDragOperation:sender];
}
@end