From d0a336076f5e432b2fe52db4b5f4b10cc37b69cc Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 5 Jan 2011 21:28:24 -0500 Subject: [PATCH] Stub out the methods needed for drag and drop on the breakpoint table view. --- English.lproj/Breakpoints.xib | 723 +++++++++++++++++++++++++++++++--- Source/BreakpointController.h | 12 +- Source/BreakpointController.m | 75 ++-- 3 files changed, 726 insertions(+), 84 deletions(-) diff --git a/English.lproj/Breakpoints.xib b/English.lproj/Breakpoints.xib index 8da4be7..1574853 100644 --- a/English.lproj/Breakpoints.xib +++ b/English.lproj/Breakpoints.xib @@ -1,27 +1,26 @@ - + 1050 - 9G55 - 677 - 949.43 - 353.00 + 10H574 + 804 + 1038.35 + 461.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 804 + YES + YES - com.apple.InterfaceBuilderKit com.apple.InterfaceBuilder.CocoaPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -42,9 +41,9 @@ Breakpoints NSWindow - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} - + 256 YES @@ -97,16 +96,16 @@ YES - 4.250000e+02 - 4.000000e+01 - 1.000000e+03 + 425 + 40 + 1000 - 75628032 - 0 + 75628096 + 2048 File LucidaGrande - 1.100000e+01 + 11 3100 @@ -129,7 +128,7 @@ Text Cell LucidaGrande - 1.100000e+01 + 11 16 @@ -139,7 +138,7 @@ controlBackgroundColor 3 - MC42NjY2NjY2OQA + MC42NjY2NjY2NjY3AA @@ -155,12 +154,12 @@ - 1.410000e+02 - 4.000000e+01 - 1.000000e+03 + 141 + 40 + 1000 - 75628032 - 0 + 75628096 + 2048 Line @@ -181,8 +180,8 @@ - 3.000000e+00 - 2.000000e+00 + 3 + 2 3 MQA @@ -196,16 +195,20 @@ MC41AA - 1.700000e+01 + 17 -566198272 + + 1 15 0 YES + 0 {{1, 17}, {572, 221}} + 4 @@ -217,7 +220,7 @@ _doScroller: - 9.321267e-01 + 0.93212669999999997 @@ -227,7 +230,7 @@ 1 _doScroller: - 9.982548e-01 + 0.9982548 @@ -238,6 +241,7 @@ {{1, 0}, {572, 17}} + 4 @@ -246,6 +250,7 @@ {{0, 19}, {574, 239}} + 562 @@ -266,7 +271,7 @@ LucidaGrande - 1.300000e+01 + 13 1044 @@ -317,9 +322,10 @@ {574, 484} + {{0, 0}, {1680, 1028}} - {3.40282e+38, 3.40282e+38} + {1.79769e+308, 1.79769e+308} BreakpointsWindow @@ -340,10 +346,6 @@ YES - - YES - BreakpointsWindowVisible - YES @@ -470,6 +472,14 @@ 49 + + + tableView + + + + 50 + @@ -486,7 +496,7 @@ -2 - RmlsZSdzIE93bmVyA + File's Owner -1 @@ -654,10 +664,8 @@ YES - + YES - -1.IBPluginDependency - -2.IBPluginDependency -3.IBPluginDependency 1.IBEditorWindowLastContentRect 1.IBPluginDependency @@ -683,13 +691,12 @@ 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}} @@ -715,13 +722,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin YES - - YES - + YES @@ -729,15 +735,13 @@ YES - - YES - + YES - 49 + 50 @@ -749,6 +753,13 @@ delegate id + + delegate + + delegate + id + + IBProjectSource Source/BSSourceView.h @@ -767,7 +778,7 @@ NSWindowController YES - + YES addBreakpoint: removeBreakpoint: @@ -778,17 +789,62 @@ 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 + @@ -808,17 +864,572 @@ 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 - IBProjectSource - Source/SocketWrapper.h + 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 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 f4fed51..1d8d7e2 100644 --- a/Source/BreakpointController.h +++ b/Source/BreakpointController.h @@ -21,13 +21,15 @@ @interface BreakpointController : NSWindowController { BreakpointManager* manager; - - IBOutlet NSArrayController* arrayController; - IBOutlet BSSourceView* sourceView; + + NSTableView* tableView_; + NSArrayController* arrayController_; + BSSourceView* sourceView_; } -@property(readonly) BSSourceView* sourceView; -@property(readonly) NSArrayController* arrayController; +@property (assign) IBOutlet NSTableView* tableView; +@property (assign) IBOutlet BSSourceView* sourceView; +@property (assign) IBOutlet NSArrayController* arrayController; - (IBAction)addBreakpoint:(id)sender; - (IBAction)removeBreakpoint:(id)sender; diff --git a/Source/BreakpointController.m b/Source/BreakpointController.m index 8790860..ef3e5a9 100644 --- a/Source/BreakpointController.m +++ b/Source/BreakpointController.m @@ -20,7 +20,9 @@ @implementation BreakpointController -@synthesize sourceView, arrayController; +@synthesize tableView = tableView_; +@synthesize arrayController = arrayController_; +@synthesize sourceView = sourceView_; /** * Constructor @@ -36,6 +38,13 @@ return self; } +/** + * Awake from NIB. + */ +- (void)awakeFromNib +{ +} + /** * Adds a breakpoint by calling up a file chooser and selecting a file for * breaking in @@ -45,11 +54,9 @@ NSOpenPanel* panel = [NSOpenPanel openPanel]; if ([panel runModal] != NSOKButton) - { return; - } - [sourceView setFile:[panel filename]]; + [sourceView_ setFile:[panel filename]]; } /** @@ -57,16 +64,12 @@ */ - (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 @@ -77,16 +80,45 @@ */ - (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]]]]; + [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 +{ } #pragma mark BSSourceView Delegate @@ -96,19 +128,16 @@ */ - (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