Revision: 5058
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5058&view=rev
Author:   hofman
Date:     2008-12-14 13:17:36 +0000 (Sun, 14 Dec 2008)

Log Message:
-----------
use default implementation for dragging destination protocol of image view in 
note window

Modified Paths:
--------------
    trunk/BDSKDragImageView.h
    trunk/BDSKDragImageView.m
    trunk/SKNoteWindowController.m

Modified: trunk/BDSKDragImageView.h
===================================================================
--- trunk/BDSKDragImageView.h   2008-12-13 22:50:08 UTC (rev 5057)
+++ trunk/BDSKDragImageView.h   2008-12-14 13:17:36 UTC (rev 5058)
@@ -41,7 +41,6 @@
 
 @interface BDSKDragImageView : NSImageView {
        id delegate;
-       BOOL highlight;
 } 
 
 - (id)delegate;
@@ -52,8 +51,6 @@
 @end
 
 @interface NSObject (BDSKDragImageViewDelegate)
-- (NSDragOperation)dragImageView:(BDSKDragImageView *)view validateDrop:(id 
<NSDraggingInfo>)sender;
-- (BOOL)dragImageView:(BDSKDragImageView *)view acceptDrop:(id 
<NSDraggingInfo>)sender;
 - (BOOL)dragImageView:(BDSKDragImageView *)view 
writeDataToPasteboard:(NSPasteboard *)pasteboard;
 - (NSArray *)dragImageView:(BDSKDragImageView *)view 
namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination;
 - (NSImage *)dragImageForDragImageView:(BDSKDragImageView *)view;

Modified: trunk/BDSKDragImageView.m
===================================================================
--- trunk/BDSKDragImageView.m   2008-12-13 22:50:08 UTC (rev 5057)
+++ trunk/BDSKDragImageView.m   2008-12-14 13:17:36 UTC (rev 5058)
@@ -37,26 +37,9 @@
  */
 
 #import "BDSKDragImageView.h"
-#import "NSBezierPath_BDSKExtensions.h"
 
 @implementation BDSKDragImageView
 
-- (id)initWithFrame:(NSRect)frameRect {
-       if (self = [super initWithFrame:frameRect]) {
-               delegate = nil;
-               highlight = NO;
-       }
-       return self;
-}
-
-- (id)initWithCoder:(NSCoder *)decoder {
-       if (self = [super initWithCoder:decoder]) {
-               delegate = nil;
-               highlight = NO;
-       }
-       return self;
-}
-
 - (id)delegate {
     return delegate;
 }
@@ -111,36 +94,6 @@
     return [menu numberOfItems] ? menu : nil;
 }
 
-- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender{
-    NSDragOperation dragOp = NSDragOperationNone;
-       if ([self isEditable] && [delegate 
respondsToSelector:@selector(dragImageView:validateDrop:)])
-               dragOp = [delegate dragImageView:self validateDrop:sender];
-       if (dragOp != NSDragOperationNone) {
-               highlight = YES;
-        [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]];
-               [self setNeedsDisplay:YES];
-       }
-       return dragOp;
-}
-
-- (void)draggingExited:(id <NSDraggingInfo>)sender{
-    highlight = NO;
-    [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]];
-       [self setNeedsDisplay:YES];
-}
-
-- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
-    highlight = NO;
-    [self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]];
-       [self setNeedsDisplay:YES];
-       if ([delegate respondsToSelector:@selector(dragImageView:acceptDrop:)])
-               return [delegate dragImageView:self acceptDrop:sender];
-       return NO;
-}
-
-- (void)concludeDragOperation:(id <NSDraggingInfo>)sender {
-}
-
 - (void)mouseDown:(NSEvent *)theEvent {
     if ([self isEditable] == NO) {
         return;
@@ -215,14 +168,4 @@
     return isLocal || [self isEditable] == NO ? NSDragOperationNone : 
NSDragOperationCopy; 
 }
 
-- (void)drawRect:(NSRect)aRect {
-       [super drawRect:aRect];
-       
-       if (highlight == NO) return;
-       
-       [[NSColor alternateSelectedControlColor] set];
-       [NSBezierPath setDefaultLineWidth:2.0];
-       [NSBezierPath strokeRoundRectInRect:NSInsetRect(aRect, 2.0, 2.0) 
radius:5.0];
-}
-
 @end

Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m      2008-12-13 22:50:08 UTC (rev 5057)
+++ trunk/SKNoteWindowController.m      2008-12-14 13:17:36 UTC (rev 5058)
@@ -279,27 +279,6 @@
 
 #pragma mark BDSKDragImageView delegate protocol
 
-- (NSDragOperation)dragImageView:(BDSKDragImageView *)view validateDrop:(id 
<NSDraggingInfo>)sender;
-{
-    if ([[sender draggingSource] isEqual:view] == NO &&
-        [NSImage canInitWithPasteboard:[sender draggingPasteboard]] &&
-        [self isNoteType])
-        return NSDragOperationCopy;
-    else
-        return NSDragOperationNone;
-}
-
-- (BOOL)dragImageView:(BDSKDragImageView *)view acceptDrop:(id 
<NSDraggingInfo>)sender;
-{
-    NSImage *image = [[NSImage alloc] initWithPasteboard:[sender 
draggingPasteboard]];
-    
-    if (image) {
-        [(SKNPDFAnnotationNote *)note setImage:image];
-        [image release];
-        return YES;
-    } else return NO;
-}
-
 - (BOOL)dragImageView:(BDSKDragImageView *)view 
writeDataToPasteboard:(NSPasteboard *)pasteboard {
     NSImage *image = [self isNoteType] ? [(SKNPDFAnnotationNote *)note image] 
: nil;
     if (image) {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to