From c55afb57ef6d6eb396d74616cc0c99de0927cd51 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 5 Jan 2011 21:54:31 -0500 Subject: [PATCH] Revert "Stub out the methods needed for drag and drop on the breakpoint table view." This reverts commit d0a336076f5e432b2fe52db4b5f4b10cc37b69cc. --- English.lproj/Breakpoints.xib | 723 +++------------------------------- Source/BreakpointController.h | 12 +- Source/BreakpointController.m | 75 ++-- 3 files changed, 84 insertions(+), 726 deletions(-) diff --git a/English.lproj/Breakpoints.xib b/English.lproj/Breakpoints.xib index 1574853..8da4be7 100644 --- a/English.lproj/Breakpoints.xib +++ b/English.lproj/Breakpoints.xib @@ -1,26 +1,27 @@ - + 1050 - 10H574 - 804 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 804 - + 9G55 + 677 + 949.43 + 353.00 YES - YES + com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin - PluginDependencyRecalculationVersion - + YES + + YES + + + YES + YES @@ -41,9 +42,9 @@ Breakpoints NSWindow - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} - + 256 YES @@ -96,16 +97,16 @@ YES - 425 - 40 - 1000 + 4.250000e+02 + 4.000000e+01 + 1.000000e+03 - 75628096 - 2048 + 75628032 + 0 File LucidaGrande - 11 + 1.100000e+01 3100 @@ -128,7 +129,7 @@ Text Cell LucidaGrande - 11 + 1.100000e+01 16 @@ -138,7 +139,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2NjY3AA + MC42NjY2NjY2OQA @@ -154,12 +155,12 @@ - 141 - 40 - 1000 + 1.410000e+02 + 4.000000e+01 + 1.000000e+03 - 75628096 - 2048 + 75628032 + 0 Line @@ -180,8 +181,8 @@ - 3 - 2 + 3.000000e+00 + 2.000000e+00 3 MQA @@ -195,20 +196,16 @@ MC41AA - 17 + 1.700000e+01 -566198272 - - 1 15 0 YES - 0 {{1, 17}, {572, 221}} - 4 @@ -220,7 +217,7 @@ _doScroller: - 0.93212669999999997 + 9.321267e-01 @@ -230,7 +227,7 @@ 1 _doScroller: - 0.9982548 + 9.982548e-01 @@ -241,7 +238,6 @@ {{1, 0}, {572, 17}} - 4 @@ -250,7 +246,6 @@ {{0, 19}, {574, 239}} - 562 @@ -271,7 +266,7 @@ LucidaGrande - 13 + 1.300000e+01 1044 @@ -322,10 +317,9 @@ {574, 484} - {{0, 0}, {1680, 1028}} - {1.79769e+308, 1.79769e+308} + {3.40282e+38, 3.40282e+38} BreakpointsWindow @@ -346,6 +340,10 @@ YES + + YES + BreakpointsWindowVisible + YES @@ -472,14 +470,6 @@ 49 - - - tableView - - - - 50 - @@ -496,7 +486,7 @@ -2 - File's Owner + RmlsZSdzIE93bmVyA -1 @@ -664,8 +654,10 @@ YES - + YES + -1.IBPluginDependency + -2.IBPluginDependency -3.IBPluginDependency 1.IBEditorWindowLastContentRect 1.IBPluginDependency @@ -691,12 +683,13 @@ 3.CustomClassName 3.IBPluginDependency 4.IBPluginDependency - 43.IBPluginDependency 5.IBPluginDependency YES com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilderKit + com.apple.InterfaceBuilderKit {{350, 212}, {574, 484}} com.apple.InterfaceBuilder.CocoaPlugin {{350, 212}, {574, 484}} @@ -722,12 +715,13 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin YES - + + YES + YES @@ -735,13 +729,15 @@ YES - + + YES + YES - 50 + 49 @@ -753,13 +749,6 @@ delegate id - - delegate - - delegate - id - - IBProjectSource Source/BSSourceView.h @@ -778,7 +767,7 @@ NSWindowController YES - + YES addBreakpoint: removeBreakpoint: @@ -789,62 +778,17 @@ id - - YES - - YES - addBreakpoint: - removeBreakpoint: - - - YES - - addBreakpoint: - id - - - removeBreakpoint: - id - - - YES - + YES arrayController sourceView - tableView YES NSArrayController BSSourceView - NSTableView - - - - YES - - YES - arrayController - sourceView - tableView - - - YES - - arrayController - NSArrayController - - - sourceView - BSSourceView - - - tableView - NSTableView - @@ -864,572 +808,17 @@ NSObject - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSArrayController - NSObjectController - - IBFrameworkSource - AppKit.framework/Headers/NSArrayController.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSController - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSController.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSManagedObjectContext - NSObject - - IBFrameworkSource - CoreData.framework/Headers/NSManagedObjectContext.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - NSObject - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUAppcast.h - - - - NSObject - - IBFrameworkSource - Sparkle.framework/Headers/SUUpdater.h - - - - NSObjectController - NSController - - IBFrameworkSource - AppKit.framework/Headers/NSObjectController.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSScrollView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSScrollView.h - - - - NSScroller - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSScroller.h - - - - NSSplitView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSSplitView.h - - - - NSTableColumn - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableColumn.h - - - - NSTableHeaderView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSTableHeaderView.h - - - - NSTableView - NSControl - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSUserDefaultsController - NSController - - IBFrameworkSource - AppKit.framework/Headers/NSUserDefaultsController.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - NSWindowController - NSResponder - - showWindow: - id - - - showWindow: - - showWindow: - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSWindowController.h + IBProjectSource + Source/SocketWrapper.h 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES ../MacGDBp.xcodeproj 3 - - YES - - YES - NSAddTemplate - NSRemoveTemplate - - - YES - {8, 8} - {8, 8} - - diff --git a/Source/BreakpointController.h b/Source/BreakpointController.h index 1d8d7e2..f4fed51 100644 --- a/Source/BreakpointController.h +++ b/Source/BreakpointController.h @@ -21,15 +21,13 @@ @interface BreakpointController : NSWindowController { BreakpointManager* manager; - - NSTableView* tableView_; - NSArrayController* arrayController_; - BSSourceView* sourceView_; + + IBOutlet NSArrayController* arrayController; + IBOutlet BSSourceView* sourceView; } -@property (assign) IBOutlet NSTableView* tableView; -@property (assign) IBOutlet BSSourceView* sourceView; -@property (assign) IBOutlet NSArrayController* arrayController; +@property(readonly) BSSourceView* sourceView; +@property(readonly) NSArrayController* arrayController; - (IBAction)addBreakpoint:(id)sender; - (IBAction)removeBreakpoint:(id)sender; diff --git a/Source/BreakpointController.m b/Source/BreakpointController.m index ef3e5a9..8790860 100644 --- a/Source/BreakpointController.m +++ b/Source/BreakpointController.m @@ -20,9 +20,7 @@ @implementation BreakpointController -@synthesize tableView = tableView_; -@synthesize arrayController = arrayController_; -@synthesize sourceView = sourceView_; +@synthesize sourceView, arrayController; /** * Constructor @@ -38,13 +36,6 @@ return self; } -/** - * Awake from NIB. - */ -- (void)awakeFromNib -{ -} - /** * Adds a breakpoint by calling up a file chooser and selecting a file for * breaking in @@ -54,9 +45,11 @@ NSOpenPanel* panel = [NSOpenPanel openPanel]; if ([panel runModal] != NSOKButton) + { return; + } - [sourceView_ setFile:[panel filename]]; + [sourceView setFile:[panel filename]]; } /** @@ -64,12 +57,16 @@ */ - (IBAction)removeBreakpoint:(id)sender { - NSArray* selection = [arrayController_ selectedObjects]; + NSArray* selection = [arrayController selectedObjects]; if ([selection count] < 1) + { return; - + } + for (Breakpoint* bp in selection) + { [manager removeBreakpointAt:[bp line] inFile:[bp file]]; + } } #pragma mark NSTableView Delegate @@ -80,45 +77,16 @@ */ - (void)tableViewSelectionDidChange:(NSNotification*)notif { - NSArray* selection = [arrayController_ selectedObjects]; + NSArray* selection = [arrayController selectedObjects]; if ([selection count] < 1) + { return; + } Breakpoint* bp = [selection objectAtIndex:0]; - [sourceView_ setFile:[bp file]]; - [sourceView_ scrollToLine:[bp line]]; - [[sourceView_ numberView] setMarkers:[NSSet setWithArray:[manager breakpointsForFile:[bp file]]]]; -} - -#pragma mark NSTableView Data Source - -/** - * Handles the beginning of a drag operation. - */ -- (BOOL)tableView:(NSTableView*)aTableView - writeRowsWithIndexes:(NSIndexSet*)rowIndexes - toPasteboard:(NSPasteboard*)pboard -{ -} - -/** - * Validates the drag operation. - */ -- (NSDragOperation)tableView:(NSTableView*)aTableView - validateDrop:(id)info - proposedRow:(NSInteger)row - proposedDropOperation:(NSTableViewDropOperation)operation -{ -} - -/** - * Incorporates the dropped data. - */ -- (BOOL)tableView:(NSTableView*)aTableView - acceptDrop:(id)info - row:(NSInteger)row - dropOperation:(NSTableViewDropOperation)operation -{ + [sourceView setFile:[bp file]]; + [sourceView scrollToLine:[bp line]]; + [[sourceView numberView] setMarkers:[NSSet setWithArray:[manager breakpointsForFile:[bp file]]]]; } #pragma mark BSSourceView Delegate @@ -128,16 +96,19 @@ */ - (void)gutterClickedAtLine:(int)line forFile:(NSString*)file { - if ([manager hasBreakpointAt:line inFile:file]) { + if ([manager hasBreakpointAt:line inFile:file]) + { [manager removeBreakpointAt:line inFile:file]; - } else { + } + else + { Breakpoint* bp = [[Breakpoint alloc] initWithLine:line inFile:file]; [manager addBreakpoint:bp]; [bp release]; } - [[sourceView_ numberView] setMarkers:[NSSet setWithArray:[manager breakpointsForFile:file]]]; - [[sourceView_ numberView] setNeedsDisplay:YES]; + [[sourceView numberView] setMarkers:[NSSet setWithArray:[manager breakpointsForFile:file]]]; + [[sourceView numberView] setNeedsDisplay:YES]; } @end -- 2.43.5