From 7cc4423c2fcc608ef2006a182c7a804a6a82d4d0 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 12 Jun 2013 18:08:24 +0100 Subject: [PATCH 01/96] Xcode 5.0 support. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 6 ++++-- SCXcodeMinimap/SCMiniMapView.m | 14 ++++++-------- SCXcodeMinimap/SCSelectionView.m | 6 ------ SCXcodeMinimap/SCXcodeMinimap.m | 4 ---- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index f39fe72..e33ee92 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -236,10 +236,11 @@ 18FE09C51707639E00118FEB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; DEPLOYMENT_LOCATION = YES; DSTROOT = "$(HOME)"; - GCC_ENABLE_OBJC_GC = supported; + GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SCXcodeMinimap/SCXcodeMinimap-Prefix.pch"; INFOPLIST_FILE = "SCXcodeMinimap/SCXcodeMinimap-Info.plist"; @@ -252,10 +253,11 @@ 18FE09C61707639E00118FEB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; COMBINE_HIDPI_IMAGES = YES; DEPLOYMENT_LOCATION = YES; DSTROOT = "$(HOME)"; - GCC_ENABLE_OBJC_GC = supported; + GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SCXcodeMinimap/SCXcodeMinimap-Prefix.pch"; INFOPLIST_FILE = "SCXcodeMinimap/SCXcodeMinimap-Info.plist"; diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index 90318c6..1ac04f3 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -54,12 +54,6 @@ - (id)initWithFrame:(NSRect)frame - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [_selectionView release]; - [_textView release]; - [_backgroundColor release]; - [_font release]; - [super dealloc]; } #pragma mark - Lazy Initialization @@ -197,7 +191,6 @@ - (void)updateTextView [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSBackgroundColorAttributeName : self.backgroundColor} range:NSMakeRange(0, mutableAttributedString.length)]; [self.textView.textStorage setAttributedString:mutableAttributedString]; - [mutableAttributedString release]; } - (void)resizeWithOldSuperviewSize:(NSSize)oldSize @@ -248,7 +241,12 @@ - (void)updateSelectionViewAnimated:(BOOL)animated - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinished { - if(layoutFinished) { + if([layoutManager isEqual:self.editorTextView.layoutManager]) { + [(id)self.editorTextView layoutManager:layoutManager + didCompleteLayoutForTextContainer:textContainer + atEnd:layoutFinished]; + } + else if(layoutFinished) { [self updateSelectionView]; } } diff --git a/SCXcodeMinimap/SCSelectionView.m b/SCXcodeMinimap/SCSelectionView.m index 6bd84ae..3f26bfc 100644 --- a/SCXcodeMinimap/SCSelectionView.m +++ b/SCXcodeMinimap/SCSelectionView.m @@ -11,12 +11,6 @@ @implementation SCSelectionView @synthesize selectionColor = _selectionColor; -- (void)dealloc -{ - [self.selectionColor release]; - [super dealloc]; -} - - (void)drawRect:(NSRect)dirtyRect { [[self selectionColor] setFill]; diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 617fc80..02ccaac 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -63,8 +63,6 @@ - (void)createMenuItem atIndex:[editMenuItem.submenu numberOfItems]]; [editMenuItem.submenu insertItem:miniMapItem atIndex:[editMenuItem.submenu numberOfItems]]; - - [miniMapItem release]; if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { [self hideMiniMap:miniMapItem]; @@ -161,8 +159,6 @@ - (void)onDidFinishSetup:(NSNotification*)sender else { [miniMapView show]; } - - [miniMapView release]; } @end \ No newline at end of file From a6fffe545a743caf6a22990ff409f03bd34b07e8 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 13 Jun 2013 09:01:14 +0100 Subject: [PATCH 02/96] Cleanup. --- SCXcodeMinimap/SCMiniMapView.h | 6 +++--- SCXcodeMinimap/SCMiniMapView.m | 4 ++-- SCXcodeMinimap/SCSelectionView.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.h b/SCXcodeMinimap/SCMiniMapView.h index bc0d0d2..88fca8e 100644 --- a/SCXcodeMinimap/SCMiniMapView.h +++ b/SCXcodeMinimap/SCMiniMapView.h @@ -11,10 +11,10 @@ @interface SCMiniMapView : NSScrollView -@property (nonatomic, retain) NSTextView *textView; -@property (nonatomic, retain) SCSelectionView *selectionView; +@property (nonatomic, strong) NSTextView *textView; +@property (nonatomic, strong) SCSelectionView *selectionView; -@property (nonatomic, assign) NSScrollView *editorScrollView; +@property (nonatomic, weak) NSScrollView *editorScrollView; @property (nonatomic, assign) NSTextView *editorTextView; - (void)updateTextView; diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index 1ac04f3..de7ab39 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -13,8 +13,8 @@ @interface SCMiniMapView () -@property (nonatomic, retain) NSColor *backgroundColor; -@property (nonatomic, retain) NSFont *font; +@property (nonatomic, strong) NSColor *backgroundColor; +@property (nonatomic, strong) NSFont *font; @end diff --git a/SCXcodeMinimap/SCSelectionView.h b/SCXcodeMinimap/SCSelectionView.h index d567196..7c47c46 100644 --- a/SCXcodeMinimap/SCSelectionView.h +++ b/SCXcodeMinimap/SCSelectionView.h @@ -10,7 +10,7 @@ @interface SCSelectionView : NSView -@property (nonatomic, retain) NSColor *selectionColor; +@property (nonatomic, strong) NSColor *selectionColor; @property (nonatomic, assign) BOOL shouldInverseColors; @end From 1b8fad5afba97c9362f8fe92c54f31c9270046d6 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 13 Aug 2013 14:31:36 +0100 Subject: [PATCH 03/96] #13 Added DVTPlugInCompatibilityUUID. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 091842b..3d25daa 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -22,6 +22,10 @@ ???? CFBundleVersion 1 + DVTPlugInCompatibilityUUIDs + + 63FC1C47-140D-42B0-BB4D-A10B2D225574 + NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. NSPrincipalClass From 0cdb45688ffd3ee3c14609ee59b918b4f5b95252 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 24 Aug 2013 13:30:47 +0100 Subject: [PATCH 04/96] Xcode 5 fixes for issues #14 and #4 plus a strange crash on retina devices --- SCXcodeMinimap.xcodeproj/project.pbxproj | 4 +-- SCXcodeMinimap/SCMiniMapView.m | 39 ++++++++---------------- SCXcodeMinimap/SCXcodeMinimap.m | 2 +- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index e33ee92..cbc9b4c 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -132,7 +132,7 @@ 18FE09AA1707639E00118FEB /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0500; ORGANIZATIONNAME = "Stefan Ceriu"; }; buildConfigurationList = 18FE09AD1707639E00118FEB /* Build configuration list for PBXProject "SCXcodeMinimap" */; @@ -180,7 +180,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_CONSTANT_CONVERSION = YES; @@ -212,7 +211,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_WARN_CONSTANT_CONVERSION = YES; diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index de7ab39..57bb3f3 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -27,7 +27,7 @@ - (id)initWithFrame:(NSRect)frame { /* Configure ScrollView */ [self setWantsLayer:YES]; - [self setAutoresizingMask: NSViewMinXMargin | NSViewWidthSizable | NSViewHeightSizable]; + [self setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable]; [self setDrawsBackground:NO]; [self setHorizontalScrollElasticity:NSScrollElasticityNone]; [self setVerticalScrollElasticity:NSScrollElasticityNone]; @@ -62,14 +62,11 @@ - (NSTextView *)textView { if (_textView == nil) { _textView = [[NSTextView alloc] initWithFrame:self.bounds]; - [_textView setAutoresizingMask: NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable]; [_textView setBackgroundColor:[NSColor clearColor]]; [_textView.textContainer setLineFragmentPadding:0.0f]; [_textView.layoutManager setDelegate:self]; -// [_textView.layoutManager setAllowsNonContiguousLayout:YES]; -// [_textView.layoutManager setBackgroundLayoutEnabled:YES]; [_textView setAllowsUndo:NO]; [_textView setAllowsImageEditing:NO]; @@ -147,10 +144,10 @@ - (NSColor *)backgroundColor - (void)show { self.hidden = NO; - - NSRect editorTextViewFrame = self.editorTextView.frame; - editorTextViewFrame.size.width = self.editorTextView.superview.frame.size.width - self.bounds.size.width - kRightSidePadding; - self.editorTextView.frame = editorTextViewFrame; + + NSRect editorTextViewFrame = self.editorScrollView.frame; + editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width - self.bounds.size.width; + self.editorScrollView.frame = editorTextViewFrame; [self updateTextView]; [self updateSelectionView]; @@ -160,9 +157,9 @@ - (void)hide { self.hidden = YES; - NSRect editorTextViewFrame = self.editorTextView.frame; - editorTextViewFrame.size.width = self.editorTextView.superview.frame.size.width; - self.editorTextView.frame = editorTextViewFrame; + NSRect editorTextViewFrame = self.editorScrollView.frame; + editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width; + self.editorScrollView.frame = editorTextViewFrame; } #pragma mark - Updating @@ -170,10 +167,10 @@ - (void)hide - (void)updateTheme { [self setFont:nil]; - [self updateTextView]; [self setBackgroundColor:nil]; [self.selectionView setSelectionColor:nil]; + [self.textView setBackgroundColor:self.backgroundColor]; } - (void)updateTextView @@ -188,23 +185,17 @@ - (void)updateTextView return; } - [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSBackgroundColorAttributeName : self.backgroundColor} range:NSMakeRange(0, mutableAttributedString.length)]; - + [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font} range:NSMakeRange(0, mutableAttributedString.length)]; [self.textView.textStorage setAttributedString:mutableAttributedString]; } - (void)resizeWithOldSuperviewSize:(NSSize)oldSize { [super resizeWithOldSuperviewSize:oldSize]; - [self updateSelectionViewAnimated:YES]; + [self updateSelectionView]; } - (void)updateSelectionView -{ - [self updateSelectionViewAnimated:NO]; -} - -- (void)updateSelectionViewAnimated:(BOOL)animated { if ([self isHidden]) { return; @@ -229,12 +220,8 @@ - (void)updateSelectionViewAnimated:(BOOL)animated ratio = (textHeight - self.selectionView.bounds.size.height) / editorContentHeight; selectionViewFrame.origin.y = self.editorScrollView.contentView.bounds.origin.y * ratio; } - - if(animated) { - [self.selectionView.animator setFrame:selectionViewFrame]; - } else { - [self.selectionView setFrame:selectionViewFrame]; - } + + [self.selectionView setFrame:selectionViewFrame]; } #pragma mark - NSLayoutManagerDelegate diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 02ccaac..3b79ae6 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -139,7 +139,7 @@ - (void)onDidFinishSetup:(NSNotification*)sender /* Create Mini Map */ CGFloat width = editorTextView.bounds.size.width * kDefaultZoomLevel; - NSRect miniMapScrollViewFrame = NSMakeRect(editorContainerView.bounds.size.width - width - kRightSidePadding, + NSRect miniMapScrollViewFrame = NSMakeRect(editorContainerView.bounds.size.width - width, 0, width, editorScrollView.bounds.size.height); From cd0b4072c4c75c24a513cb9302444c324778179e Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 24 Aug 2013 14:37:01 +0100 Subject: [PATCH 05/96] Fixes #12 --- SCXcodeMinimap/SCMiniMapView.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index 57bb3f3..adec714 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -184,8 +184,18 @@ - (void)updateTextView if(mutableAttributedString == nil) { return; } - - [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font} range:NSMakeRange(0, mutableAttributedString.length)]; + + __block NSMutableParagraphStyle *style; + [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName + inRange:NSMakeRange(0, mutableAttributedString.length) + options:0 + usingBlock:^(id value, NSRange range, BOOL *stop) { + style = [value mutableCopy]; + }]; + [style setTabStops:@[]]; + [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; + + [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)]; [self.textView.textStorage setAttributedString:mutableAttributedString]; } From 9e137f60408cff0e2a56a924baca8f06de3ff40f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?So=CC=88ren=20Busch?= Date: Mon, 16 Sep 2013 10:27:09 +0200 Subject: [PATCH 06/96] added UUID for Xcode 5 GM support --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 3d25daa..b4e435c 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -25,6 +25,7 @@ DVTPlugInCompatibilityUUIDs 63FC1C47-140D-42B0-BB4D-A10B2D225574 + 37B30044-3B14-46BA-ABAA-F01000C27B63 NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. From 16f9ff01e28941339dda0e6687d92e9a05d5bbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?So=CC=88ren=20Busch?= Date: Thu, 19 Sep 2013 15:35:55 +0200 Subject: [PATCH 07/96] Fixed bug, that would cause Xcode 5 to crash, when connecting from Interface Builder to Text Editor --- SCXcodeMinimap/SCXcodeMinimap.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 3b79ae6..a1ad408 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -94,10 +94,14 @@ - (void)showMiniMap:(NSMenuItem *)sender - (void)onDocumentDidChange:(NSNotification*)sender { + if ([[[sender object] class] isSubclassOfClass:[NSDocument class]]) + { SCMiniMapView *miniMapView = objc_getAssociatedObject([sender object], &kKeyMiniMapView); [miniMapView updateTextView]; } +} + - (void)onCodeEditorBoundsChange:(NSNotification*)sender { if(![sender.object respondsToSelector:@selector(scrollView)]) { From c09dfd7687d2ed0aa6928b6e83a20d877d70c2cc Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 30 Sep 2013 09:00:47 +0100 Subject: [PATCH 08/96] Fixes for #17 (incomplete) --- SCXcodeMinimap/SCMiniMapView.m | 51 ++++++++++++++++---------------- SCXcodeMinimap/SCSelectionView.m | 2 +- SCXcodeMinimap/SCXcodeMinimap.m | 32 +++++++++----------- 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index f4d9c0f..de4e8f0 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -22,8 +22,7 @@ @implementation SCMiniMapView - (id)initWithFrame:(NSRect)frame { - self = [super initWithFrame:frame]; - if (self) + if (self = [super initWithFrame:frame]) { /* Configure ScrollView */ [self setWantsLayer:YES]; @@ -31,7 +30,7 @@ - (id)initWithFrame:(NSRect)frame [self setDrawsBackground:NO]; [self setHorizontalScrollElasticity:NSScrollElasticityNone]; [self setVerticalScrollElasticity:NSScrollElasticityNone]; - + /* Subscribe to show/hide notifications */ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(show) @@ -65,7 +64,7 @@ - (NSTextView *)textView [_textView setBackgroundColor:[NSColor clearColor]]; [_textView.textContainer setLineFragmentPadding:0.0f]; - + [_textView.layoutManager setDelegate:self]; [_textView setAllowsUndo:NO]; @@ -78,7 +77,7 @@ - (NSTextView *)textView [_textView setAutomaticTextReplacementEnabled:NO]; [_textView setContinuousSpellCheckingEnabled:NO]; [_textView setDisplaysLinkToolTips:NO]; - [_textView setEditable:NO]; + [_textView setEditable:NO]; [_textView setRichText:YES]; [_textView setSelectable:NO]; @@ -103,7 +102,7 @@ - (SCSelectionView *)selectionView - (NSFont *)font { - if(_font == nil) { + if(_font == nil) { _font = [NSFont fontWithName:@"Menlo" size:11 * kDefaultZoomLevel]; Class DVTFontAndColorThemeClass = NSClassFromString(@"DVTFontAndColorTheme"); @@ -135,7 +134,7 @@ - (NSColor *)backgroundColor } } } - + return _backgroundColor; } @@ -144,7 +143,7 @@ - (NSColor *)backgroundColor - (void)show { self.hidden = NO; - + NSRect editorTextViewFrame = self.editorScrollView.frame; editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width - self.bounds.size.width; self.editorScrollView.frame = editorTextViewFrame; @@ -156,7 +155,7 @@ - (void)show - (void)hide { self.hidden = YES; - + NSRect editorTextViewFrame = self.editorScrollView.frame; editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width; self.editorScrollView.frame = editorTextViewFrame; @@ -178,24 +177,26 @@ - (void)updateTextView if ([self isHidden]) { return; } - + NSMutableAttributedString *mutableAttributedString = [self.editorTextView.textStorage mutableCopy]; - + if(mutableAttributedString == nil) { return; } - __block NSMutableParagraphStyle *style; [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName inRange:NSMakeRange(0, mutableAttributedString.length) options:0 usingBlock:^(id value, NSRange range, BOOL *stop) { - style = [value mutableCopy]; + + NSMutableParagraphStyle *style = [value mutableCopy]; + [style setTabStops:@[]]; + [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; + [mutableAttributedString addAttributes:@{NSParagraphStyleAttributeName:style} range:range]; }]; - [style setTabStops:@[]]; - [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; - - [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)]; + + [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font} range:NSMakeRange(0, mutableAttributedString.length)]; + [self.textView.textStorage setAttributedString:mutableAttributedString]; } @@ -210,22 +211,22 @@ - (void)updateSelectionView if ([self isHidden]) { return; } - + NSRect selectionViewFrame = NSMakeRect(0, 0, self.bounds.size.width, self.editorScrollView.visibleRect.size.height * kDefaultZoomLevel); - - + + CGFloat editorContentHeight = [self.editorScrollView.documentView frame].size.height - self.editorScrollView.bounds.size.height; - + if(editorContentHeight == 0) { selectionViewFrame.origin.y = 0; } else { CGFloat ratio = ([self.documentView frame].size.height - self.bounds.size.height) / editorContentHeight; [self.contentView scrollToPoint:NSMakePoint(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio))]; - + CGFloat textHeight = [self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer].size.height; ratio = (textHeight - self.selectionView.bounds.size.height) / editorContentHeight; selectionViewFrame.origin.y = self.editorScrollView.contentView.bounds.origin.y * ratio; @@ -300,11 +301,11 @@ - (void)goAtRelativePosition:(NSPoint)position CGFloat documentHeight = [self.editorScrollView.documentView frame].size.height; CGSize boundsSize = self.editorScrollView.bounds.size; CGFloat maxOffset = documentHeight - boundsSize.height; - + CGFloat offset = floor(documentHeight * position.y - boundsSize.height/2); - + offset = MIN(MAX(0, offset), maxOffset); - + [self.editorTextView scrollRectToVisible:NSMakeRect(0, offset, boundsSize.width, boundsSize.height)]; } diff --git a/SCXcodeMinimap/SCSelectionView.m b/SCXcodeMinimap/SCSelectionView.m index 3f26bfc..885f7ae 100644 --- a/SCXcodeMinimap/SCSelectionView.m +++ b/SCXcodeMinimap/SCSelectionView.m @@ -32,7 +32,7 @@ - (NSColor *)selectionColor NSColor *backgroundColor = [[theme performSelector:@selector(sourceTextBackgroundColor)] colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; if(self.shouldInverseColors) { - + _selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [backgroundColor redComponent]) green:(1.0f - [backgroundColor greenComponent]) blue:(1.0f - [backgroundColor blueComponent]) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index a1ad408..5057811 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -53,17 +53,17 @@ - (void)createMenuItem } NSMenuItem *miniMapItem = [[NSMenuItem alloc] initWithTitle:@"" - action:NULL - keyEquivalent:@"M"]; + action:NULL + keyEquivalent:@"M"]; [miniMapItem setKeyEquivalentModifierMask:NSControlKeyMask | NSShiftKeyMask]; miniMapItem.target = self; [editMenuItem.submenu insertItem:[NSMenuItem separatorItem] - atIndex:[editMenuItem.submenu numberOfItems]]; + atIndex:[editMenuItem.submenu numberOfItems]]; [editMenuItem.submenu insertItem:miniMapItem - atIndex:[editMenuItem.submenu numberOfItems]]; - + atIndex:[editMenuItem.submenu numberOfItems]]; + if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { [self hideMiniMap:miniMapItem]; } @@ -75,33 +75,29 @@ - (void)createMenuItem - (void)hideMiniMap:(NSMenuItem *)sender { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:SCXodeMinimapIsInitiallyHidden]; - + [sender setTitle:@"Show MiniMap"]; [sender setAction:@selector(showMiniMap:)]; - + [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapWantsToBeHiddenNotification object:nil]; } - (void)showMiniMap:(NSMenuItem *)sender { [[NSUserDefaults standardUserDefaults] setBool:NO forKey:SCXodeMinimapIsInitiallyHidden]; - + [sender setTitle:@"Hide MiniMap"]; [sender setAction:@selector(hideMiniMap:)]; - + [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapWantsToBeShownNotification object:nil]; } - (void)onDocumentDidChange:(NSNotification*)sender { - if ([[[sender object] class] isSubclassOfClass:[NSDocument class]]) - { SCMiniMapView *miniMapView = objc_getAssociatedObject([sender object], &kKeyMiniMapView); [miniMapView updateTextView]; } -} - - (void)onCodeEditorBoundsChange:(NSNotification*)sender { if(![sender.object respondsToSelector:@selector(scrollView)]) { @@ -131,7 +127,7 @@ - (void)onDidFinishSetup:(NSNotification*)sender NSLog(@"Could not fetch editor document"); return; } - + /* Get Editor Components */ NSDocument *editorDocument = [[sender object] performSelector:@selector(sourceCodeDocument)]; NSView *editorContainerView = [[sender object] performSelector:@selector(containerView)]; @@ -139,7 +135,7 @@ - (void)onDidFinishSetup:(NSNotification*)sender NSTextView *editorTextView = [[sender object] performSelector:@selector(textView)]; [editorTextView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable]; - + /* Create Mini Map */ CGFloat width = editorTextView.bounds.size.width * kDefaultZoomLevel; @@ -147,16 +143,16 @@ - (void)onDidFinishSetup:(NSNotification*)sender 0, width, editorScrollView.bounds.size.height); - + SCMiniMapView *miniMapView = [[SCMiniMapView alloc] initWithFrame:miniMapScrollViewFrame]; miniMapView.editorScrollView = editorScrollView; miniMapView.editorTextView = editorTextView; [editorContainerView addSubview:miniMapView]; - + /* Setup Associated Objects */ objc_setAssociatedObject(editorScrollView, &kKeyMiniMapView, miniMapView, OBJC_ASSOCIATION_ASSIGN); objc_setAssociatedObject(editorDocument, &kKeyMiniMapView, miniMapView, OBJC_ASSOCIATION_ASSIGN); - + if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { [miniMapView hide]; } From fef38fad434d8a09e962308dd541690a87355313 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 6 Oct 2013 14:29:29 +0100 Subject: [PATCH 09/96] Fix attempt for #17 --- SCXcodeMinimap/SCMiniMapView.h | 2 +- SCXcodeMinimap/SCXcodeMinimap.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.h b/SCXcodeMinimap/SCMiniMapView.h index 88fca8e..c11be52 100644 --- a/SCXcodeMinimap/SCMiniMapView.h +++ b/SCXcodeMinimap/SCMiniMapView.h @@ -15,7 +15,7 @@ @property (nonatomic, strong) SCSelectionView *selectionView; @property (nonatomic, weak) NSScrollView *editorScrollView; -@property (nonatomic, assign) NSTextView *editorTextView; +@property (nonatomic, strong) NSTextView *editorTextView; - (void)updateTextView; - (void)updateSelectionView; diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 5057811..1f6c164 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -151,7 +151,7 @@ - (void)onDidFinishSetup:(NSNotification*)sender /* Setup Associated Objects */ objc_setAssociatedObject(editorScrollView, &kKeyMiniMapView, miniMapView, OBJC_ASSOCIATION_ASSIGN); - objc_setAssociatedObject(editorDocument, &kKeyMiniMapView, miniMapView, OBJC_ASSOCIATION_ASSIGN); + objc_setAssociatedObject(editorDocument, &kKeyMiniMapView, miniMapView, OBJC_ASSOCIATION_RETAIN); if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { [miniMapView hide]; From 9dc124140709c30d0afe23d2aba10df2be336197 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 26 Oct 2013 08:44:02 +0100 Subject: [PATCH 10/96] Fixes #12 --- SCXcodeMinimap.xcodeproj/project.pbxproj | 2 -- SCXcodeMinimap/Conf.h | 18 ------------------ SCXcodeMinimap/SCMiniMapView.h | 2 ++ SCXcodeMinimap/SCMiniMapView.m | 20 +++++++++++++------- SCXcodeMinimap/SCXcodeMinimap-Prefix.pch | 1 - 5 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 SCXcodeMinimap/Conf.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index cbc9b4c..a7ef96e 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -29,7 +29,6 @@ 8742532217307161001C947C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; B25F211A172FE208001A9E6E /* SCMiniMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCMiniMapView.h; sourceTree = ""; }; B25F211B172FE208001A9E6E /* SCMiniMapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCMiniMapView.m; sourceTree = ""; }; - B25F211D172FE3B3001A9E6E /* Conf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Conf.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -85,7 +84,6 @@ 18FE09BB1707639E00118FEB /* SCXcodeMinimap */ = { isa = PBXGroup; children = ( - B25F211D172FE3B3001A9E6E /* Conf.h */, 18FE09C7170764E400118FEB /* SCXcodeMinimap.h */, 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */, B25F211A172FE208001A9E6E /* SCMiniMapView.h */, diff --git a/SCXcodeMinimap/Conf.h b/SCXcodeMinimap/Conf.h deleted file mode 100644 index 173d46b..0000000 --- a/SCXcodeMinimap/Conf.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// Conf.h -// SCXcodeMinimap -// -// Created by Jérôme ALVES on 30/04/13. -// Copyright (c) 2013 Stefan Ceriu. All rights reserved. -// - -#ifndef SCXcodeMinimap_Conf_h -#define SCXcodeMinimap_Conf_h - - -#define kDefaultZoomLevel 0.1f -#define kRightSidePadding 10.0f -#define kDefaultShadowLevel 0.1f - - -#endif diff --git a/SCXcodeMinimap/SCMiniMapView.h b/SCXcodeMinimap/SCMiniMapView.h index c11be52..f7a5b80 100644 --- a/SCXcodeMinimap/SCMiniMapView.h +++ b/SCXcodeMinimap/SCMiniMapView.h @@ -9,6 +9,8 @@ #import #import "SCSelectionView.h" +extern const CGFloat kDefaultZoomLevel; + @interface SCMiniMapView : NSScrollView @property (nonatomic, strong) NSTextView *textView; diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index de4e8f0..72606a3 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -9,6 +9,9 @@ #import "SCMiniMapView.h" #import "SCXcodeMinimap.h" +const CGFloat kDefaultZoomLevel = 0.1f; +static const CGFloat kDefaultShadowLevel = 0.1f; + static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; @interface SCMiniMapView () @@ -184,18 +187,21 @@ - (void)updateTextView return; } + __block NSMutableParagraphStyle *style; + [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName inRange:NSMakeRange(0, mutableAttributedString.length) options:0 usingBlock:^(id value, NSRange range, BOOL *stop) { - - NSMutableParagraphStyle *style = [value mutableCopy]; - [style setTabStops:@[]]; - [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; - [mutableAttributedString addAttributes:@{NSParagraphStyleAttributeName:style} range:range]; - }]; + style = [value mutableCopy]; + *stop = YES; + }]; - [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font} range:NSMakeRange(0, mutableAttributedString.length)]; + + [style setTabStops:@[]]; + [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; + + [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)]; [self.textView.textStorage setAttributedString:mutableAttributedString]; } diff --git a/SCXcodeMinimap/SCXcodeMinimap-Prefix.pch b/SCXcodeMinimap/SCXcodeMinimap-Prefix.pch index 9fedb27..9aa58be 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Prefix.pch +++ b/SCXcodeMinimap/SCXcodeMinimap-Prefix.pch @@ -4,5 +4,4 @@ #ifdef __OBJC__ #import - #import "Conf.h" #endif \ No newline at end of file From 8bc99a044d8b5d8240802b72bd79c4978c6a1828 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 26 Oct 2013 08:54:40 +0100 Subject: [PATCH 11/96] Updated readme. --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 547c5da..9fe55b8 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,12 @@ SCXcodeMiniMap is a plugin that adds a source editor MiniMap to Xcode. - View menu item for showing/hiding it (Ctrl+Shift+M) - Size configurable via the kDefaultZoomLevel parameter (defaults to 10% out of the editor's size) -- Tested on OS X 10.7.5 Xcode 4.6(4H127) and OS X 1.8.3 Xcode 4.6.2(4H1003) - ## Installation -- Build the project and restart Xcode +- Build the project and restart Xcode or -- If you encounter any issues you can uninstall it by removing the ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeMinimap.xcplugin folder +- Download SCXcodeMinimap.xcplugin.zip from the releases tab, unzip and move it to the Xcode plugins folder ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeMinimap.xcplugin -##Known issues -- Line breaks don't match between the normal editor and the minimap +- If you encounter any issues you can uninstall it by removing the ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeMinimap.xcplugin folder ## License SCXcodeMiniMap is released under the GNU GENERAL PUBLIC LICENSE (see the LICENSE file) From 56198f6515bb09a844c8468e145f5aa6728bb2e4 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 28 Nov 2013 10:07:34 +0000 Subject: [PATCH 12/96] Added small fix for empty files. --- SCXcodeMinimap/SCMiniMapView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index 72606a3..3f3fd35 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -183,7 +183,7 @@ - (void)updateTextView NSMutableAttributedString *mutableAttributedString = [self.editorTextView.textStorage mutableCopy]; - if(mutableAttributedString == nil) { + if(mutableAttributedString.length == 0) { return; } From 099c11626eb61bd2ddf9867c31b17dc835849c40 Mon Sep 17 00:00:00 2001 From: Isaac Greenspan Date: Tue, 11 Mar 2014 06:55:39 -0500 Subject: [PATCH 13/96] Adding Xcode 5.1 UUID. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index b4e435c..c4e7b9b 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -24,6 +24,7 @@ 1 DVTPlugInCompatibilityUUIDs + A2E4D43F-41F4-4FB9-BB94-7177011C9AED 63FC1C47-140D-42B0-BB4D-A10B2D225574 37B30044-3B14-46BA-ABAA-F01000C27B63 From d89c1f98f39d8285078a5d963136624b301b218a Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Mon, 14 Apr 2014 10:47:54 -0700 Subject: [PATCH 14/96] Remove NSLog when missing View menu item I like to run specs (`$ xcodebuild $ARGS test`) on the command line, and this little log statement chimes in every time. Can we remove it? Signed-off-by: Stephen Celis --- SCXcodeMinimap/SCXcodeMinimap.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 1f6c164..671d99a 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -48,7 +48,6 @@ - (void)createMenuItem NSMenuItem *editMenuItem = [[NSApp mainMenu] itemWithTitle:@"View"]; if(editMenuItem == nil) { - NSLog(@"Could not fetch 'View' main menu item"); return; } @@ -161,4 +160,4 @@ - (void)onDidFinishSetup:(NSNotification*)sender } } -@end \ No newline at end of file +@end From 79025f3aa79938c02dd0247d9b4f1a8b07e2241a Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 16 Apr 2014 08:40:39 +0100 Subject: [PATCH 15/96] Bumped version to v1.3 and updated screenshot. --- README.md | 2 +- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9fe55b8..19c9ae9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ SCXcodeMiniMap is a plugin that adds a source editor MiniMap to Xcode. -![SCXcodeMiniMap](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap.png) +![SCXcodeMiniMap](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/SCXcodeMiniMapv1.3.png) ## Features - It works with an unlimited number of opened editors, including the assistant and version editors diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index c4e7b9b..e500118 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.0 + 1.3 CFBundleSignature ???? CFBundleVersion From 405a9acc80fcfff9c11327c602b048d2e44c67bb Mon Sep 17 00:00:00 2001 From: JmeHsieh Date: Tue, 13 May 2014 03:20:06 +0800 Subject: [PATCH 16/96] Take mouse down offset into account for better user experience. --- SCXcodeMinimap/SCMiniMapView.m | 39 ++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index 3f3fd35..22734e8 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -286,8 +286,13 @@ - (void)mouseDragged:(NSEvent *)theEvent - (void) handleMouseEvent:(NSEvent *)theEvent { - NSPoint locationInSelf = [self convertPoint:theEvent.locationInWindow fromView:nil]; + static BOOL isDragging; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + isDragging = NO; + }); + NSPoint locationInSelf = [self convertPoint:theEvent.locationInWindow fromView:nil]; NSSize textSize = [self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer].size; NSSize frameSize = self.frame.size; @@ -299,17 +304,43 @@ - (void) handleMouseEvent:(NSEvent *)theEvent point = NSMakePoint(locationInSelf.x / textSize.width, locationInSelf.y / frameSize.height); } - [self goAtRelativePosition:point]; + BOOL justStartDragging = NO; + if (theEvent.type == NSLeftMouseUp) { + isDragging = NO; + } + else { + justStartDragging = !isDragging; + isDragging = YES; + } + + [self goAtRelativePosition:point justStartDragging:justStartDragging]; } -- (void)goAtRelativePosition:(NSPoint)position +- (void)goAtRelativePosition:(NSPoint)position justStartDragging:(BOOL)justStartDragging { + static CGFloat mouseDownOffset; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + mouseDownOffset = 0; + }); + CGFloat documentHeight = [self.editorScrollView.documentView frame].size.height; CGSize boundsSize = self.editorScrollView.bounds.size; CGFloat maxOffset = documentHeight - boundsSize.height; + CGFloat locationInDocumentY = documentHeight * position.y; - CGFloat offset = floor(documentHeight * position.y - boundsSize.height/2); + if (justStartDragging) { + mouseDownOffset = locationInDocumentY - + (self.editorScrollView.contentView.documentVisibleRect.origin.y + boundsSize.height/2.0); + } + CGFloat offset; + if (fabs(mouseDownOffset) <= boundsSize.height/2.0) { + offset = floor(locationInDocumentY - boundsSize.height/2 - mouseDownOffset); + } + else { + offset = floor(locationInDocumentY - boundsSize.height/2); + } offset = MIN(MAX(0, offset), maxOffset); [self.editorTextView scrollRectToVisible:NSMakeRect(0, offset, boundsSize.width, boundsSize.height)]; From 4487b62ccc6a22ef0c70a61bccb6f6f16754210c Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 6 Aug 2014 09:46:19 +0100 Subject: [PATCH 17/96] Xcode 6 support + various tweaks and fixes. --- SCXcodeMinimap/SCMiniMapView.h | 2 +- SCXcodeMinimap/SCMiniMapView.m | 57 ++++++++++++------------ SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + SCXcodeMinimap/SCXcodeMinimap.m | 18 +++++--- 4 files changed, 41 insertions(+), 37 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.h b/SCXcodeMinimap/SCMiniMapView.h index f7a5b80..31cee90 100644 --- a/SCXcodeMinimap/SCMiniMapView.h +++ b/SCXcodeMinimap/SCMiniMapView.h @@ -11,7 +11,7 @@ extern const CGFloat kDefaultZoomLevel; -@interface SCMiniMapView : NSScrollView +@interface SCMiniMapView : NSScrollView @property (nonatomic, strong) NSTextView *textView; @property (nonatomic, strong) SCSelectionView *selectionView; diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index 22734e8..9c73592 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -14,7 +14,7 @@ static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; -@interface SCMiniMapView () +@interface SCMiniMapView () @property (nonatomic, strong) NSColor *backgroundColor; @property (nonatomic, strong) NSFont *font; @@ -22,6 +22,12 @@ @interface SCMiniMapView () @end @implementation SCMiniMapView +@synthesize backgroundColor = _backgroundColor; + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} - (id)initWithFrame:(NSRect)frame { @@ -53,23 +59,17 @@ - (id)initWithFrame:(NSRect)frame return self; } -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - #pragma mark - Lazy Initialization - (NSTextView *)textView { if (_textView == nil) { - _textView = [[NSTextView alloc] initWithFrame:self.bounds]; + _textView = [[NSClassFromString(@"DVTSourceTextView") alloc] initWithFrame:self.bounds]; + [_textView setBackgroundColor:[NSColor clearColor]]; [_textView.textContainer setLineFragmentPadding:0.0f]; - [_textView.layoutManager setDelegate:self]; - [_textView setAllowsUndo:NO]; [_textView setAllowsImageEditing:NO]; [_textView setAutomaticDashSubstitutionEnabled:NO]; @@ -87,8 +87,12 @@ - (NSTextView *)textView [self setDocumentView:_textView]; [self updateTheme]; + + [[NSNotificationCenter defaultCenter] removeObserver:_textView name:DVTFontAndColorSourceTextSettingsChangedNotification object:nil]; } + [_textView.layoutManager setDelegate:self]; + return _textView; } @@ -186,21 +190,21 @@ - (void)updateTextView if(mutableAttributedString.length == 0) { return; } - + __block NSMutableParagraphStyle *style; - - [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName - inRange:NSMakeRange(0, mutableAttributedString.length) - options:0 - usingBlock:^(id value, NSRange range, BOOL *stop) { + + [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName + inRange:NSMakeRange(0, mutableAttributedString.length) + options:0 + usingBlock:^(id value, NSRange range, BOOL *stop) { style = [value mutableCopy]; *stop = YES; }]; [style setTabStops:@[]]; - [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; - + [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; + [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)]; [self.textView.textStorage setAttributedString:mutableAttributedString]; @@ -238,30 +242,25 @@ - (void)updateSelectionView selectionViewFrame.origin.y = self.editorScrollView.contentView.bounds.origin.y * ratio; } - [self.selectionView setFrame:selectionViewFrame]; + [self.selectionView setFrame:selectionViewFrame]; } #pragma mark - NSLayoutManagerDelegate - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinished { - if([layoutManager isEqual:self.editorTextView.layoutManager]) { - [(id)self.editorTextView layoutManager:layoutManager - didCompleteLayoutForTextContainer:textContainer - atEnd:layoutFinished]; - } - else if(layoutFinished) { + if(layoutFinished) { [self updateSelectionView]; } } - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange { - return [(id)self.editorTextView layoutManager:layoutManager - shouldUseTemporaryAttributes:attrs - forDrawingToScreen:toScreen - atCharacterIndex:charIndex - effectiveRange:effectiveCharRange]; + return [self.editorTextView.layoutManager.delegate layoutManager:layoutManager + shouldUseTemporaryAttributes:attrs + forDrawingToScreen:toScreen + atCharacterIndex:charIndex + effectiveRange:effectiveCharRange]; } #pragma mark - Navigation diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index e500118..d0c5d30 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -27,6 +27,7 @@ A2E4D43F-41F4-4FB9-BB94-7177011C9AED 63FC1C47-140D-42B0-BB4D-A10B2D225574 37B30044-3B14-46BA-ABAA-F01000C27B63 + AD68E85B-441B-4301-B564-A45E4919A6AD NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 671d99a..d9689b4 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -21,18 +21,20 @@ NSString * const SCXodeMinimapIsInitiallyHidden = @"SCXodeMinimapIsInitiallyHidden"; +static const CGFloat kDefaultUpdateInterval = 0.25f; + @implementation SCXcodeMinimap static SCXcodeMinimap *sharedMinimap = nil; + (void)pluginDidLoad:(NSBundle *)plugin { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedMinimap = [[self alloc] init]; - }); + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedMinimap = [[self alloc] init]; + }); } - (id)init { - if (self = [super init]) { + if (self = [super init]) { [self createMenuItem]; @@ -40,7 +42,7 @@ - (id)init { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDocumentDidChange:) name:IDEEditorDocumentDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onCodeEditorBoundsChange:) name:IDESourceCodeEditorTextViewBoundsDidChangeNotification object:nil]; } - return self; + return self; } - (void)createMenuItem @@ -94,7 +96,9 @@ - (void)showMiniMap:(NSMenuItem *)sender - (void)onDocumentDidChange:(NSNotification*)sender { SCMiniMapView *miniMapView = objc_getAssociatedObject([sender object], &kKeyMiniMapView); - [miniMapView updateTextView]; + + [NSObject cancelPreviousPerformRequestsWithTarget:miniMapView selector:@selector(updateTextView) object:nil]; + [miniMapView performSelector:@selector(updateTextView) withObject:nil afterDelay:kDefaultUpdateInterval]; } - (void)onCodeEditorBoundsChange:(NSNotification*)sender From 6c988f05f8578e90da1a6317095490b83441b6ec Mon Sep 17 00:00:00 2001 From: Stanislav Goncharov Date: Sat, 20 Sep 2014 15:35:55 +0400 Subject: [PATCH 18/96] Added UUID for Xcode 6.0.1 --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index d0c5d30..46d9ad5 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -24,6 +24,7 @@ 1 DVTPlugInCompatibilityUUIDs + C4A681B0-4A26-480E-93EC-1218098B9AA0 A2E4D43F-41F4-4FB9-BB94-7177011C9AED 63FC1C47-140D-42B0-BB4D-A10B2D225574 37B30044-3B14-46BA-ABAA-F01000C27B63 From 1a2221fd0fd87f1f9d51797959f412b1069e29ab Mon Sep 17 00:00:00 2001 From: Ellen Shapiro Date: Tue, 11 Nov 2014 22:05:01 -0600 Subject: [PATCH 19/96] Add delay multiplier based on length of file. --- SCXcodeMinimap/SCMiniMapView.h | 2 + SCXcodeMinimap/SCMiniMapView.m | 67 ++++++++++++++++++++++----------- SCXcodeMinimap/SCXcodeMinimap.m | 6 ++- 3 files changed, 53 insertions(+), 22 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.h b/SCXcodeMinimap/SCMiniMapView.h index 31cee90..d9ec0c1 100644 --- a/SCXcodeMinimap/SCMiniMapView.h +++ b/SCXcodeMinimap/SCMiniMapView.h @@ -19,6 +19,8 @@ extern const CGFloat kDefaultZoomLevel; @property (nonatomic, weak) NSScrollView *editorScrollView; @property (nonatomic, strong) NSTextView *editorTextView; +@property (nonatomic, readonly) NSInteger lastCalculatedLines; + - (void)updateTextView; - (void)updateSelectionView; diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index 9c73592..f5dcf16 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -18,6 +18,7 @@ @interface SCMiniMapView () @property (nonatomic, strong) NSColor *backgroundColor; @property (nonatomic, strong) NSFont *font; +@property (nonatomic, readwrite) NSInteger lastCalculatedLines; @end @@ -185,29 +186,53 @@ - (void)updateTextView return; } - NSMutableAttributedString *mutableAttributedString = [self.editorTextView.textStorage mutableCopy]; + typeof(self) __weak weakSelf = self; + NSOperationQueue *background = [[NSOperationQueue alloc] init]; - if(mutableAttributedString.length == 0) { - return; - } - - __block NSMutableParagraphStyle *style; - - [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName - inRange:NSMakeRange(0, mutableAttributedString.length) - options:0 - usingBlock:^(id value, NSRange range, BOOL *stop) { - style = [value mutableCopy]; - *stop = YES; - }]; - - - [style setTabStops:@[]]; - [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; - - [mutableAttributedString setAttributes:@{NSFontAttributeName: self.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)]; + //Run the attributed strings operation on a background thread + [background addOperationWithBlock:^{ + NSMutableAttributedString *mutableAttributedString = [self.editorTextView.textStorage mutableCopy]; + + if(mutableAttributedString.length == 0) { + //Nothing to do here. + weakSelf.lastCalculatedLines = 0; + return; + } + + __block NSMutableParagraphStyle *style; + + [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName + inRange:NSMakeRange(0, mutableAttributedString.length) + options:0 + usingBlock:^(id value, NSRange range, BOOL *stop) { + style = [value mutableCopy]; + *stop = YES; + }]; + + + [style setTabStops:@[]]; + [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; + + [mutableAttributedString setAttributes:@{NSFontAttributeName: weakSelf.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)]; + + //Send the text storage update off to the main thread + [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + [weakSelf.textView.textStorage setAttributedString:mutableAttributedString]; + + }]; + + //Now that we've sent that off, let's see how many lines we have while + //we're in here: + [weakSelf calculateLinesFromString:[mutableAttributedString string]]; + }]; +} + +- (void)calculateLinesFromString:(NSString *)string +{ + NSArray *lines = [string componentsSeparatedByString:@"\n"]; - [self.textView.textStorage setAttributedString:mutableAttributedString]; + //Cache the last calculated lines so we can figure out how long we should take to render this minimap. + self.lastCalculatedLines = lines.count; } - (void)resizeWithOldSuperviewSize:(NSSize)oldSize diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index d9689b4..a7b854e 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -97,8 +97,12 @@ - (void)onDocumentDidChange:(NSNotification*)sender { SCMiniMapView *miniMapView = objc_getAssociatedObject([sender object], &kKeyMiniMapView); + //150 lines per multiplier means a 1500 line file should have a delay of 2.5 seconds. + CGFloat multiplier = ceilf((CGFloat)miniMapView.lastCalculatedLines / 150.0f); + NSTimeInterval updateInterval = (CGFloat)multiplier * kDefaultUpdateInterval; + [NSObject cancelPreviousPerformRequestsWithTarget:miniMapView selector:@selector(updateTextView) object:nil]; - [miniMapView performSelector:@selector(updateTextView) withObject:nil afterDelay:kDefaultUpdateInterval]; + [miniMapView performSelector:@selector(updateTextView) withObject:nil afterDelay:updateInterval]; } - (void)onCodeEditorBoundsChange:(NSNotification*)sender From 2521609a6657b63c4fe4f4b636aff6fcb478b7ec Mon Sep 17 00:00:00 2001 From: Ellen Shapiro Date: Tue, 11 Nov 2014 22:33:57 -0600 Subject: [PATCH 20/96] Better line length calculation, better selection view updating. --- SCXcodeMinimap/SCMiniMapView.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index f5dcf16..e7d5a77 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -218,7 +218,7 @@ - (void)updateTextView //Send the text storage update off to the main thread [[NSOperationQueue mainQueue] addOperationWithBlock:^{ [weakSelf.textView.textStorage setAttributedString:mutableAttributedString]; - + [weakSelf updateSelectionView]; }]; //Now that we've sent that off, let's see how many lines we have while @@ -229,10 +229,14 @@ - (void)updateTextView - (void)calculateLinesFromString:(NSString *)string { - NSArray *lines = [string componentsSeparatedByString:@"\n"]; + NSUInteger stringLength = [string length]; + NSInteger numberOfLines = 0; + for (NSInteger index = 0; index < stringLength; numberOfLines++) { + index = NSMaxRange([string lineRangeForRange:NSMakeRange(index, 0)]); + } //Cache the last calculated lines so we can figure out how long we should take to render this minimap. - self.lastCalculatedLines = lines.count; + self.lastCalculatedLines = numberOfLines; } - (void)resizeWithOldSuperviewSize:(NSSize)oldSize From 0327f23c4bf602e5c2f532718353fddeb0290743 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 14 Nov 2014 14:58:06 +0000 Subject: [PATCH 21/96] Various tweaks. --- SCXcodeMinimap/SCMiniMapView.h | 2 +- SCXcodeMinimap/SCMiniMapView.m | 25 ++++++++++--------------- SCXcodeMinimap/SCXcodeMinimap.m | 2 +- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/SCXcodeMinimap/SCMiniMapView.h b/SCXcodeMinimap/SCMiniMapView.h index d9ec0c1..8e3181f 100644 --- a/SCXcodeMinimap/SCMiniMapView.h +++ b/SCXcodeMinimap/SCMiniMapView.h @@ -19,7 +19,7 @@ extern const CGFloat kDefaultZoomLevel; @property (nonatomic, weak) NSScrollView *editorScrollView; @property (nonatomic, strong) NSTextView *editorTextView; -@property (nonatomic, readonly) NSInteger lastCalculatedLines; +@property (nonatomic, readonly) NSInteger numberOfLines; - (void)updateTextView; - (void)updateSelectionView; diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m index e7d5a77..0cccc19 100644 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -18,7 +18,7 @@ @interface SCMiniMapView () @property (nonatomic, strong) NSColor *backgroundColor; @property (nonatomic, strong) NSFont *font; -@property (nonatomic, readwrite) NSInteger lastCalculatedLines; +@property (nonatomic, assign) NSInteger numberOfLines; @end @@ -187,15 +187,12 @@ - (void)updateTextView } typeof(self) __weak weakSelf = self; - NSOperationQueue *background = [[NSOperationQueue alloc] init]; - - //Run the attributed strings operation on a background thread - [background addOperationWithBlock:^{ + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ NSMutableAttributedString *mutableAttributedString = [self.editorTextView.textStorage mutableCopy]; if(mutableAttributedString.length == 0) { //Nothing to do here. - weakSelf.lastCalculatedLines = 0; + weakSelf.numberOfLines = 0; return; } @@ -216,27 +213,25 @@ - (void)updateTextView [mutableAttributedString setAttributes:@{NSFontAttributeName: weakSelf.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)]; //Send the text storage update off to the main thread - [[NSOperationQueue mainQueue] addOperationWithBlock:^{ + dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf.textView.textStorage setAttributedString:mutableAttributedString]; [weakSelf updateSelectionView]; - }]; + }); - //Now that we've sent that off, let's see how many lines we have while - //we're in here: + //Calculate the total number of lines [weakSelf calculateLinesFromString:[mutableAttributedString string]]; - }]; + }); } - (void)calculateLinesFromString:(NSString *)string { - NSUInteger stringLength = [string length]; - NSInteger numberOfLines = 0; - for (NSInteger index = 0; index < stringLength; numberOfLines++) { + NSInteger count = 0; + for (NSInteger index = 0; index < [string length]; count++) { index = NSMaxRange([string lineRangeForRange:NSMakeRange(index, 0)]); } //Cache the last calculated lines so we can figure out how long we should take to render this minimap. - self.lastCalculatedLines = numberOfLines; + self.numberOfLines = count; } - (void)resizeWithOldSuperviewSize:(NSSize)oldSize diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index a7b854e..f9bdcec 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -98,7 +98,7 @@ - (void)onDocumentDidChange:(NSNotification*)sender SCMiniMapView *miniMapView = objc_getAssociatedObject([sender object], &kKeyMiniMapView); //150 lines per multiplier means a 1500 line file should have a delay of 2.5 seconds. - CGFloat multiplier = ceilf((CGFloat)miniMapView.lastCalculatedLines / 150.0f); + CGFloat multiplier = ceilf((CGFloat)miniMapView.numberOfLines / 150.0f); NSTimeInterval updateInterval = (CGFloat)multiplier * kDefaultUpdateInterval; [NSObject cancelPreviousPerformRequestsWithTarget:miniMapView selector:@selector(updateTextView) object:nil]; From f34cd2abd8b500857dc0a91eed8c89758d242229 Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Tue, 6 Jan 2015 08:54:23 +0100 Subject: [PATCH 22/96] Add support for Xcode 6.2 --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 46d9ad5..676307b 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -29,6 +29,7 @@ 63FC1C47-140D-42B0-BB4D-A10B2D225574 37B30044-3B14-46BA-ABAA-F01000C27B63 AD68E85B-441B-4301-B564-A45E4919A6AD + FEC992CC-CA4A-4CFD-8881-77300FCB848A NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. From 9c027b65f29d822af5d918663afe865775b29c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=CC=81rio=20Barbosa?= Date: Sun, 18 Jan 2015 00:33:49 +0000 Subject: [PATCH 23/96] =?UTF-8?q?Highlighting=20key=20code=20blocks=20for?= =?UTF-8?q?=20better=20orientation=E2=80=A8Supporting,=20#pragma,=20#impor?= =?UTF-8?q?t,=20line=20comment=20and=20block=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SCXcodeMinimap/SCMiniMapView.m | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) mode change 100644 => 100755 SCXcodeMinimap/SCMiniMapView.m diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m old mode 100644 new mode 100755 index 0cccc19..a642bf0 --- a/SCXcodeMinimap/SCMiniMapView.m +++ b/SCXcodeMinimap/SCMiniMapView.m @@ -206,11 +206,17 @@ - (void)updateTextView *stop = YES; }]; + [weakSelf highlightMutableAttributedString:mutableAttributedString withPattern:@"^(#import.*\n)" color:[NSColor brownColor]]; + [weakSelf highlightMutableAttributedString:mutableAttributedString withPattern:@"^(#pragma mark.+\n)" color:[NSColor brownColor]]; + [weakSelf highlightMutableAttributedString:mutableAttributedString withPattern:@"^(//.*\n)" color:[NSColor greenColor]]; + [weakSelf highlightMutableAttributedString:mutableAttributedString withPattern:@"^(/\\*(?>(?:(?>[^*]+)|\\*(?!/))*)\\*/\n)" color:[NSColor greenColor]]; [style setTabStops:@[]]; [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; - [mutableAttributedString setAttributes:@{NSFontAttributeName: weakSelf.font, NSParagraphStyleAttributeName : style} range:NSMakeRange(0, mutableAttributedString.length)]; + [mutableAttributedString addAttribute:NSFontAttributeName value:weakSelf.font range:NSMakeRange(0, mutableAttributedString.length)]; + [mutableAttributedString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, mutableAttributedString.length)]; + //Send the text storage update off to the main thread dispatch_async(dispatch_get_main_queue(), ^{ @@ -223,6 +229,21 @@ - (void)updateTextView }); } +- (void)highlightMutableAttributedString:(NSMutableAttributedString *)attributedString withPattern:(NSString *)pattern color:(NSColor *)color +{ + NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern + options:NSRegularExpressionCaseInsensitive|NSRegularExpressionAnchorsMatchLines error:nil]; + + [regex enumerateMatchesInString:[attributedString string] + options:0 + range:NSMakeRange(0, attributedString.length) + usingBlock:^(NSTextCheckingResult *match, NSMatchingFlags flags, BOOL *stop) + { + [attributedString addAttribute:NSBackgroundColorAttributeName value:color?:color range:[match rangeAtIndex:1]]; + }]; + +} + - (void)calculateLinesFromString:(NSString *)string { NSInteger count = 0; From f07321b0c31f2110621bb28631393ed795b71c53 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 24 Jan 2015 17:45:51 +0000 Subject: [PATCH 24/96] Cleanup for v2.0 - added Xcode headers and frameworks - switched from modifying attributed strings to scroll view magnfication - removed unused methods - renamed classes, methods and notifications - rewrote navigation methods --- SCXcodeMinimap.xcodeproj/project.pbxproj | 100 +- SCXcodeMinimap/SCMiniMapView.h | 30 - SCXcodeMinimap/SCMiniMapView.m | 393 ---- SCXcodeMinimap/SCSelectionView.h | 16 - SCXcodeMinimap/SCSelectionView.m | 72 - SCXcodeMinimap/SCXcodeMinimap.h | 4 +- SCXcodeMinimap/SCXcodeMinimap.m | 126 +- SCXcodeMinimap/SCXcodeMinimapSelectionView.h | 16 + SCXcodeMinimap/SCXcodeMinimapSelectionView.m | 65 + SCXcodeMinimap/SCXcodeMinimapView.h | 26 + SCXcodeMinimap/SCXcodeMinimapView.m | 194 ++ SCXcodeMinimap/ShitFile.h | 1607 +++++++++++++++++ .../Xcode Headers/DVTCompletingTextView.h | 123 ++ .../Xcode Headers/DVTFontAndColorTheme.h | 142 ++ .../Xcode Headers/DVTInvalidation-Protocol.h | 18 + .../Xcode Headers/DVTPointerArray.h | 38 + .../Xcode Headers/DVTPreferenceSet-Protocol.h | 34 + .../DVTSourceLanguageSourceModelService.h | 15 + SCXcodeMinimap/Xcode Headers/DVTSourceModel.h | 92 + .../Xcode Headers/DVTSourceModelItem.h | 99 + .../Xcode Headers/DVTSourceNodeTypes.h | 18 + .../Xcode Headers/DVTSourceTextView.h | 348 ++++ SCXcodeMinimap/Xcode Headers/DVTTextStorage.h | 24 + .../Xcode Headers/DVTViewController.h | 50 + SCXcodeMinimap/Xcode Headers/IDEEditor.h | 54 + .../Xcode Headers/IDESourceCodeEditor.h | 283 +++ .../IDESourceCodeEditorContainerView.h | 27 + .../Xcode Headers/IDEViewController.h | 39 + 28 files changed, 3447 insertions(+), 606 deletions(-) delete mode 100644 SCXcodeMinimap/SCMiniMapView.h delete mode 100755 SCXcodeMinimap/SCMiniMapView.m delete mode 100644 SCXcodeMinimap/SCSelectionView.h delete mode 100644 SCXcodeMinimap/SCSelectionView.m create mode 100644 SCXcodeMinimap/SCXcodeMinimapSelectionView.h create mode 100644 SCXcodeMinimap/SCXcodeMinimapSelectionView.m create mode 100644 SCXcodeMinimap/SCXcodeMinimapView.h create mode 100644 SCXcodeMinimap/SCXcodeMinimapView.m create mode 100644 SCXcodeMinimap/ShitFile.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTCompletingTextView.h create mode 100755 SCXcodeMinimap/Xcode Headers/DVTFontAndColorTheme.h create mode 100755 SCXcodeMinimap/Xcode Headers/DVTInvalidation-Protocol.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTPointerArray.h create mode 100755 SCXcodeMinimap/Xcode Headers/DVTPreferenceSet-Protocol.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTSourceLanguageSourceModelService.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTSourceModel.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTSourceModelItem.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTSourceNodeTypes.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTTextStorage.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTViewController.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEEditor.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDESourceCodeEditor.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDESourceCodeEditorContainerView.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEViewController.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index a7ef96e..f4d8fbd 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -7,16 +7,43 @@ objects = { /* Begin PBXBuildFile section */ - 18D2B13117244C0A0026D09F /* SCSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 18D2B13017244C0A0026D09F /* SCSelectionView.m */; }; + 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */; }; + 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */; }; + 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 184C118E1A741136002A7C65 /* DVTFoundation.framework */; }; + 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 188308091A7411830005DF40 /* DVTKit.framework */; }; + 1883080C1A7411930005DF40 /* IDESourceEditor.ideplugin in Resources */ = {isa = PBXBuildFile; fileRef = 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */; }; + 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 1883080F1A7411A70005DF40 /* IDESourceEditor */; }; 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18FE09B51707639E00118FEB /* Cocoa.framework */; }; 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */; }; 8742532317307161001C947C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8742532217307161001C947C /* QuartzCore.framework */; }; - B25F211C172FE208001A9E6E /* SCMiniMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = B25F211B172FE208001A9E6E /* SCMiniMapView.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 18D2B12F17244C0A0026D09F /* SCSelectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCSelectionView.h; sourceTree = ""; }; - 18D2B13017244C0A0026D09F /* SCSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCSelectionView.m; sourceTree = ""; }; + 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTCompletingTextView.h; sourceTree = ""; }; + 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFontAndColorTheme.h; sourceTree = ""; }; + 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTInvalidation-Protocol.h"; sourceTree = ""; }; + 184C11741A740F8A002A7C65 /* DVTPointerArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTPointerArray.h; sourceTree = ""; }; + 184C11751A740F8A002A7C65 /* DVTPreferenceSet-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTPreferenceSet-Protocol.h"; sourceTree = ""; }; + 184C11761A740F8A002A7C65 /* DVTSourceLanguageSourceModelService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceLanguageSourceModelService.h; sourceTree = ""; }; + 184C11771A740F8A002A7C65 /* DVTSourceModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceModel.h; sourceTree = ""; }; + 184C11781A740F8A002A7C65 /* DVTSourceModelItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceModelItem.h; sourceTree = ""; }; + 184C11791A740F8A002A7C65 /* DVTSourceNodeTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceNodeTypes.h; sourceTree = ""; }; + 184C117A1A740F8A002A7C65 /* DVTSourceTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceTextView.h; sourceTree = ""; }; + 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTTextStorage.h; sourceTree = ""; }; + 184C117C1A740F8A002A7C65 /* DVTViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTViewController.h; sourceTree = ""; }; + 184C117D1A740F8A002A7C65 /* IDEEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEEditor.h; sourceTree = ""; }; + 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDESourceCodeEditor.h; sourceTree = ""; }; + 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDESourceCodeEditorContainerView.h; sourceTree = ""; }; + 184C11801A740F8A002A7C65 /* IDEViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEViewController.h; sourceTree = ""; }; + 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapSelectionView.h; sourceTree = ""; }; + 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapSelectionView.m; sourceTree = ""; }; + 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapView.h; sourceTree = ""; }; + 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapView.m; sourceTree = ""; }; + 184C11851A740F97002A7C65 /* ShitFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShitFile.h; sourceTree = ""; }; + 184C118E1A741136002A7C65 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; + 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; + 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDESourceEditor.ideplugin; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin; sourceTree = ""; }; + 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 18FE09B51707639E00118FEB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 18FE09B81707639E00118FEB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -27,8 +54,6 @@ 18FE09C7170764E400118FEB /* SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimap.h; sourceTree = ""; }; 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimap.m; sourceTree = ""; }; 8742532217307161001C947C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - B25F211A172FE208001A9E6E /* SCMiniMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCMiniMapView.h; sourceTree = ""; }; - B25F211B172FE208001A9E6E /* SCMiniMapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCMiniMapView.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -36,7 +61,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */, + 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */, 8742532317307161001C947C /* QuartzCore.framework in Frameworks */, + 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */, 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -44,6 +72,29 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 184C11701A740F8A002A7C65 /* Xcode Headers */ = { + isa = PBXGroup; + children = ( + 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */, + 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */, + 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */, + 184C11741A740F8A002A7C65 /* DVTPointerArray.h */, + 184C11751A740F8A002A7C65 /* DVTPreferenceSet-Protocol.h */, + 184C11761A740F8A002A7C65 /* DVTSourceLanguageSourceModelService.h */, + 184C11771A740F8A002A7C65 /* DVTSourceModel.h */, + 184C11781A740F8A002A7C65 /* DVTSourceModelItem.h */, + 184C11791A740F8A002A7C65 /* DVTSourceNodeTypes.h */, + 184C117A1A740F8A002A7C65 /* DVTSourceTextView.h */, + 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */, + 184C117C1A740F8A002A7C65 /* DVTViewController.h */, + 184C117D1A740F8A002A7C65 /* IDEEditor.h */, + 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, + 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */, + 184C11801A740F8A002A7C65 /* IDEViewController.h */, + ); + path = "Xcode Headers"; + sourceTree = ""; + }; 18FE09A91707639E00118FEB = { isa = PBXGroup; children = ( @@ -65,6 +116,10 @@ isa = PBXGroup; children = ( 18FE09B51707639E00118FEB /* Cocoa.framework */, + 184C118E1A741136002A7C65 /* DVTFoundation.framework */, + 188308091A7411830005DF40 /* DVTKit.framework */, + 1883080F1A7411A70005DF40 /* IDESourceEditor */, + 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */, 18FE09B71707639E00118FEB /* Other Frameworks */, ); name = Frameworks; @@ -86,11 +141,13 @@ children = ( 18FE09C7170764E400118FEB /* SCXcodeMinimap.h */, 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */, - B25F211A172FE208001A9E6E /* SCMiniMapView.h */, - B25F211B172FE208001A9E6E /* SCMiniMapView.m */, - 18D2B12F17244C0A0026D09F /* SCSelectionView.h */, - 18D2B13017244C0A0026D09F /* SCSelectionView.m */, + 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, + 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, + 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */, + 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */, + 184C11851A740F97002A7C65 /* ShitFile.h */, 18FE09BC1707639E00118FEB /* Supporting Files */, + 184C11701A740F8A002A7C65 /* Xcode Headers */, ); path = SCXcodeMinimap; sourceTree = ""; @@ -155,6 +212,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 1883080C1A7411930005DF40 /* IDESourceEditor.ideplugin in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -166,8 +224,8 @@ buildActionMask = 2147483647; files = ( 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */, - 18D2B13117244C0A0026D09F /* SCSelectionView.m in Sources */, - B25F211C172FE208001A9E6E /* SCMiniMapView.m in Sources */, + 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, + 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -236,11 +294,20 @@ COMBINE_HIDPI_IMAGES = YES; DEPLOYMENT_LOCATION = YES; DSTROOT = "$(HOME)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", + ); GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SCXcodeMinimap/SCXcodeMinimap-Prefix.pch"; INFOPLIST_FILE = "SCXcodeMinimap/SCXcodeMinimap-Info.plist"; INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", + ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; }; @@ -253,11 +320,20 @@ COMBINE_HIDPI_IMAGES = YES; DEPLOYMENT_LOCATION = YES; DSTROOT = "$(HOME)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", + ); GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "SCXcodeMinimap/SCXcodeMinimap-Prefix.pch"; INFOPLIST_FILE = "SCXcodeMinimap/SCXcodeMinimap-Info.plist"; INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", + ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; }; diff --git a/SCXcodeMinimap/SCMiniMapView.h b/SCXcodeMinimap/SCMiniMapView.h deleted file mode 100644 index 8e3181f..0000000 --- a/SCXcodeMinimap/SCMiniMapView.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// SCMiniMapView.h -// SCXcodeMinimap -// -// Created by Jérôme ALVES on 30/04/13. -// Copyright (c) 2013 Stefan Ceriu. All rights reserved. -// - -#import -#import "SCSelectionView.h" - -extern const CGFloat kDefaultZoomLevel; - -@interface SCMiniMapView : NSScrollView - -@property (nonatomic, strong) NSTextView *textView; -@property (nonatomic, strong) SCSelectionView *selectionView; - -@property (nonatomic, weak) NSScrollView *editorScrollView; -@property (nonatomic, strong) NSTextView *editorTextView; - -@property (nonatomic, readonly) NSInteger numberOfLines; - -- (void)updateTextView; -- (void)updateSelectionView; - -- (void) show; -- (void) hide; - -@end diff --git a/SCXcodeMinimap/SCMiniMapView.m b/SCXcodeMinimap/SCMiniMapView.m deleted file mode 100755 index a642bf0..0000000 --- a/SCXcodeMinimap/SCMiniMapView.m +++ /dev/null @@ -1,393 +0,0 @@ -// -// SCMiniMapView.m -// SCXcodeMinimap -// -// Created by Jérôme ALVES on 30/04/13. -// Copyright (c) 2013 Stefan Ceriu. All rights reserved. -// - -#import "SCMiniMapView.h" -#import "SCXcodeMinimap.h" - -const CGFloat kDefaultZoomLevel = 0.1f; -static const CGFloat kDefaultShadowLevel = 0.1f; - -static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; - -@interface SCMiniMapView () - -@property (nonatomic, strong) NSColor *backgroundColor; -@property (nonatomic, strong) NSFont *font; -@property (nonatomic, assign) NSInteger numberOfLines; - -@end - -@implementation SCMiniMapView -@synthesize backgroundColor = _backgroundColor; - -- (void)dealloc -{ - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (id)initWithFrame:(NSRect)frame -{ - if (self = [super initWithFrame:frame]) - { - /* Configure ScrollView */ - [self setWantsLayer:YES]; - [self setAutoresizingMask: NSViewMinXMargin | NSViewHeightSizable]; - [self setDrawsBackground:NO]; - [self setHorizontalScrollElasticity:NSScrollElasticityNone]; - [self setVerticalScrollElasticity:NSScrollElasticityNone]; - - /* Subscribe to show/hide notifications */ - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(show) - name:SCXodeMinimapWantsToBeShownNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(hide) - name:SCXodeMinimapWantsToBeHiddenNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(updateTheme) - name:DVTFontAndColorSourceTextSettingsChangedNotification - object:nil]; - } - return self; -} - -#pragma mark - Lazy Initialization - -- (NSTextView *)textView -{ - if (_textView == nil) { - _textView = [[NSClassFromString(@"DVTSourceTextView") alloc] initWithFrame:self.bounds]; - - [_textView setBackgroundColor:[NSColor clearColor]]; - - [_textView.textContainer setLineFragmentPadding:0.0f]; - - [_textView setAllowsUndo:NO]; - [_textView setAllowsImageEditing:NO]; - [_textView setAutomaticDashSubstitutionEnabled:NO]; - [_textView setAutomaticDataDetectionEnabled:NO]; - [_textView setAutomaticLinkDetectionEnabled:NO]; - [_textView setAutomaticQuoteSubstitutionEnabled:NO]; - [_textView setAutomaticSpellingCorrectionEnabled:NO]; - [_textView setAutomaticTextReplacementEnabled:NO]; - [_textView setContinuousSpellCheckingEnabled:NO]; - [_textView setDisplaysLinkToolTips:NO]; - [_textView setEditable:NO]; - [_textView setRichText:YES]; - [_textView setSelectable:NO]; - - [self setDocumentView:_textView]; - - [self updateTheme]; - - [[NSNotificationCenter defaultCenter] removeObserver:_textView name:DVTFontAndColorSourceTextSettingsChangedNotification object:nil]; - } - - [_textView.layoutManager setDelegate:self]; - - return _textView; -} - -- (SCSelectionView *)selectionView -{ - if (_selectionView == nil) { - _selectionView = [[SCSelectionView alloc] init]; - //[_selectionView setShouldInverseColors:YES]; - [self.textView addSubview:_selectionView]; - } - - return _selectionView; -} - -- (NSFont *)font -{ - if(_font == nil) { - _font = [NSFont fontWithName:@"Menlo" size:11 * kDefaultZoomLevel]; - - Class DVTFontAndColorThemeClass = NSClassFromString(@"DVTFontAndColorTheme"); - if([DVTFontAndColorThemeClass respondsToSelector:@selector(currentTheme)]) { - - NSObject *theme = [DVTFontAndColorThemeClass performSelector:@selector(currentTheme)]; - if([theme respondsToSelector:@selector(sourcePlainTextFont)]) { - NSFont *themeFont = [theme performSelector:@selector(sourcePlainTextFont)]; - self.font = [NSFont fontWithName:themeFont.familyName size:themeFont.pointSize * kDefaultZoomLevel]; - } - } - } - - return _font; -} - -- (NSColor *)backgroundColor -{ - if(_backgroundColor == nil) { - _backgroundColor = [[NSColor clearColor] shadowWithLevel:kDefaultShadowLevel]; - - Class DVTFontAndColorThemeClass = NSClassFromString(@"DVTFontAndColorTheme"); - if([DVTFontAndColorThemeClass respondsToSelector:@selector(currentTheme)]) { - - NSObject *theme = [DVTFontAndColorThemeClass performSelector:@selector(currentTheme)]; - if([theme respondsToSelector:@selector(sourceTextBackgroundColor)]) { - NSColor *themeBackgroundColor = [theme performSelector:@selector(sourceTextBackgroundColor)]; - self.backgroundColor = [themeBackgroundColor shadowWithLevel:kDefaultShadowLevel]; - } - } - } - - return _backgroundColor; -} - -#pragma mark - Show/Hide - -- (void)show -{ - self.hidden = NO; - - NSRect editorTextViewFrame = self.editorScrollView.frame; - editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width - self.bounds.size.width; - self.editorScrollView.frame = editorTextViewFrame; - - [self updateTextView]; - [self updateSelectionView]; -} - -- (void)hide -{ - self.hidden = YES; - - NSRect editorTextViewFrame = self.editorScrollView.frame; - editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width; - self.editorScrollView.frame = editorTextViewFrame; -} - -#pragma mark - Updating - -- (void)updateTheme -{ - [self setFont:nil]; - - [self setBackgroundColor:nil]; - [self.selectionView setSelectionColor:nil]; - [self.textView setBackgroundColor:self.backgroundColor]; -} - -- (void)updateTextView -{ - if ([self isHidden]) { - return; - } - - typeof(self) __weak weakSelf = self; - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ - NSMutableAttributedString *mutableAttributedString = [self.editorTextView.textStorage mutableCopy]; - - if(mutableAttributedString.length == 0) { - //Nothing to do here. - weakSelf.numberOfLines = 0; - return; - } - - __block NSMutableParagraphStyle *style; - - [mutableAttributedString enumerateAttribute:NSParagraphStyleAttributeName - inRange:NSMakeRange(0, mutableAttributedString.length) - options:0 - usingBlock:^(id value, NSRange range, BOOL *stop) { - style = [value mutableCopy]; - *stop = YES; - }]; - - [weakSelf highlightMutableAttributedString:mutableAttributedString withPattern:@"^(#import.*\n)" color:[NSColor brownColor]]; - [weakSelf highlightMutableAttributedString:mutableAttributedString withPattern:@"^(#pragma mark.+\n)" color:[NSColor brownColor]]; - [weakSelf highlightMutableAttributedString:mutableAttributedString withPattern:@"^(//.*\n)" color:[NSColor greenColor]]; - [weakSelf highlightMutableAttributedString:mutableAttributedString withPattern:@"^(/\\*(?>(?:(?>[^*]+)|\\*(?!/))*)\\*/\n)" color:[NSColor greenColor]]; - - [style setTabStops:@[]]; - [style setDefaultTabInterval:style.defaultTabInterval * kDefaultZoomLevel]; - - [mutableAttributedString addAttribute:NSFontAttributeName value:weakSelf.font range:NSMakeRange(0, mutableAttributedString.length)]; - [mutableAttributedString addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, mutableAttributedString.length)]; - - - //Send the text storage update off to the main thread - dispatch_async(dispatch_get_main_queue(), ^{ - [weakSelf.textView.textStorage setAttributedString:mutableAttributedString]; - [weakSelf updateSelectionView]; - }); - - //Calculate the total number of lines - [weakSelf calculateLinesFromString:[mutableAttributedString string]]; - }); -} - -- (void)highlightMutableAttributedString:(NSMutableAttributedString *)attributedString withPattern:(NSString *)pattern color:(NSColor *)color -{ - NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern - options:NSRegularExpressionCaseInsensitive|NSRegularExpressionAnchorsMatchLines error:nil]; - - [regex enumerateMatchesInString:[attributedString string] - options:0 - range:NSMakeRange(0, attributedString.length) - usingBlock:^(NSTextCheckingResult *match, NSMatchingFlags flags, BOOL *stop) - { - [attributedString addAttribute:NSBackgroundColorAttributeName value:color?:color range:[match rangeAtIndex:1]]; - }]; - -} - -- (void)calculateLinesFromString:(NSString *)string -{ - NSInteger count = 0; - for (NSInteger index = 0; index < [string length]; count++) { - index = NSMaxRange([string lineRangeForRange:NSMakeRange(index, 0)]); - } - - //Cache the last calculated lines so we can figure out how long we should take to render this minimap. - self.numberOfLines = count; -} - -- (void)resizeWithOldSuperviewSize:(NSSize)oldSize -{ - [super resizeWithOldSuperviewSize:oldSize]; - [self updateSelectionView]; -} - -- (void)updateSelectionView -{ - if ([self isHidden]) { - return; - } - - NSRect selectionViewFrame = NSMakeRect(0, - 0, - self.bounds.size.width, - self.editorScrollView.visibleRect.size.height * kDefaultZoomLevel); - - - CGFloat editorContentHeight = [self.editorScrollView.documentView frame].size.height - self.editorScrollView.bounds.size.height; - - if(editorContentHeight == 0) { - selectionViewFrame.origin.y = 0; - } - else { - CGFloat ratio = ([self.documentView frame].size.height - self.bounds.size.height) / editorContentHeight; - [self.contentView scrollToPoint:NSMakePoint(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio))]; - - CGFloat textHeight = [self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer].size.height; - ratio = (textHeight - self.selectionView.bounds.size.height) / editorContentHeight; - selectionViewFrame.origin.y = self.editorScrollView.contentView.bounds.origin.y * ratio; - } - - [self.selectionView setFrame:selectionViewFrame]; -} - -#pragma mark - NSLayoutManagerDelegate - -- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinished -{ - if(layoutFinished) { - [self updateSelectionView]; - } -} - -- (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange -{ - return [self.editorTextView.layoutManager.delegate layoutManager:layoutManager - shouldUseTemporaryAttributes:attrs - forDrawingToScreen:toScreen - atCharacterIndex:charIndex - effectiveRange:effectiveCharRange]; -} - -#pragma mark - Navigation - -- (void)mouseUp:(NSEvent *)theEvent -{ - [super mouseUp:theEvent]; - [self handleMouseEvent:theEvent]; -} - -- (void)mouseDown:(NSEvent *)theEvent -{ - [super mouseDown:theEvent]; - [self handleMouseEvent:theEvent]; -} - -- (void)mouseDragged:(NSEvent *)theEvent -{ - [super mouseDragged:theEvent]; - [self handleMouseEvent:theEvent]; -} - -- (void) handleMouseEvent:(NSEvent *)theEvent -{ - static BOOL isDragging; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - isDragging = NO; - }); - - NSPoint locationInSelf = [self convertPoint:theEvent.locationInWindow fromView:nil]; - NSSize textSize = [self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer].size; - NSSize frameSize = self.frame.size; - - NSPoint point; - if (textSize.height < frameSize.height) { - point = NSMakePoint(locationInSelf.x / textSize.width, locationInSelf.y / textSize.height); - } - else { - point = NSMakePoint(locationInSelf.x / textSize.width, locationInSelf.y / frameSize.height); - } - - BOOL justStartDragging = NO; - if (theEvent.type == NSLeftMouseUp) { - isDragging = NO; - } - else { - justStartDragging = !isDragging; - isDragging = YES; - } - - [self goAtRelativePosition:point justStartDragging:justStartDragging]; -} - -- (void)goAtRelativePosition:(NSPoint)position justStartDragging:(BOOL)justStartDragging -{ - static CGFloat mouseDownOffset; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - mouseDownOffset = 0; - }); - - CGFloat documentHeight = [self.editorScrollView.documentView frame].size.height; - CGSize boundsSize = self.editorScrollView.bounds.size; - CGFloat maxOffset = documentHeight - boundsSize.height; - CGFloat locationInDocumentY = documentHeight * position.y; - - if (justStartDragging) { - mouseDownOffset = locationInDocumentY - - (self.editorScrollView.contentView.documentVisibleRect.origin.y + boundsSize.height/2.0); - } - - CGFloat offset; - if (fabs(mouseDownOffset) <= boundsSize.height/2.0) { - offset = floor(locationInDocumentY - boundsSize.height/2 - mouseDownOffset); - } - else { - offset = floor(locationInDocumentY - boundsSize.height/2); - } - offset = MIN(MAX(0, offset), maxOffset); - - [self.editorTextView scrollRectToVisible:NSMakeRect(0, offset, boundsSize.width, boundsSize.height)]; -} - -@end diff --git a/SCXcodeMinimap/SCSelectionView.h b/SCXcodeMinimap/SCSelectionView.h deleted file mode 100644 index 7c47c46..0000000 --- a/SCXcodeMinimap/SCSelectionView.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// SCSelectionView.h -// SCXcodeMinimap -// -// Created by Stefan Ceriu on 4/21/13. -// Copyright (c) 2013 Stefan Ceriu. All rights reserved. -// - -#import - -@interface SCSelectionView : NSView - -@property (nonatomic, strong) NSColor *selectionColor; -@property (nonatomic, assign) BOOL shouldInverseColors; - -@end diff --git a/SCXcodeMinimap/SCSelectionView.m b/SCXcodeMinimap/SCSelectionView.m deleted file mode 100644 index 885f7ae..0000000 --- a/SCXcodeMinimap/SCSelectionView.m +++ /dev/null @@ -1,72 +0,0 @@ -// -// SCSelectionView.m -// SCXcodeMinimap -// -// Created by Stefan Ceriu on 4/21/13. -// Copyright (c) 2013 Stefan Ceriu. All rights reserved. -// - -#import "SCSelectionView.h" - -@implementation SCSelectionView -@synthesize selectionColor = _selectionColor; - -- (void)drawRect:(NSRect)dirtyRect -{ - [[self selectionColor] setFill]; - NSRectFill(dirtyRect); -} - -- (NSColor *)selectionColor -{ - if(_selectionColor == nil) { - - _selectionColor = [NSColor colorWithDeviceRed:0.0f green:0.0f blue:0.0f alpha:0.3f]; - - Class DVTFontAndColorThemeClass = NSClassFromString(@"DVTFontAndColorTheme"); - - if([DVTFontAndColorThemeClass respondsToSelector:@selector(currentTheme)]) { - NSObject *theme = [DVTFontAndColorThemeClass performSelector:@selector(currentTheme)]; - - if([theme respondsToSelector:@selector(sourceTextBackgroundColor)]) { - NSColor *backgroundColor = [[theme performSelector:@selector(sourceTextBackgroundColor)] colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; - - if(self.shouldInverseColors) { - - _selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [backgroundColor redComponent]) - green:(1.0f - [backgroundColor greenComponent]) - blue:(1.0f - [backgroundColor blueComponent]) - alpha:0.3f]; - } else { - - _selectionColor = [NSColor colorWithCalibratedHue:0.0f - saturation:0.0f - brightness:(1.0f - [backgroundColor brightnessComponent]) - alpha:0.3f]; - } - } - } - } - - return _selectionColor; -} - -- (void)setSelectionColor:(NSColor *)selectionColor -{ - if([_selectionColor isEqual:selectionColor]) return; - - _selectionColor = selectionColor; - [self setNeedsDisplay:YES]; -} - -- (void)setShouldInverseColors:(BOOL)shouldInverseColors -{ - if(_shouldInverseColors == shouldInverseColors) { - return; - } - - _shouldInverseColors = shouldInverseColors; - _selectionColor = nil; -} - -@end diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index 70d24dc..f583f32 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -8,8 +8,8 @@ #import -extern NSString *const SCXodeMinimapWantsToBeShownNotification; -extern NSString *const SCXodeMinimapWantsToBeHiddenNotification; +extern NSString *const SCXodeMinimapShowNotification; +extern NSString *const SCXodeMinimapHideNotification; @interface SCXcodeMinimap : NSObject diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index f9bdcec..5da715c 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -6,45 +6,49 @@ // Copyright (c) 2013 Stefan Ceriu. All rights reserved // -#import "SCMiniMapView.h" #import "SCXcodeMinimap.h" +#import "SCXcodeMinimapView.h" #import -static char kKeyMiniMapView; +#import "IDESourceCodeEditor.h" +#import "DVTSourceTextView.h" + +static char kAssociatedObjectMinimapViewKey; static NSString * const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; static NSString * const IDEEditorDocumentDidChangeNotification = @"IDEEditorDocumentDidChangeNotification"; static NSString * const IDESourceCodeEditorTextViewBoundsDidChangeNotification = @"IDESourceCodeEditorTextViewBoundsDidChangeNotification"; -NSString * const SCXodeMinimapWantsToBeShownNotification = @"SCXodeMinimapWantsToBeShownNotification"; -NSString * const SCXodeMinimapWantsToBeHiddenNotification = @"SCXodeMinimapWantsToBeHiddenNotification"; +NSString * const SCXodeMinimapShowNotification = @"SCXodeMinimapShowNotification"; +NSString * const SCXodeMinimapHideNotification = @"SCXodeMinimapHideNotification"; NSString * const SCXodeMinimapIsInitiallyHidden = @"SCXodeMinimapIsInitiallyHidden"; -static const CGFloat kDefaultUpdateInterval = 0.25f; - @implementation SCXcodeMinimap -static SCXcodeMinimap *sharedMinimap = nil; -+ (void)pluginDidLoad:(NSBundle *)plugin { ++ (void)pluginDidLoad:(NSBundle *)plugin +{ + static SCXcodeMinimap *sharedMinimap = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedMinimap = [[self alloc] init]; }); } -- (id)init { +- (id)init +{ if (self = [super init]) { - + [self createMenuItem]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDidFinishSetup:) name:IDESourceCodeEditorDidFinishSetupNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDocumentDidChange:) name:IDEEditorDocumentDidChangeNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onCodeEditorBoundsChange:) name:IDESourceCodeEditorTextViewBoundsDidChangeNotification object:nil]; } return self; } +#pragma mark - Menu Items and Actions + - (void)createMenuItem { NSMenuItem *editMenuItem = [[NSApp mainMenu] itemWithTitle:@"View"]; @@ -77,95 +81,55 @@ - (void)hideMiniMap:(NSMenuItem *)sender { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:SCXodeMinimapIsInitiallyHidden]; - [sender setTitle:@"Show MiniMap"]; + [sender setTitle:@"Show Minimap"]; [sender setAction:@selector(showMiniMap:)]; - [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapWantsToBeHiddenNotification object:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapHideNotification object:nil]; } - (void)showMiniMap:(NSMenuItem *)sender { [[NSUserDefaults standardUserDefaults] setBool:NO forKey:SCXodeMinimapIsInitiallyHidden]; - [sender setTitle:@"Hide MiniMap"]; + [sender setTitle:@"Hide Minimap"]; [sender setAction:@selector(hideMiniMap:)]; - [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapWantsToBeShownNotification object:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapShowNotification object:nil]; } -- (void)onDocumentDidChange:(NSNotification*)sender -{ - SCMiniMapView *miniMapView = objc_getAssociatedObject([sender object], &kKeyMiniMapView); - - //150 lines per multiplier means a 1500 line file should have a delay of 2.5 seconds. - CGFloat multiplier = ceilf((CGFloat)miniMapView.numberOfLines / 150.0f); - NSTimeInterval updateInterval = (CGFloat)multiplier * kDefaultUpdateInterval; - - [NSObject cancelPreviousPerformRequestsWithTarget:miniMapView selector:@selector(updateTextView) object:nil]; - [miniMapView performSelector:@selector(updateTextView) withObject:nil afterDelay:updateInterval]; -} +#pragma mark - Xcode Notification - (void)onCodeEditorBoundsChange:(NSNotification*)sender { - if(![sender.object respondsToSelector:@selector(scrollView)]) { - NSLog(@"Could not fetch scroll view"); - return; - } - NSScrollView *editorScrollView = [sender.object performSelector:@selector(scrollView)]; - SCMiniMapView *miniMapView = objc_getAssociatedObject(editorScrollView, &kKeyMiniMapView); - [miniMapView updateSelectionView]; + if(![sender.object isKindOfClass:[IDESourceCodeEditor class]]) { + NSLog(@"Could not fetch source code editor container"); + return; + } + + IDESourceCodeEditor *editor = (IDESourceCodeEditor *)[sender object]; + SCXcodeMinimapView *miniMapView = objc_getAssociatedObject(editor.scrollView, &kAssociatedObjectMinimapViewKey); + [miniMapView updateOffset]; } - (void)onDidFinishSetup:(NSNotification*)sender { - if(![[sender object] respondsToSelector:@selector(containerView)]) { - NSLog(@"Could not fetch editor container view"); - return; - } - if(![[sender object] respondsToSelector:@selector(scrollView)]) { - NSLog(@"Could not fetch editor scroll view"); - return; - } - if(![[sender object] respondsToSelector:@selector(textView)]) { - NSLog(@"Could not fetch editor text view"); - return; - } - if(![[sender object] respondsToSelector:@selector(sourceCodeDocument)]) { - NSLog(@"Could not fetch editor document"); - return; - } - - /* Get Editor Components */ - NSDocument *editorDocument = [[sender object] performSelector:@selector(sourceCodeDocument)]; - NSView *editorContainerView = [[sender object] performSelector:@selector(containerView)]; - NSScrollView *editorScrollView = [[sender object] performSelector:@selector(scrollView)]; - NSTextView *editorTextView = [[sender object] performSelector:@selector(textView)]; - - [editorTextView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable]; - - /* Create Mini Map */ - CGFloat width = editorTextView.bounds.size.width * kDefaultZoomLevel; - - NSRect miniMapScrollViewFrame = NSMakeRect(editorContainerView.bounds.size.width - width, - 0, - width, - editorScrollView.bounds.size.height); - - SCMiniMapView *miniMapView = [[SCMiniMapView alloc] initWithFrame:miniMapScrollViewFrame]; - miniMapView.editorScrollView = editorScrollView; - miniMapView.editorTextView = editorTextView; - [editorContainerView addSubview:miniMapView]; - - /* Setup Associated Objects */ - objc_setAssociatedObject(editorScrollView, &kKeyMiniMapView, miniMapView, OBJC_ASSOCIATION_ASSIGN); - objc_setAssociatedObject(editorDocument, &kKeyMiniMapView, miniMapView, OBJC_ASSOCIATION_RETAIN); - - if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { - [miniMapView hide]; - } - else { - [miniMapView show]; - } + if(![sender.object isKindOfClass:[IDESourceCodeEditor class]]) { + NSLog(@"Could not fetch source code editor container"); + return; + } + + IDESourceCodeEditor *editor = (IDESourceCodeEditor *)[sender object]; + [editor.textView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable]; + + CGFloat width = editor.textView.bounds.size.width * kDefaultZoomLevel; + NSRect miniMapScrollViewFrame = NSMakeRect(editor.containerView.bounds.size.width - width, 0, width, editor.scrollView.bounds.size.height); + + SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editorScrollView:editor.scrollView editorTextView:editor.textView]; + [editor.containerView addSubview:miniMapView]; + + objc_setAssociatedObject(editor.scrollView, &kAssociatedObjectMinimapViewKey, miniMapView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + [miniMapView setVisible:![[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]]; } @end diff --git a/SCXcodeMinimap/SCXcodeMinimapSelectionView.h b/SCXcodeMinimap/SCXcodeMinimapSelectionView.h new file mode 100644 index 0000000..116c777 --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapSelectionView.h @@ -0,0 +1,16 @@ +// +// SCXcodeMinimapSelectionView.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 24/01/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import + +@interface SCXcodeMinimapSelectionView : NSView + +@property (nonatomic, strong) NSColor *selectionColor; +@property (nonatomic, assign) BOOL shouldInverseColors; + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapSelectionView.m b/SCXcodeMinimap/SCXcodeMinimapSelectionView.m new file mode 100644 index 0000000..02ee548 --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapSelectionView.m @@ -0,0 +1,65 @@ +// +// SCXcodeMinimapSelectionView.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 24/01/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "SCXcodeMinimapSelectionView.h" +#import "DVTFontAndColorTheme.h" + +@implementation SCXcodeMinimapSelectionView +@synthesize selectionColor = _selectionColor; + +- (void)drawRect:(NSRect)dirtyRect +{ + [[self selectionColor] setFill]; + NSRectFill(dirtyRect); +} + +- (NSColor *)selectionColor +{ + if(_selectionColor == nil) { + + _selectionColor = [NSColor colorWithDeviceRed:0.0f green:0.0f blue:0.0f alpha:0.3f]; + + NSColor *backgroundColor = [[[DVTFontAndColorTheme currentTheme] sourceTextBackgroundColor] colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; + + if(self.shouldInverseColors) { + + _selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [backgroundColor redComponent]) + green:(1.0f - [backgroundColor greenComponent]) + blue:(1.0f - [backgroundColor blueComponent]) + alpha:0.3f]; + } else { + + _selectionColor = [NSColor colorWithCalibratedHue:0.0f + saturation:0.0f + brightness:(1.0f - [backgroundColor brightnessComponent]) + alpha:0.3f]; + } + } + + return _selectionColor; +} + +- (void)setSelectionColor:(NSColor *)selectionColor +{ + if([_selectionColor isEqual:selectionColor]) return; + + _selectionColor = selectionColor; + [self setNeedsDisplay:YES]; +} + +- (void)setShouldInverseColors:(BOOL)shouldInverseColors +{ + if(_shouldInverseColors == shouldInverseColors) { + return; + } + + _shouldInverseColors = shouldInverseColors; + _selectionColor = nil; +} + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.h b/SCXcodeMinimap/SCXcodeMinimapView.h new file mode 100644 index 0000000..230e4f4 --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapView.h @@ -0,0 +1,26 @@ +// +// SCXcodeMinimapView.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 24/01/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import + +@class DVTSourceTextView; +@class SCSelectionView; + +extern const CGFloat kDefaultZoomLevel; + +@interface SCXcodeMinimapView : NSView + +- (instancetype)initWithFrame:(NSRect)frameRect + editorScrollView:(NSScrollView *)editorScrollView + editorTextView:(DVTSourceTextView *)editorTextView; + +- (void)updateOffset; + +- (void)setVisible:(BOOL)visible; + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m new file mode 100644 index 0000000..bd65e4e --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -0,0 +1,194 @@ +// +// SCMinimapView.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 24/01/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "SCXcodeMinimapView.h" +#import "SCXcodeMinimap.h" +#import "SCXcodeMinimapSelectionView.h" + +#import "DVTTextStorage.h" +#import "DVTPointerArray.h" +#import "DVTSourceTextView.h" +#import "DVTSourceNodeTypes.h" +#import "DVTFontAndColorTheme.h" + + +const CGFloat kDefaultZoomLevel = 0.1f; +const CGFloat kDefaultShadowLevel = 0.1f; + +static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; + +@interface SCXcodeMinimapView () + +@property (nonatomic, strong) NSScrollView *editorScrollView; +@property (nonatomic, strong) DVTSourceTextView *editorTextView; + +@property (nonatomic, strong) NSScrollView *scrollView; +@property (nonatomic, strong) DVTSourceTextView *textView; +@property (nonatomic, strong) SCXcodeMinimapSelectionView *selectionView; + +@end + +@implementation SCXcodeMinimapView + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (id)initWithFrame:(NSRect)frame editorScrollView:(NSScrollView *)editorScrollView editorTextView:(DVTSourceTextView *)editorTextView +{ + if (self = [super initWithFrame:frame]) + { + [self setWantsLayer:YES]; + [self setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; + + self.editorScrollView = editorScrollView; + self.editorTextView = editorTextView; + + self.scrollView = [[NSScrollView alloc] initWithFrame:self.bounds]; + [self.scrollView setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; + + [self.scrollView setHorizontalScrollElasticity:NSScrollElasticityNone]; + [self.scrollView setVerticalScrollElasticity:NSScrollElasticityNone]; + [self addSubview:self.scrollView]; + + self.textView = [[DVTSourceTextView alloc] initWithFrame:self.editorTextView.bounds]; + [self.textView setEditable:NO]; + [self.textView setSelectable:NO]; + [self.textView setTextStorage:editorTextView.textStorage]; + [self.scrollView setDocumentView:self.textView]; + + + self.selectionView = [[SCXcodeMinimapSelectionView alloc] init]; + [self.textView addSubview:_selectionView]; + + [self updateTheme]; + + [[NSNotificationCenter defaultCenter] addObserverForName:SCXodeMinimapShowNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [self setVisible:YES]; + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:SCXodeMinimapHideNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [self setVisible:NO]; + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:DVTFontAndColorSourceTextSettingsChangedNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [self updateTheme]; + }]; + + [self.scrollView setAllowsMagnification:YES]; + [self.scrollView setMinMagnification:kDefaultZoomLevel]; + [self.scrollView setMagnification:kDefaultZoomLevel]; + } + + return self; +} + +#pragma mark - Show/Hide + +- (void)setVisible:(BOOL)visible +{ + self.hidden = !visible; + + NSRect editorTextViewFrame = self.editorScrollView.frame; + editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width - (visible ? self.bounds.size.width : 0.0f); + self.editorScrollView.frame = editorTextViewFrame; + + if(visible) { + [self updateOffset]; + } +} + +#pragma mark - Navigation + +- (void)updateOffset +{ + if ([self isHidden]) { + return; + } + + CGFloat editorContentHeight = [self.editorScrollView.documentView frame].size.height - self.editorScrollView.bounds.size.height; + + NSRect selectionViewFrame = NSMakeRect(0, 0, self.bounds.size.width * (1 / self.scrollView.magnification), self.editorScrollView.visibleRect.size.height); + + if(editorContentHeight == 0.0f) { + [self.selectionView setFrame:selectionViewFrame]; + return; + } + + CGFloat ratio = (CGRectGetHeight([self.scrollView.documentView frame]) - CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)) / editorContentHeight * (1 / self.scrollView.magnification); + + if(ratio == 0.0f) { + [self.selectionView setFrame:selectionViewFrame]; + return; + } + + CGPoint offset = NSMakePoint(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification)); + [self.scrollView.contentView scrollToPoint:offset]; + + CGFloat textHeight = [self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer].size.height; + ratio = (textHeight - self.selectionView.bounds.size.height) / editorContentHeight; + selectionViewFrame.origin.y = self.editorScrollView.contentView.bounds.origin.y * ratio; + + [self.selectionView setFrame:selectionViewFrame]; +} + +- (void)mouseUp:(NSEvent *)theEvent +{ + [super mouseUp:theEvent]; + [self handleMouseEvent:theEvent]; +} + +- (void)mouseDown:(NSEvent *)theEvent +{ + [super mouseDown:theEvent]; + [self handleMouseEvent:theEvent]; +} + +- (void)mouseDragged:(NSEvent *)theEvent +{ + [super mouseDragged:theEvent]; + [self handleMouseEvent:theEvent]; +} + +- (void)handleMouseEvent:(NSEvent *)theEvent +{ + NSPoint point = [self.textView convertPoint:theEvent.locationInWindow fromView:nil]; + NSUInteger characterIndex = [self.textView characterIndexForInsertionAtPoint:point]; + [self.editorTextView scrollRangeToVisible:NSMakeRange(characterIndex, 0)]; +} + +#pragma mark - Theme + +- (void)updateTheme +{ + [self.scrollView setBackgroundColor:self.backgroundColor]; + [self.textView setBackgroundColor:self.backgroundColor]; + [self.selectionView setSelectionColor:nil]; +} + +- (NSColor *)backgroundColor +{ + DVTFontAndColorTheme *theme = [DVTFontAndColorTheme currentTheme]; + + if(theme.sourceTextBackgroundColor) { + return [theme.sourceTextBackgroundColor shadowWithLevel:kDefaultShadowLevel]; + } + + return [[NSColor clearColor] shadowWithLevel:kDefaultShadowLevel]; +} + +#pragma mark - Autoresizing + +- (void)resizeWithOldSuperviewSize:(NSSize)oldSize +{ + [super resizeWithOldSuperviewSize:oldSize]; + [self updateOffset]; +} + +@end diff --git a/SCXcodeMinimap/ShitFile.h b/SCXcodeMinimap/ShitFile.h new file mode 100644 index 0000000..f747d9a --- /dev/null +++ b/SCXcodeMinimap/ShitFile.h @@ -0,0 +1,1607 @@ +// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +//// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +//// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +//// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +// + +#import + +@interface DVTSourceCodeSymbolKind : NSObject ++ (id)containerSymbolKind; ++ (id)globalSymbolKind; ++ (id)callableSymbolKind; ++ (id)memberSymbolKind; ++ (id)memberContainerSymbolKind; ++ (id)categorySymbolKind; ++ (id)classMethodSymbolKind; ++ (id)classSymbolKind; ++ (id)enumSymbolKind; ++ (id)enumConstantSymbolKind; ++ (id)fieldSymbolKind; ++ (id)functionSymbolKind; ++ (id)instanceMethodSymbolKind; ++ (id)instanceVariableSymbolKind; ++ (id)classVariableSymbolKind; ++ (id)macroSymbolKind; ++ (id)parameterSymbolKind; ++ (id)propertySymbolKind; ++ (id)protocolSymbolKind; ++ (id)structSymbolKind; ++ (id)typedefSymbolKind; ++ (id)unionSymbolKind; ++ (id)localVariableSymbolKind; ++ (id)globalVariableSymbolKind; ++ (id)ibActionMethodSymbolKind; ++ (id)ibOutletSymbolKind; ++ (id)ibOutletVariableSymbolKind; ++ (id)ibOutletPropertySymbolKind; ++ (id)ibOutletCollectionSymbolKind; ++ (id)ibOutletCollectionVariableSymbolKind; ++ (id)ibOutletCollectionPropertySymbolKind; ++ (id)namespaceSymbolKind; ++ (id)classTemplateSymbolKind; ++ (id)functionTemplateSymbolKind; ++ (id)instanceMethodTemplateSymbolKind; ++ (id)classMethodTemplateSymbolKind; ++ (void)initialize; ++ (id)sourceCodeSymbolKinds; +- (id)icon; +- (id)description; +- (id)conformedToSymbolKinds; +- (id)allConformingSymbolKinds; +- (char)isContainer; +- (id)identifier; +- (id)localizedDescription; +@end + +@interface IDEDocumentController : NSObject ++ (id)sharedDocumentController; +- (NSArray *)workspaceDocuments; +@end + +@class DVTDocumentLocation, DVTFileDataType; +@interface DVTFilePath : NSObject +- (NSURL *)fileURL; +- (NSString *)pathString; +- (NSString *)fileName; ++ (DVTFilePath *)filePathForPathString:(NSString *)path; +- (DVTFilePath *)file; +- (NSImage *)navigableItem_image; + +- (DVTDocumentLocation *)navigableItem_contentDocumentLocation; +- (DVTFileDataType *)navigableItem_documentType; +- (DVTFilePath *)parentFilePath; +- (DVTFilePath *)volumeFilePath; +@end + +@interface IDEIndex : NSObject +{ +} + ++ (BOOL)languageSupportsSymbolColoring:(id)arg1; ++ (id)resolutionForName:(id)arg1 kind:(id)arg2 containerName:(id)arg3; ++ (id)pathToClang; ++ (id)_dataSourceExtensionForFile:(id)arg1 withLanguage:(id)arg2; ++ (void)syncPerformBlockOnMainThread:(dispatch_block_t)arg1; ++ (void)initialize; ++ (BOOL)includeAutoImportResults; ++ (BOOL)indexFollowsActiveScheme; ++ (id)schedulingLogAspect; ++ (id)clangInvocationLogAspect; ++ (id)symbolAdditionLogAspect; ++ (id)deferredMetricLogAspect; ++ (id)metricLogAspect; ++ (id)logAspect; +@property(readonly, nonatomic) DVTFilePath *databaseFile; // @synthesize databaseFile=_databaseFile; +//@property(readonly, nonatomic) IDEIndexDatabase *database; // @synthesize database=_workspaceDatabase; +- (id)targetIdentifiersForFile:(id)arg1; +- (id)mainFilesForFile:(id)arg1; +- (id)sdkForFile:(id)arg1; +- (id)timestampForFile:(id)arg1; +- (void)_buildOperationDidStop:(id)arg1; +- (void)_buildSettingsDidChange:(id)arg1; +- (void)_activeRunDestinationDidChange:(id)arg1; +- (void)_activeRunContextDidChange:(id)arg1; +- (void)_clearAllCachedBuildSettings; +- (void)_computePreferredTargets; +- (BOOL)isPreferredTarget:(id)arg1 priority:(char *)arg2; +- (BOOL)isPreferredTarget:(id)arg1; +- (id)databaseQueryProvider; +- (id)queryProviderForLocation:(id)arg1 highPriority:(BOOL)arg2; +- (void)dontDeferJobForFile:(id)arg1 indexable:(id)arg2; +- (void)registerHotFile:(id)arg1; +- (id)queryProviderForFile:(id)arg1 highPriority:(BOOL)arg2; +- (id)resolutionForName:(id)arg1 kind:(id)arg2 containerName:(id)arg3; +- (id)indexableForCopiedHeader:(id)arg1; +- (id)originalPathsForPaths:(id)arg1; +- (id)effectivePathForHeader:(id)arg1; +- (void)_initCopiedHeaders; +- (void)indexModuleIfNeeded:(id)arg1; +- (void)_cleanupOldPCHs; +- (void)didCancelIndexingPCHFile:(id)arg1; +- (BOOL)createPCHFile:(id)arg1 arguments:(id)arg2 hashCriteria:(id)arg3 target:(id)arg4 session:(id)arg5 willIndex:(BOOL)arg6 translationUnit:(id *)arg7; +- (void)database:(id)arg1 reportAutoQueryProgress:(double)arg2; +- (void)clearPCHFailuresForDatabase:(id)arg1; +- (void)databaseDidReportError:(id)arg1; +- (void)databaseDidLoad:(id)arg1; +- (void)databaseDidOpen:(id)arg1; +- (id)databaseProvidersAndVersions:(id)arg1; +- (void)database:(id)arg1 didForgetFiles:(id)arg2; +- (void)database:(id)arg1 didEndImportSession:(id)arg2; +- (void)databaseDidSave:(id)arg1; +- (void)databaseDidIndexHotFile:(id)arg1; +- (void)_respondToFileChangeNotification:(id)arg1; +@property(readonly, nonatomic) DVTFilePath *workspaceFile; +@property(readonly, nonatomic) NSString *workspaceName; +- (id)dataSourceExtensionForFile:(id)arg1 settings:(id)arg2; +- (id)_dataSourceExtensionForFile:(id)arg1 withSettings:(id)arg2; +- (id)settingsForFile:(id)arg1 indexable:(id)arg2; +- (id)_waitForSettingsForFile:(id)arg1 object:(id)arg2; +- (id)_waitForSettingsFromObject:(id)arg1; +- (id)workspaceHeadersForIndexable:(id)arg1; +- (void)gatherProductHeadersForIndexable:(id)arg1; +- (long long)purgeCount; +- (void)purgeFileCaches; +- (void)close; +- (void)editorWillSaveFile:(id)arg1; +- (void)expediteIndexing; +- (void)_stopIndexing; +- (void)setThrottleFactor:(double)arg1; +- (void)resumeIndexing; +- (void)suspendIndexing; +@property(readonly, nonatomic) BOOL shouldAllowRefactoring; +@property(readonly, nonatomic) BOOL isQuiescent; +- (void)doWhenFilesReady:(dispatch_block_t)arg1; +- (void)willRegisterMoreFiles:(BOOL)arg1; +- (void)unregisterFile:(id)arg1; +- (void)registerFile:(id)arg1; +- (id)indexableForIdentifier:(id)arg1; +- (void)unregisterObject:(id)arg1; +- (void)registerObject:(id)arg1; +- (void)postNotificationName:(id)arg1; +- (void)postNotificationName:(id)arg1 userInfo:(id)arg2; +- (id)description; +- (void)setIndexState:(id)arg1; +- (id)indexState; +@property(readonly) DVTFilePath *workspaceBuildProductsDirPath; +@property(readonly) DVTFilePath *headerMapFilePath; +- (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; +- (BOOL)isCurrentForWorkspace:(id)arg1; +- (void)beginTextIndexing; +- (id)initWithWorkspace:(id)arg1; +- (id)initWithFolder:(id)arg1; +- (id)initWithFolder:(id)arg1 forWorkspace:(id)arg2; +- (void)_cleanupOldIndexFoldersForWorkspace:(id)arg1; +- (double)_atime:(struct stat *)arg1; +- (BOOL)_stat:(struct stat *)arg1 filePath:(id)arg2; +- (id)_databaseFileURLForFolder:(id)arg1; +- (id)_databaseFolderForWorkspace:(id)arg1; +- (BOOL)_reopenDatabaseWithRemoval:(BOOL)arg1; +- (BOOL)_createDatabaseFolder; +- (void)_setupObservers; +- (id)allAutoImportItemsMatchingKind:(id)arg1 symbolLanguage:(id)arg2; +- (id)allAutoImportItemsMatchingKind:(id)arg1; +- (id)filesWithSymbolOccurrencesMatchingName:(id)arg1 kind:(id)arg2; +- (id)classesWithReferencesToSymbols:(id)arg1; +- (id)allClassesWithMembers:(id)arg1; +- (id)classesWithMembers:(id)arg1; +- (id)allMethodsMatchingMethod:(id)arg1 forReceiver:(id)arg2; +- (id)membersMatchingName:(id)arg1 kinds:(id)arg2 forInterfaces:(id)arg3; +- (id)membersMatchingKinds:(id)arg1 forInterfaces:(id)arg2; +- (id)symbolsForResolutions:(id)arg1; +- (id)parsedCodeCommentAtLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)codeDiagnosticsAtLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)codeCompletionsAtLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2 completionContext:(id *)arg3; +- (id)allParentsOfSymbols:(id)arg1 cancelWhen:(dispatch_block_t)arg2; +- (id)topLevelSymbolsInFile:(id)arg1; +- (unsigned long long)countOfSymbolsMatchingKind:(id)arg1 workspaceOnly:(BOOL)arg2; +- (id)allSymbolsMatchingKind:(id)arg1 workspaceOnly:(BOOL)arg2 cancelWhen:(dispatch_block_t)arg3; +- (id)allSymbolsMatchingKind:(id)arg1 workspaceOnly:(BOOL)arg2; +- (id)allSymbolsMatchingKind:(id)arg1; +- (id)testMethodsForClasses:(id)arg1; +- (id)allSubClassesForClasses:(id)arg1; +- (id)allSymbolsMatchingNames:(id)arg1 kind:(id)arg2; +- (id)allSymbolsMatchingName:(id)arg1 kind:(id)arg2; +- (id)allProtocolsMatchingName:(id)arg1; +- (id)allClassesMatchingName:(id)arg1; +- (id)impliedHeadersForModuleImportLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)importedFileAtDocumentLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)importedFilesAtDocument:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)collectionElementTypeSymbolForSymbol:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)typeSymbolForSymbol:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)messageReceiverInContext:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)referencesToSymbolMatchingName:(id)arg1 inContext:(id)arg2 withCurrentFileContentDictionary:(id)arg3; +- (id)referencesToSymbol:(id)arg1 inContext:(id)arg2 withCurrentFileContentDictionary:(id)arg3; +- (id)symbolsUsedInContext:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)symbolsOccurrencesInContext:(id)arg1 withCurrentFileContentDictionary:(id)arg2; +- (id)symbolsMatchingName:(id)arg1 inContext:(id)arg2 withCurrentFileContentDictionary:(id)arg3; +- (id)symbolsMatchingName:(id)arg1 inContext:(id)arg2; +- (id)symbolsContaining:(id)arg1 anchorStart:(BOOL)arg2 anchorEnd:(BOOL)arg3 subsequence:(BOOL)arg4 ignoreCase:(BOOL)arg5 cancelWhen:(dispatch_block_t)arg6; +- (id)symbolsContaining:(id)arg1 anchorStart:(BOOL)arg2 anchorEnd:(BOOL)arg3 subsequence:(BOOL)arg4 ignoreCase:(BOOL)arg5; +- (id)topLevelProtocolsWorkspaceOnly:(BOOL)arg1 cancelWhen:(dispatch_block_t)arg2; +- (id)topLevelProtocolsWorkspaceOnly:(BOOL)arg1; +- (id)topLevelProtocols; +- (id)topLevelClassesWorkspaceOnly:(BOOL)arg1 cancelWhen:(dispatch_block_t)arg2; +- (id)topLevelClassesWorkspaceOnly:(BOOL)arg1; +- (id)topLevelClasses; +- (id)filesContaining:(id)arg1 anchorStart:(BOOL)arg2 anchorEnd:(BOOL)arg3 subsequence:(BOOL)arg4 ignoreCase:(BOOL)arg5 cancelWhen:(dispatch_block_t)arg6; +- (id)filesIncludedByFile:(id)arg1; +- (id)filesIncludingFile:(id)arg1; +- (id)mainFileForSelectionFilePath:(id)arg1 buildSettings:(id *)arg2; +- (id)objCOrCCompilationUnitIndexablesForMainFile:(id)arg1 indexableObjects:(id)arg2; +- (BOOL)isFileObjCCompilationUnitOrHeader:(id)arg1 error:(id *)arg2; +- (id)_localizedPhraseForDependentObjCCompilationUnit:(id)arg1 errorLanguages:(id)arg2 sharedLanguageIdentifier:(id)arg3 sharedIndexableObject:(id)arg4; +- (id)_localizedDescriptionForObjCCompilationUnit:(id)arg1 errorLanguages:(id)arg2; +- (BOOL)_errorLanguages:(id *)arg1 forFilePath:(id)arg2 indexableObjects:(id)arg3; + +@end + +@class IDEIndexDatabase; +@interface IDEIndexDatabaseQueryProvider : NSObject +- (id)topLevelSymbolsInFile:(NSString *)filePath forIndex:(IDEIndex *)index; +- (id)filesContaining:(NSString *)a anchorStart:(NSString *)b anchorEnd:(NSString *)c subsequence:(NSString *)d ignoreCase:(BOOL)ignoreCase forIndex:(IDEIndex *)wwefwew; +- (IDEIndexDatabase *)database; +@end + +@interface IDEIndexDBConnection : NSObject +- (void)close; +- (void)finalize; +- (id)dbConnection; +@end + +@interface IDEIndexDatabase : NSObject +- (IDEIndexDatabase *)initWithFileURL:(NSURL *)fileURL; +- (IDEIndexDatabaseQueryProvider *)queryProvider; +- (void)open; +- (void)openReadonly; +- (void)openInDiagnosticMode; +- (void)close; +- (id)mainFilesForTarget:(NSString *)targetNameOrWTF; +- (IDEIndexDBConnection *)newConnection; +- (NSURL *)fileURL; +@end + +@interface DVTModelObject : NSObject +@end + +@interface IDEContainerItem : DVTModelObject +@end + +@interface IDEGroup : IDEContainerItem +- (NSArray *)subitems; +- (NSImage *)navigableItem_image; +@end + +@interface IDEContainer : DVTModelObject +- (DVTFilePath *)filePath; +- (IDEGroup *)rootGroup; +- (void)debugPrintInnerStructure; +- (void)debugPrintStructure; +@end + +@interface IDEXMLPackageContainer : IDEContainer +@end + +@interface IDEWorkspace : IDEXMLPackageContainer +- (IDEIndex *)index; +- (NSString *)name; +- (NSSet *)referencedContainers; +@end + +@interface IDEWorkspaceDocument : NSObject +- (IDEWorkspace *)workspace; +- (NSArray *)recentEditorDocumentURLs; +- (id)sdefSupport_fileReferences; +@end + +@interface IDEWorkspaceWindow : NSWindow +- (IDEWorkspaceDocument *)document; +@end + +@interface IDEWorkspaceWindow (MissingMethods) ++ (IDEWorkspaceWindow *)mc_lastActiveWorkspaceWindow; +@end + +@interface IDEFileReference : NSObject +- (IDEContainer *)referencedContainer; +@end + +@interface PBXObject : NSObject +@end + +@interface PBXContainer : PBXObject +- (NSString *)name; +@end + +@interface PBXContainerItem : PBXObject +@end + +@class PBXGroup; +@interface PBXReference : PBXContainerItem +- (BOOL)isGroup; +- (NSString *)name; +- (NSString *)absolutePath; +- (PBXGroup *)group; +- (PBXContainer *)container; +@end + +@interface PBXGroup : PBXReference +- (NSArray *)children; +@end + +@interface Xcode3Group : IDEGroup +- (PBXGroup *)group; +@end + +@interface Xcode3Project : IDEContainer +- (Xcode3Group *)rootGroup; +@end + +@interface DVTApplication : NSApplication +@end + +@interface IDEApplication : DVTApplication ++ (IDEApplication *)sharedApplication; +@end + +@interface IDEApplicationController : NSObject ++ (IDEApplicationController *)sharedAppController; +- (BOOL)application:(IDEApplication *)application openFile:(NSString *)filePath; +@end + +@interface XCSpecification : NSObject +@end + +@interface PBXFileType : XCSpecification +- (BOOL)isBundle; +- (BOOL)isApplication; +- (BOOL)isLibrary; +- (BOOL)isFramework; +- (BOOL)isProjectWrapper; +- (BOOL)isTargetWrapper; +- (BOOL)isExecutable; +@end + +@interface PBXFileReference : PBXReference +- (NSString *)resolvedAbsolutePath; +- (id)fileType; +- (NSArray *)children; +@end + +@interface IDEIndexSymbolOccurrence : NSObject +- (id)file; +- (id)location; +- (long long)lineNumber; +@end + +@interface IDEIndexCollection : NSObject +- (NSArray *)allObjects; +@end + +@interface IDEIndexSymbolOccurrenceCollection : IDEIndexCollection +@end + +@interface IDEIndexSymbol : NSObject +- (NSString *)name; +- (DVTSourceCodeSymbolKind *)symbolKind; +- (NSString *)displayText; +- (NSString *)completionText; +- (NSString *)displayType; +- (NSString *)descriptionText; +- (NSImage *)icon; + +- (IDEIndexSymbolOccurrence *)modelOccurrence; +- (IDEIndexSymbolOccurrenceCollection *)occurrences; +- (IDEIndexSymbolOccurrenceCollection *)declarations; +- (IDEIndexSymbolOccurrenceCollection *)definitions; + +- (NSArray *)containerSymbols; +- (id)containerSymbol; + +- (unsigned long long)hash; +@end + +@interface IDEIndexContainerSymbol : IDEIndexSymbol +- (NSArray *)children; +@end + +@interface IDEIndexClassSymbol : IDEIndexContainerSymbol +- (NSArray *)categories; +@end + +@interface IDEIndexProtocolSymbol : IDEIndexContainerSymbol +@end + +@interface IDEIndexCategorySymbol : IDEIndexContainerSymbol +- (NSArray *)classMethods; +- (NSArray *)instanceMethods; +- (NSArray *)properties; +@end + +@interface IDENavigableItem : NSObject ++ (IDENavigableItem *)navigableItemWithRepresentedObject:(id)object; +@end + +@interface IDEFileNavigableItem : IDENavigableItem ++ (IDEFileNavigableItem *)navigableItemWithRepresentedObject:(id)object; +@end + +@interface IDEFileReferenceNavigableItem : IDEFileNavigableItem ++ (IDEFileReferenceNavigableItem *)navigableItemWithRepresentedObject:(id)object; +@end + +@interface DVTDocumentLocation : NSObject +- (DVTDocumentLocation *)initWithDocumentURL:(NSURL *)documentURL timestamp:(NSNumber *)timestamp; +- (NSURL *)documentURL; +@end + +@interface DVTTextDocumentLocation : DVTDocumentLocation +- (DVTTextDocumentLocation *)initWithDocumentURL:(NSURL *)documentURL timestamp:(NSNumber *)timestamp lineRange:(NSRange)lineRange; +- (NSRange)characterRange; +- (NSURL *)documentURL; +@end + +@interface DVTViewController : NSViewController +@end + +@class DVTExtension; +@interface IDEViewController : DVTViewController + +@property (nonatomic, retain) DVTExtension *representedExtension; + +@end + +@interface IDEEditorOpenSpecifier : NSObject +- (IDEEditorOpenSpecifier *)initWithNavigableItem:(IDENavigableItem *)navigableItem error:(NSError *)error; ++ (IDEEditorOpenSpecifier *)structureEditorOpenSpecifierForDocumentLocation:(DVTDocumentLocation *)documentLocation inWorkspace:(IDEWorkspace *)workspace error:(NSError *)error; +@end + +@interface IDEEditorHistoryItem : NSObject +- (NSString *)historyMenuItemTitle; +- (NSURL *)documentURL; +@end + +@interface DVTSourceExpression : NSObject +- (NSString *)textSelectionString; +@end + +@interface IDEEditorHistoryStack : NSObject +- (NSArray *)previousHistoryItems; +- (NSArray *)nextHistoryItems; +- (IDEEditorHistoryItem *)currentEditorHistoryItem; +@end + +@class IDEEditor; +@interface IDEEditorContext : IDEViewController +- (BOOL)openEditorOpenSpecifier:(IDEEditorOpenSpecifier *)openSpecifier; +- (IDEEditorHistoryStack *)currentHistoryStack; +- (IDEEditor *)editor; +@end + +@interface IDEEditorArea : IDEViewController +- (IDEEditorContext *)primaryEditorContext; +- (IDEEditorContext *)lastActiveEditorContext; +@end + +@interface IDEWorkspaceWindowController : NSWindowController ++ (NSArray *)workspaceWindowControllers; ++ (IDEWorkspaceWindowController *)workspaceWindowControllerForWindow:(IDEWorkspaceWindow *)window; +- (IDEEditorArea *)editorArea; +@end + +@interface IDEKeyBinding : NSObject +- (NSString *)title; +- (NSString *)group; +- (NSArray *)actions; +- (NSArray *)keyboardShortcuts; ++ (IDEKeyBinding *)keyBindingWithTitle:(NSString *)title group:(NSString *)group actions:(NSArray *)actions keyboardShortcuts:(NSArray *)keyboardShortcuts; ++ (IDEKeyBinding *)keyBindingWithTitle:(NSString *)title parentTitle:(NSString *)parentTitle group:(NSString *)group actions:(NSArray *)actions keyboardShortcuts:(NSArray *)keyboardShortcuts; +@end + +@interface IDEMenuKeyBinding : IDEKeyBinding +- (NSString *)commandIdentifier; ++ (IDEMenuKeyBinding *)keyBindingWithTitle:(NSString *)title group:(NSString *)group actions:(NSArray *)actions keyboardShortcuts:(NSArray *)keyboardShortcuts; ++ (IDEMenuKeyBinding *)keyBindingWithTitle:(NSString *)title parentTitle:(NSString *)parentTitle group:(NSString *)group actions:(NSArray *)actions keyboardShortcuts:(NSArray *)keyboardShortcuts; +- (void)setCommandIdentifier:(NSString *)commandIdentifier; +@end + +@class IDEKeyBindingPreferenceSetManager; +@class IDEMenuKeyBindingSet; +@interface IDEKeyBindingPreferenceSet : NSObject ++ (IDEKeyBindingPreferenceSetManager *)preferenceSetsManager; +- (IDEMenuKeyBindingSet *)menuKeyBindingSet; +@end + +@interface IDEKeyBindingPreferenceSetManager : NSObject +- (IDEKeyBindingPreferenceSet *)currentPreferenceSet; +@end + +@interface IDEKeyBindingSet : NSObject +- (void)addKeyBinding:(IDEKeyBinding *)keyBinding; +- (void)insertObject:(IDEKeyBinding *)keyBinding inKeyBindingsAtIndex:(NSUInteger)index; +- (void)updateDictionary; +@end + +@interface IDEKeyboardShortcut : NSObject ++ (id)keyboardShortcutFromStringRepresentation:(NSString *)stringRep; +- (NSString *)stringRepresentation; +- (NSString *)keyEquivalent; +- (IDEKeyboardShortcut *)keyboardShortcutFromStringRepresentation:(NSString *)stringRep; +- (unsigned long long)modifierMask; +@end + +@interface IDEMenuKeyBindingSet : IDEKeyBindingSet +- (NSArray *)keyBindings; +@end + +@interface DVTLayoutView_ML : NSView +{ + NSMutableDictionary *invalidationTokens; + BOOL _layoutNeeded; + BOOL _implementsLayoutCompletionCallback; + NSCountedSet *_frameChangeObservations; + NSCountedSet *_boundsChangeObservations; + BOOL _implementsDrawRect; + BOOL _needsSecondLayoutPass; +} + ++ (void)_layoutWindow:(id)arg1; ++ (void)_recursivelyLayoutSubviewsOfView:(id)arg1 populatingSetWithLaidOutViews:(id)arg2; ++ (void)_doRecursivelyLayoutSubviewsOfView:(id)arg1 populatingSetWithLaidOutViews:(id)arg2 completionCallBackHandlers:(id)arg3 currentLayoutPass:(long long)arg4 needsSecondPass:(char *)arg5; ++ (void)scheduleWindowForLayout:(id)arg1; ++ (id)alreadyLaidOutViewsForCurrentDisplayPassOfWindow:(id)arg1; ++ (void)clearAlreadyLaidOutViewsForCurrentDisplayPassOfWindow:(id)arg1; +@property BOOL needsSecondLayoutPass; // @synthesize needsSecondLayoutPass=_needsSecondLayoutPass; +@property(getter=isLayoutNeeded) BOOL layoutNeeded; // @synthesize layoutNeeded=_layoutNeeded; +- (BOOL)wantsDefaultClipping; +- (void)stopInvalidatingLayoutWithChangesToKeyPath:(id)arg1 ofObject:(id)arg2; +- (void)invalidateLayoutWithChangesToKeyPath:(id)arg1 ofObject:(id)arg2; +- (void)_autoLayoutViewViewFrameDidChange:(id)arg1; +- (void)_autoLayoutViewViewBoundsDidChange:(id)arg1; +- (void)stopInvalidatingLayoutWithBoundsChangesToView:(id)arg1; +- (void)stopInvalidatingLayoutWithFrameChangesToView:(id)arg1; +- (void)invalidateLayoutWithBoundsChangesToView:(id)arg1; +- (void)invalidateLayoutWithFrameChangesToView:(id)arg1; +- (void)tearDownObservationForObservedObject:(id)arg1 notificationName:(id)arg2 table:(id)arg3; +- (void)setupObservationForObservedObject:(id)arg1 selector:(SEL)arg2 notificationName:(id)arg3 table:(id *)arg4; +- (void)setFrameSize:(struct CGSize)arg1; +- (void)didCompleteLayout; +- (void)layoutBottomUp; +- (void)layoutTopDown; +- (void)layoutIfNeeded; +- (void)didLayoutSubview:(id)arg1; +- (id)subviewsOrderedForLayout; +- (void)viewWillDraw; +- (void)_reallyLayoutIfNeededBottomUp; +- (void)_reallyLayoutIfNeededTopDown; +- (void)invalidateLayout; +- (void)viewDidMoveToWindow; +- (id)initWithCoder:(id)arg1; +- (id)initWithFrame:(struct CGRect)arg1; +- (void)_DVTLayoutView_MLSharedInit; +- (void)dealloc; + +@end + +@class DVTExtension, DVTStackBacktrace, DVTViewController, NSMapTable, NSString; + +@interface DVTReplacementView : DVTLayoutView_ML +{ + Class _controllerClass; + NSString *_controllerExtensionIdentifier; + DVTExtension *_controllerExtension; + DVTViewController *_installedViewController; + id _forwardedBindingInfo; + // id _delegate; + int _horizontalContentViewResizingMode; + int _verticalContentViewResizingMode; + struct { + unsigned int _needToReloadSubview:1; + unsigned int _shouldNotifyInstalledViewControllerObservers:1; + unsigned int _delegate_willInstallViewController:1; + unsigned int _delegate_didInstallViewController:1; + unsigned int _delegate_willCloseViewController:1; + unsigned int _delegate_willDisplayInRect:1; + unsigned int _reserved:26; + } _DVTReplacementViewFlags; + BOOL _isGrouped; + NSMapTable *_subviewFrameChangeTokens; + void *_keepSelfAliveUntilCancellationRef; +} + ++ (void)initialize; +@property BOOL isGrouped; // @synthesize isGrouped=_isGrouped; +@property(nonatomic) Class controllerClass; // @synthesize controllerClass=_controllerClass; +@property(nonatomic) int verticalContentViewResizingMode; // @synthesize verticalContentViewResizingMode=_verticalContentViewResizingMode; +@property(nonatomic) int horizontalContentViewResizingMode; // @synthesize horizontalContentViewResizingMode=_horizontalContentViewResizingMode; +- (void)discardEditing; +- (BOOL)commitEditingForAction:(int)arg1 errors:(id)arg2; +- (void)updateBoundControllerExtensionIdentifier; +- (void)updateBoundControllerClass; +@property(copy) NSString *controllerExtensionIdentifier; +- (void)_clearCurrentController; +- (void)_tearDownBinding:(id)arg1; +- (void)_forwardBinding:(id)arg1 toObject:(id)arg2 withKeyPath:(id)arg3 options:(id)arg4; +- (void)_tearDownBindings; +- (void)_forwardBindings; +- (void)layoutBottomUp; +- (void)layoutTopDown; +@property(retain) DVTViewController *installedViewController; +- (void)_tearDownViewController; +- (void)_setupViewController; +- (void)_configureExtension; +- (id)infoForBinding:(id)arg1; +- (void)unbind:(id)arg1; +- (void)bind:(id)arg1 toObject:(id)arg2 withKeyPath:(id)arg3 options:(id)arg4; +- (id)_forwardedBindingInfo; +- (void)_clearInfoForBinding:(id)arg1; +- (void)_recordInfoForBinding:(id)arg1 toObject:(id)arg2 keyPath:(id)arg3 options:(id)arg4; +- (void)primitiveInvalidate; +- (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)arg1 visRect:(struct CGRect)arg2; +- (id)exposedBindings; +- (void)_invalidateLayoutBecauseOfSubviewFrameChange:(id)arg1; +- (void)willRemoveSubview:(id)arg1; +- (void)didAddSubview:(id)arg1; +- (id)initWithFrame:(struct CGRect)arg1; +- (void)awakeFromNib; +- (void)encodeWithCoder:(id)arg1; +- (id)initWithCoder:(id)arg1; +- (void)_commonInit; +//@property(retain, nonatomic) id delegate; +- (id)accessibilityAttributeValue:(id)arg1; +- (BOOL)accessibilityIsIgnored; + +// Remaining properties +@property(nonatomic, retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end + +@class DVTDelayedInvocation, DVTExtension, DVTReplacementView, DVTStateRepository, DVTStateToken, IDEViewController, NSString; + +@interface IDEPreferencesController : NSWindowController +{ + DVTReplacementView *_paneReplacementView; + DVTExtension *_currentExtension; + DVTStateRepository *_stateRepository; + DVTDelayedInvocation *_stateSavingInvocation; + DVTStateToken *_stateToken; +} + ++ (void)configureStateSavingObjectPersistenceByName:(id)arg1; ++ (void)restoreWindowWithIdentifier:(id)arg1 state:(id)arg2 completionHandler:(id)arg3; ++ (id)defaultPreferencesController; +@property(readonly) DVTDelayedInvocation *stateSavingInvocation; // @synthesize stateSavingInvocation=_stateSavingInvocation; +@property(retain) DVTStateToken *stateToken; // @synthesize stateToken=_stateToken; +@property(readonly) DVTStateRepository *stateRepository; // @synthesize stateRepository=_stateRepository; +@property(retain) DVTExtension *currentExtension; // @synthesize currentExtension=_currentExtension; +@property(retain) DVTReplacementView *paneReplacementView; // @synthesize paneReplacementView=_paneReplacementView; +- (BOOL)_loadStateData:(id *)arg1; +- (BOOL)_saveStateData:(id *)arg1; +- (id)_stateRepositoryFilePath; +- (void)commitStateToDictionary:(id)arg1; +- (void)revertStateWithDictionary:(id)arg1; +- (void)replacementView:(id)arg1 willCloseViewController:(id)arg2; +- (void)replacementView:(id)arg1 didInstallViewController:(id)arg2; +- (void)replacementView:(id)arg1 willInstallViewController:(id)arg2; +- (void)stateRepositoryDidChange:(id)arg1; +- (void)selectPreviousTab:(id)arg1; +- (void)selectNextTab:(id)arg1; +- (void)_selectToolbarItem:(id)arg1; +- (void)showPreferencesPanel:(id)arg1; +- (id)toolbarSelectableItemIdentifiers:(id)arg1; +- (id)toolbarDefaultItemIdentifiers:(id)arg1; +- (id)toolbarAllowedItemIdentifiers:(id)arg1; +- (id)toolbar:(id)arg1 itemForItemIdentifier:(id)arg2 willBeInsertedIntoToolbar:(BOOL)arg3; +- (void)windowWillClose:(id)arg1; +- (void)selectPreferencePaneWithIdentifier:(id)arg1; +@property(readonly) IDEViewController *currentPreferencePaneViewController; +@property(readonly) NSString *downloadsPrefPaneIdentifier; +- (void)windowDidLoad; +- (id)initWithWindow:(id)arg1; +- (void)_cachePreferencePaneExtensions; + +@end + +@interface DVTPlugInManager : NSObject +{ + // DVTDispatchLock *_plugInManagerLock; + NSFileManager *_fileManager; + NSString *_hostAppName; + NSString *_hostAppContainingPath; + NSMutableArray *_searchPaths; + NSArray *_extraSearchPaths; + NSMutableSet *_pathExtensions; + NSMutableSet *_exposedCapabilities; + NSMutableSet *_defaultPlugInCapabilities; + NSMutableSet *_requiredPlugInIdentifiers; + NSString *_plugInCachePath; + NSDictionary *_plugInCache; + BOOL _shouldClearPlugInCaches; + id _plugInLocator; + NSMutableDictionary *_plugInsByIdentifier; + NSMutableDictionary *_extensionPointsByIdentifier; + NSMutableDictionary *_extensionsByIdentifier; + NSMutableDictionary *_invalidExtensionsByIdentifier; + NSMutableSet *_warnedExtensionPointFailures; + NSMutableSet *_nonApplePlugInSanitizedStatuses; +} + ++ (void)_setDefaultPlugInManager:(id)arg1; ++ (id)defaultPlugInManager; ++ (void)initialize; +@property(retain) id plugInLocator; // @synthesize plugInLocator=_plugInLocator; +@property BOOL shouldClearPlugInCaches; // @synthesize shouldClearPlugInCaches=_shouldClearPlugInCaches; +- (id)_invalidExtensionWithIdentifier:(id)arg1; +- (id)_plugInCachePath; +- (id)_applicationCachesPath; +- (id)_toolsVersionName; +- (void)_createPlugInObjectsFromCache; +- (BOOL)_savePlugInCacheWithScanRecords:(id)arg1 error:(id *)arg2; +- (BOOL)_removePlugInCacheAndReturnError:(id *)arg1; +- (BOOL)_removePlugInCacheAtPath:(id)arg1 error:(id *)arg2; +- (id)_plugInCacheSaveFailedErrorWithUnderlyingError:(id)arg1; +- (BOOL)_loadPlugInCache:(id *)arg1; +- (BOOL)_cacheCoversPlugInsWithScanRecords:(id)arg1; +- (id)_modificationDateOfFileAtPath:(id)arg1; +@property(readonly) BOOL usePlugInCache; +- (void)_preLoadPlugIns; +- (BOOL)_checkPresenceOfRequiredPlugIns:(id)arg1 error:(id *)arg2; +- (BOOL)_checkMarketingVersionOfApplePlugIns:(id)arg1 error:(id *)arg2; +- (BOOL)shouldPerformConsistencyCheck; +- (void)_registerPlugInsFromScanRecords:(id)arg1; +- (void)_pruneUnusablePlugInsAndScanRecords:(id)arg1; +- (void)_recordSanitizedPluginStatus:(id)arg1 errorMessage:(id)arg2; +- (void)_addSanitizedNonApplePlugInStatusForBundle:(id)arg1 reason:(id)arg2; +@property(readonly) NSSet *sanitizedNonApplePlugInStatuses; +- (void)_createPlugInObjectsFromScanRecords:(id)arg1; +- (void)_applyActivationRulesToScanRecords:(id)arg1; +- (id)_scanForPlugInsInDirectories:(id)arg1 skippingDuplicatesOfPlugIns:(id)arg2; +- (BOOL)_scanForPlugIns:(id *)arg1; +@property(readonly) NSUUID *plugInHostUUID; +@property BOOL hasScannedForPlugIns; // @dynamic hasScannedForPlugIns; +- (id)_scanRecordForBundle:(id)arg1 atPath:(id)arg2; +- (BOOL)_isInitialScan; +- (id)_defaultPathExtensions; +@property(readonly) NSArray *defaultSearchPaths; +- (id)_defaultApplicationSupportSubdirectory; +@property(readonly) NSArray *extraSearchPaths; +- (id)_extensionsForExtensionPoint:(id)arg1 matchingPredicate:(id)arg2; +- (id)sharedExtensionsForExtensionPoint:(id)arg1 matchingPredicate:(id)arg2; +- (id)sharedExtensionWithIdentifier:(id)arg1; +- (id)extensionWithIdentifier:(id)arg1; +- (id)extensionPointWithIdentifier:(id)arg1; +- (id)plugInWithIdentifier:(id)arg1; +- (BOOL)scanForPlugIns:(id *)arg1; +- (id)init; +- (id)_hostAppName; +- (id)_hostAppContainingPath; + +// Remaining properties +@property(copy) NSSet *defaultPlugInCapabilities; // @dynamic defaultPlugInCapabilities; +@property(copy) NSSet *exposedCapabilities; // @dynamic exposedCapabilities; +@property(readonly) NSMutableSet *mutableDefaultPlugInCapabilities; // @dynamic mutableDefaultPlugInCapabilities; +@property(readonly) NSMutableSet *mutableExposedCapabilities; // @dynamic mutableExposedCapabilities; +@property(readonly) NSMutableSet *mutablePathExtensions; // @dynamic mutablePathExtensions; +@property(readonly) NSMutableSet *mutableRequiredPlugInIdentifiers; // @dynamic mutableRequiredPlugInIdentifiers; +@property(readonly) NSMutableArray *mutableSearchPaths; // @dynamic mutableSearchPaths; +@property(copy) NSSet *pathExtensions; // @dynamic pathExtensions; +@property(copy) NSSet *requiredPlugInIdentifiers; // @dynamic requiredPlugInIdentifiers; +@property(copy) NSArray *searchPaths; // @dynamic searchPaths; + +@end + +@class DVTDispatchLock, DVTExtensionPoint, DVTPlugIn, DVTPlugInManager, NSBundle, NSDictionary, NSMutableDictionary, NSString, NSXMLElement; + +@interface DVTExtension : NSObject +{ + +} + ++ (void)initialize; +@property(readonly) DVTExtension *basedOnExtension; // @synthesize basedOnExtension=_basedOnExtension; +@property(readonly) DVTExtensionPoint *extensionPoint; // @synthesize extensionPoint=_extensionPoint; +@property(readonly) DVTPlugIn *plugIn; // @synthesize plugIn=_plugIn; +@property(readonly) NSDictionary *extensionData; // @synthesize extensionData=_extensionData; +@property(readonly) DVTPlugInManager *plugInManager; // @synthesize plugInManager=_plugInManager; +@property(readonly) NSString *name; // @synthesize name=_name; +@property(readonly) NSString *version; // @synthesize version=_version; +@property(readonly) NSString *identifier; // @synthesize identifier=_identifier; +- (id)_localizedStringForString:(id)arg1; +- (BOOL)_fireExtensionFault:(id *)arg1; +- (void)_adjustClassReferencesInParameterData:(id)arg1 usingSchema:(id)arg2; +- (void)_adjustElementClassAttributes:(id)arg1 forKey:(id)arg2 inParameterData:(id)arg3; +- (void)_adjustClassAttribute:(id)arg1 forKey:(id)arg2 inParameterData:(id)arg3; +- (BOOL)_adjustElement:(id)arg1 forKey:(id)arg2 inParameterData:(id)arg3; +- (BOOL)_adjustAttribute:(id)arg1 forKey:(id)arg2 inParameterData:(id)arg3; +- (BOOL)_adjustParameterData:(id)arg1 usingSchema:(id)arg2; +- (BOOL)hasValueForKey:(id)arg1; +- (BOOL)_hasValueForKey:(id)arg1 inParameterData:(id)arg2 usingSchema:(id)arg3; +- (id)valueForKey:(id)arg1 error:(id *)arg2; +- (id)valueForKey:(id)arg1; +- (id)_valueForKey:(id)arg1 inParameterData:(id)arg2 usingSchema:(id)arg3 error:(id *)arg4; +@property(readonly) NSXMLElement *extensionElement; +@property(readonly, getter=isValid) BOOL valid; +@property(readonly) NSBundle *bundle; +- (id)description; +- (void)encodeIntoPropertyList:(id)arg1; +- (void)awakeWithPropertyList:(id)arg1; +- (id)initWithPropertyList:(id)arg1 owner:(id)arg2; +- (id)initWithExtensionData:(id)arg1 plugIn:(id)arg2; + +@end + +@interface IDEEditor : IDEViewController +- (NSArray *)currentSelectedDocumentLocations; +- (DVTSourceExpression *)selectedExpression; +@end + +@interface DVTSourceLandmarkItem : NSObject +- (NSString *)name; +@end + +@interface IDEDocSymbolUtilities : NSObject +- (NSDictionary *)queryInfoFromIndexSymbol:(IDEIndexSymbol *)symbol; +- (id)typeForSymbol:(IDEIndexSymbol *)symbol; +- (void)queryInfoFromIndexSymbol:(IDEIndexSymbol *)symbol handlerBlock:(void(^)(id foo))block; +@end + +@interface IDEQuickHelpQueries : NSObject +@end + +extern NSString *IDEEditorDocumentDidChangeNotification; + +@interface IDESourceCodeDocument +- (id)knownFileReferences; +@end + +@interface Xcode3FileReference +- (id)resolvedFilePath; +@end + +@interface DVTSourceNodeTypes : NSObject +{ +} + ++ (BOOL)nodeType:(short)arg1 conformsToNodeTypeNamed:(id)arg2; ++ (long long)nodeTypesCount; ++ (id)nodeTypeNameForId:(short)arg1; ++ (short)registerNodeTypeNamed:(id)arg1; ++ (void)initialize; + +@end + +@interface DVTSourceModelItem : NSObject +{ + int _rc; + struct _NSRange _relativeLocation; + long long _langId; + long long _token; + DVTSourceModelItem *_parent; + NSMutableArray *_children; + unsigned int _nodeType:15; + unsigned int _isOpaque:1; + unsigned int _dirty:1; + unsigned int _isBlock:1; + unsigned int _ignoreToken:1; + unsigned int _inheritsNodeType:1; + unsigned int _isIdentifier:1; + unsigned int _needsAdjustNodeType:1; + unsigned int _isSimpleToken:1; + unsigned int _isVolatile:1; + unsigned int _needToDirtyRightEdges:1; +} + ++ (id)sourceModelItemWithRange:(struct _NSRange)arg1 language:(long long)arg2 token:(long long)arg3 nodeType:(short)arg4; +@property struct _NSRange relativeLocation; // @synthesize relativeLocation=_relativeLocation; +@property(retain, nonatomic) NSMutableArray *children; // @synthesize children=_children; +@property(nonatomic) DVTSourceModelItem *parent; // @synthesize parent=_parent; +@property long long token; // @synthesize token=_token; +@property long long langId; // @synthesize langId=_langId; +- (void)enumerateIdentifierItemsInRelativeRange:(struct _NSRange)arg1 usingBlock:(id)arg2; +- (void)clearAdjustedNodeTypes; +- (long long)compare:(id)arg1; +- (id)followingItem; +- (id)precedingItem; +- (id)_lastLeafItem; +- (id)_firstLeafItem; +- (id)nextItem; +- (id)previousItem; +- (BOOL)isAncestorOf:(id)arg1; +- (id)childAdjoiningLocation:(unsigned long long)arg1; +- (id)childEnclosingLocation:(unsigned long long)arg1; +- (id)_childEnclosingLocation:(unsigned long long)arg1; +- (unsigned long long)indexOfChildAtLocation:(unsigned long long)arg1; +- (unsigned long long)indexOfChildAfterLocation:(unsigned long long)arg1; +- (unsigned long long)indexOfChildBeforeLocation:(unsigned long long)arg1; +- (unsigned long long)numberOfChildren; +- (void)addChildrenFromArray:(id)arg1 inRange:(struct _NSRange)arg2; +- (void)addChildren:(id)arg1; +- (void)addChild:(id)arg1; +- (void)assignAllParents:(id)arg1; +- (void)assignParents:(id)arg1; +- (BOOL)isVolatile; +- (void)setVolatile:(BOOL)arg1; +@property BOOL needsAdjustNodeType; +- (BOOL)needToDirtyRightEdges; +- (void)setNeedToDirtyRightEdges:(BOOL)arg1; +- (BOOL)isSimpleToken; +- (void)setIsSimpleToken:(BOOL)arg1; +- (BOOL)inheritsNodeType; +- (void)setInheritsNodeType:(BOOL)arg1; +- (BOOL)ignoreToken; +- (void)setIgnoreToken:(BOOL)arg1; +- (BOOL)dirty; +- (void)setDirty:(BOOL)arg1; +- (BOOL)isIdentifier; +- (short)rawNodeType; +- (BOOL)isOpaque; +- (void)setIsOpaque:(BOOL)arg1; +- (short)nodeType; +- (void)setNodeType:(short)arg1; +- (struct _NSRange)innerRange; +- (void)offsetBy:(long long)arg1; +- (void)setRange:(struct _NSRange)arg1; +- (struct _NSRange)range; +- (id)enclosingBlock; +- (long long)blockDepth; +- (void)setIsBlock:(BOOL)arg1; +- (BOOL)isBlock; +- (void)dirtyRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (void)dirtyRelativeRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (void)validate; +- (id)dumpContext; +- (id)contextArray; +- (id)simpleDescription; +- (id)diffableDescription; +- (id)description; +- (id)innerDescription:(id)arg1 showSelf:(BOOL)arg2; +- (id)initWithRange:(struct _NSRange)arg1 language:(long long)arg2 token:(long long)arg3 nodeType:(short)arg4; +- (BOOL)_isDeallocating; +- (BOOL)_tryRetain; +- (unsigned long long)retainCount; +- (oneway void)release; +- (id)retain; + +@end + +#pragma mark - + +@interface DVTSourceModel : NSObject +{ + struct _NSRange _dirtyRange; + long long _batchDelta; + DVTSourceModelItem *_sourceItems; + BOOL _isDoingBatchEdit; +} + ++ (id)editorResponsivenessPerformanceLogAspect; ++ (void)initialize; +@property BOOL isDoingBatchEdit; // @synthesize isDoingBatchEdit=_isDoingBatchEdit; +@property long long batchDelta; // @synthesize batchDelta=_batchDelta; +@property struct _NSRange dirtyRange; // @synthesize dirtyRange=_dirtyRange; +@property(retain) DVTSourceModelItem *sourceItems; // @synthesize sourceItems=_sourceItems; +- (id)objCMethodNameForItem:(id)arg1 nameRanges:(id *)arg2; +- (BOOL)isItemDictionaryLiteral:(id)arg1; +- (BOOL)isItemObjectLiteral:(id)arg1; +- (BOOL)isItemForStatement:(id)arg1; +- (BOOL)isItemSemanticBlock:(id)arg1; +- (BOOL)isItemBracketExpression:(id)arg1; +- (BOOL)isItemAngleExpression:(id)arg1; +- (BOOL)isItemParenExpression:(id)arg1; +- (BOOL)isPostfixExpressionAtLocation:(unsigned long long)arg1; +- (BOOL)isInTokenizableCodeAtLocation:(unsigned long long)arg1; +- (BOOL)isInPlainCodeAtLocation:(unsigned long long)arg1; +- (BOOL)isInKeywordAtLocation:(unsigned long long)arg1; +- (BOOL)isIncompletionPlaceholderAtLocation:(unsigned long long)arg1; +- (BOOL)isInNumberConstantAtLocation:(unsigned long long)arg1; +- (BOOL)isInCharacterConstantAtLocation:(unsigned long long)arg1; +- (BOOL)isInIdentifierAtLocation:(unsigned long long)arg1; +- (BOOL)isInStringConstantAtLocation:(unsigned long long)arg1; +- (BOOL)isInIncludeStatementAtLocation:(unsigned long long)arg1; +- (BOOL)isInPreprocessorStatementAtLocation:(unsigned long long)arg1; +- (BOOL)isInDocCommentAtLocation:(unsigned long long)arg1; +- (BOOL)isInCommentAtLocation:(unsigned long long)arg1; +- (id)completionPlaceholderItemAtLocation:(unsigned long long)arg1; +- (id)identOrKeywordItemAtLocation:(unsigned long long)arg1; +- (id)objCDeclaratorItemAtLocation:(unsigned long long)arg1; +- (id)numberConstantAtLocation:(unsigned long long)arg1; +- (id)characterConstantAtLocation:(unsigned long long)arg1; +- (id)stringConstantAtLocation:(unsigned long long)arg1; +- (id)moduleImportStatementAtLocation:(unsigned long long)arg1; +- (id)includeStatementAtLocation:(unsigned long long)arg1; +- (id)preprocessorStatementAtLocation:(unsigned long long)arg1; +- (id)docCommentAtLocation:(unsigned long long)arg1; +- (id)commentAtLocation:(unsigned long long)arg1; +- (id)placeholderItemsFromItem:(id)arg1; +- (id)identifierItemsFromItem:(id)arg1; +- (id)commentBlockItems; +- (id)functionsAndMethodItems; +- (id)classItems; +- (void)addBlockItemsInTypeList:(long long *)arg1 fromItem:(id)arg2 toArray:(id)arg3; +- (void)addIdentifierItemsFromItem:(id)arg1 toArray:(id)arg2; +- (void)addItemsInTypeList:(long long *)arg1 fromItem:(id)arg2 toArray:(id)arg3; +- (id)functionOrMethodDefinitionAtLocation:(unsigned long long)arg1; +- (id)functionOrMethodAtLocation:(unsigned long long)arg1; +- (id)interfaceDeclarationAtLocation:(unsigned long long)arg1; +- (id)typeDeclarationAtLocation:(unsigned long long)arg1; +- (id)classAtLocation:(unsigned long long)arg1; +- (id)itemNameAtLocation:(unsigned long long)arg1 inTypeList:(long long *)arg2 nameRanges:(id *)arg3 scopeRange:(struct _NSRange *)arg4; +- (id)nameOfItem:(id)arg1 nameRanges:(id *)arg2 scopeRange:(struct _NSRange *)arg3; +- (void)enumerateIdentifierItemsInRange:(struct _NSRange)arg1 usingBlock:(id)arg2; +- (id)itemAtLocation:(unsigned long long)arg1 ofType:(id)arg2; +- (id)itemAtLocation:(unsigned long long)arg1 inTypeList:(long long *)arg2; +- (long long *)typeListForSpecNames:(id)arg1; +- (id)builtUpNameForItem:(id)arg1 nameRanges:(id *)arg2; +- (id)_builtUpNameForItem:(id)arg1 mutableNameRanges:(id)arg2; +- (id)_builtUpNameForSubTree:(id)arg1 mutableNameRanges:(id)arg2; +- (id)objectLiteralItemAtLocation:(unsigned long long)arg1; +- (id)parenItemAtLocation:(unsigned long long)arg1; +- (id)parenLikeItemAtLocation:(unsigned long long)arg1; +- (id)foldableBlockItemForLocation:(unsigned long long)arg1; +- (id)foldableBlockItemForLineAtLocation:(unsigned long long)arg1; +- (id)blockItemAtLocation:(unsigned long long)arg1; +- (long long)indentForItem:(id)arg1; +- (id)adjoiningItemAtLocation:(unsigned long long)arg1; +- (id)enclosingItemAtLocation:(unsigned long long)arg1; +- (id)_topLevelSourceItem; +- (void)parse; +- (void)doingBatchEdit:(BOOL)arg1; +- (void)dirtyRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (id)initWithSourceBufferProvider:(id)arg1; + +@end + +#pragma mark - + +@interface DVTSourceTextView : NSTextView + +-(void)_commonInitDVTSourceTextView; + +@end + +#pragma mark - + +@protocol DVTSourceLanguageSourceModelService +- (struct _NSRange)rangeForBlockContainingRange:(struct _NSRange)arg1; +- (NSString *)stringForItem:(DVTSourceModelItem *)arg1; +- (DVTSourceModelItem *)commonSourceModelItemAtRange:(struct _NSRange)arg1; +- (DVTSourceModelItem *)sourceModelItemAtCharacterIndex:(unsigned long long)arg1; +- (DVTSourceModelItem *)sourceModelItemAtCharacterIndex:(unsigned long long)arg1 affinity:(unsigned long long)arg2; +- (DVTSourceModel *)sourceModelWithoutParsing; +- (DVTSourceModel *)sourceModel; +@end + +@interface DVTTextStorage : NSTextStorage + +@property DVTSourceModel* sourceModel; +@property(readonly) id sourceModelService; // DVTSourceTextStorage + +@property(readonly) unsigned long long currentChangeIndex; + +-(NSColor*)colorAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; +-(void)fixSyntaxColoringInRange:(NSRange)range; +-(short)nodeTypeAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; +// FIXME: Workaround for NSObject+YOLO buggyness +-(NSColor*)yl_colorAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; +- (id)sourceModelItemAtCharacterIndex:(unsigned long long)arg1; //DVTSourceTextStorage in Xcode 5, DVTSourceLanguageSourceModelService protocol in Xcode 5.1 + +@end + +@class DVTCustomDataSpecifier, DVTPointerArray, DVTStackBacktrace, NSColor, NSFont, NSImage, NSString, NSURL; + +@interface DVTFontAndColorTheme : NSObject +{ + NSString *_name; + NSImage *_image; + NSURL *_dataURL; + DVTCustomDataSpecifier *_customDataSpecifier; + NSColor *_sourceTextBackgroundColor; + NSColor *_sourceTextSidebarBackgroundColor; + NSColor *_sourceTextSidebarEdgeColor; + NSColor *_sourceTextSidebarNumbersColor; + NSColor *_sourceTextFoldbarBackgroundColor; + NSColor *_sourceTextSelectionColor; + NSColor *_sourceTextSecondarySelectionColor; + NSColor *_sourceTextInsertionPointColor; + NSColor *_sourceTextInvisiblesColor; + NSColor *_sourceTextBlockDimBackgroundColor; + NSColor *_sourceTextTokenizedBorderColor; + NSColor *_sourceTextTokenizedBackgroundColor; + NSColor *_sourceTextTokenizedBorderSelectedColor; + NSColor *_sourceTextTokenizedBackgroundSelectedColor; + NSColor *_consoleTextBackgroundColor; + NSColor *_consoleTextSelectionColor; + NSColor *_consoleTextSecondarySelectionColor; + NSColor *_consoleTextInsertionPointColor; + NSColor *_consoleDebuggerPromptTextColor; + NSColor *_consoleDebuggerInputTextColor; + NSColor *_consoleDebuggerOutputTextColor; + NSColor *_consoleExecutableInputTextColor; + NSColor *_consoleExecutableOutputTextColor; + NSFont *_consoleDebuggerPromptTextFont; + NSFont *_consoleDebuggerInputTextFont; + NSFont *_consoleDebuggerOutputTextFont; + NSFont *_consoleExecutableInputTextFont; + NSFont *_consoleExecutableOutputTextFont; + NSColor *_debuggerInstructionPointerColor; + NSColor *_sourcePlainTextColor; + NSFont *_sourcePlainTextFont; + DVTPointerArray *_syntaxColorsByNodeType; + DVTPointerArray *_syntaxFontsByNodeType; + NSColor *_sourceTextCompletionPreviewColor; + BOOL _builtIn; + BOOL _loadedData; + BOOL _contentNeedsSaving; + BOOL _hasMultipleSourceTextFonts; +} + ++ (id)_defaultSourceCodeFont; ++ (id)keyPathsForValuesAffectingConsoleTextSecondarySelectionColor; ++ (id)keyPathsForValuesAffectingSourceTextSecondarySelectionColor; ++ (id)titleForNewPreferenceSetFromTemplate; ++ (id)preferenceSetsListHeader; ++ (id)preferenceSetsFileExtension; ++ (id)defaultKeyForExcludedBuiltInPreferenceSets; ++ (id)defaultKeyForCurrentPreferenceSet; ++ (id)builtInPreferenceSetsDirectoryURL; ++ (id)systemPreferenceSet; ++ (id)preferenceSetGroupingName; ++ (id)_nodeTypesIncludedInPreferences; ++ (id)_stringRepresentationOfFont:(id)arg1; ++ (id)_fontWithName:(id)arg1 size:(double)arg2; ++ (id)currentTheme; ++ (id)preferenceSetsManager; ++ (void)initialize; +@property(readonly) BOOL loadedData; // @synthesize loadedData=_loadedData; +@property(readonly) DVTPointerArray *syntaxFontsByNodeType; // @synthesize syntaxFontsByNodeType=_syntaxFontsByNodeType; +@property(readonly) DVTPointerArray *syntaxColorsByNodeType; // @synthesize syntaxColorsByNodeType=_syntaxColorsByNodeType; +@property(nonatomic) BOOL hasMultipleSourceTextFonts; // @synthesize hasMultipleSourceTextFonts=_hasMultipleSourceTextFonts; +@property BOOL contentNeedsSaving; // @synthesize contentNeedsSaving=_contentNeedsSaving; +@property(retain) DVTCustomDataSpecifier *customDataSpecifier; // @synthesize customDataSpecifier=_customDataSpecifier; +@property(readonly, getter=isBuiltIn) BOOL builtIn; // @synthesize builtIn=_builtIn; +@property(retain) NSImage *image; // @synthesize image=_image; +@property(copy) NSString *name; // @synthesize name=_name; +- (void)setFont:(id)arg1 forNodeTypes:(id)arg2; +- (void)setColor:(id)arg1 forNodeTypes:(id)arg2; +- (void)_setColorOrFont:(id)arg1 forNodeTypes:(id)arg2; +- (id)fontForNodeType:(short)arg1; +- (id)colorForNodeType:(short)arg1; +@property(readonly) NSFont *sourcePlainTextFont; +@property(readonly) NSColor *sourcePlainTextColor; +- (void)setDebuggerInstructionPointerColor:(id)arg1; +- (void)setConsoleExecutableOutputTextFont:(id)arg1; +- (void)setConsoleExecutableInputTextFont:(id)arg1; +- (void)setConsoleDebuggerOutputTextFont:(id)arg1; +- (void)setConsoleDebuggerInputTextFont:(id)arg1; +- (void)setConsoleDebuggerPromptTextFont:(id)arg1; +- (void)setConsoleExecutableOutputTextColor:(id)arg1; +- (void)setConsoleExecutableInputTextColor:(id)arg1; +- (void)setConsoleDebuggerOutputTextColor:(id)arg1; +- (void)setConsoleDebuggerInputTextColor:(id)arg1; +- (void)setConsoleDebuggerPromptTextColor:(id)arg1; +- (void)primitiveSetConsoleDebuggerPromptTextColor:(id)arg1; +- (void)setConsoleTextInsertionPointColor:(id)arg1; +- (void)setConsoleTextSelectionColor:(id)arg1; +- (void)setConsoleTextBackgroundColor:(id)arg1; +- (void)setSourceTextInvisiblesColor:(id)arg1; +- (void)setSourceTextInsertionPointColor:(id)arg1; +- (void)setSourceTextSelectionColor:(id)arg1; +- (void)setSourceTextBackgroundColor:(id)arg1; +- (void)_setColorOrFont:(id)arg1 forKey:(id)arg2 colorOrFontivar:(id *)arg3; +@property(readonly) NSColor *debuggerInstructionPointerColor; +@property(readonly) NSFont *consoleExecutableOutputTextFont; +@property(readonly) NSFont *consoleExecutableInputTextFont; +@property(readonly) NSFont *consoleDebuggerOutputTextFont; +@property(readonly) NSFont *consoleDebuggerInputTextFont; +@property(readonly) NSFont *consoleDebuggerPromptTextFont; +@property(readonly) NSColor *consoleExecutableOutputTextColor; +@property(readonly) NSColor *consoleExecutableInputTextColor; +@property(readonly) NSColor *consoleDebuggerOutputTextColor; +@property(readonly) NSColor *consoleDebuggerInputTextColor; +@property(readonly) NSColor *consoleDebuggerPromptTextColor; +@property(readonly) NSColor *consoleTextInsertionPointColor; +@property(readonly) NSColor *consoleTextSecondarySelectionColor; +@property(readonly) NSColor *consoleTextSelectionColor; +@property(readonly) NSColor *consoleTextBackgroundColor; +@property(readonly) NSColor *sourceTextTokenizedBackgroundSelectedColor; +@property(readonly) NSColor *sourceTextTokenizedBorderSelectedColor; +@property(readonly) NSColor *sourceTextTokenizedBackgroundColor; +@property(readonly) NSColor *sourceTextTokenizedBorderColor; +@property(readonly) NSColor *sourceTextLinkColor; +@property(readonly) NSColor *sourceTextCompletionPreviewColor; +@property(readonly) NSColor *sourceTextBlockDimBackgroundColor; +@property(readonly) NSColor *sourceTextInvisiblesColor; +@property(readonly) NSColor *sourceTextInsertionPointColor; +@property(readonly) NSColor *sourceTextSecondarySelectionColor; +@property(readonly) NSColor *sourceTextSelectionColor; +@property(readonly) NSColor *sourceTextFoldbarBackgroundColor; +@property(readonly) NSColor *sourceTextSidebarNumbersColor; +@property(readonly) NSColor *sourceTextSidebarEdgeColor; +@property(readonly) NSColor *sourceTextSidebarBackgroundColor; +@property(readonly) NSColor *sourceTextBackgroundColor; +- (id)description; +@property(readonly) NSString *localizedName; +- (void)_updateHasMultipleSourceTextFonts; +- (void)_updateDerivedColors; +- (BOOL)_loadFontsAndColors; +- (id)dataRepresentationWithError:(id *)arg1; +- (void)primitiveInvalidate; +- (id)initWithCustomDataSpecifier:(id)arg1 basePreferenceSet:(id)arg2; +- (id)initWithName:(id)arg1 dataURL:(id)arg2; +- (id)_initWithName:(id)arg1 syntaxColorsByNodeType:(id)arg2 syntaxFontsByNodeType:(id)arg3; +- (void)_themeCommonInit; +- (id)init; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end + +@interface DVTControllerContentView : DVTLayoutView_ML +{ + struct CGSize _minContentFrameSize; + struct CGSize _maxContentFrameSize; + DVTViewController *_viewController; + NSWindow *_kvoWindow; + int _horizontalAlignmentWhenClipping; + int _horizontalAlignmentWhenPadding; + int _verticalAlignmentWhenClipping; + int _verticalAlignmentWhenPadding; + int _verticalContentViewResizingMode; + int _horizontalContentViewResizingMode; + BOOL _isInstalled; + BOOL _isPadding; + BOOL _isReplacingSubview; + BOOL _disablePaddingWarning; + BOOL _isGrouped; + NSMutableArray *_frameChangeTokens; + NSArray *_currentContentViewConstraints; + BOOL _constraintsCameFromNib; +} + ++ (void)initialize; +@property BOOL isGrouped; // @synthesize isGrouped=_isGrouped; +@property BOOL disablePaddingWarning; // @synthesize disablePaddingWarning=_disablePaddingWarning; +@property(nonatomic) int verticalContentViewResizingMode; // @synthesize verticalContentViewResizingMode=_verticalContentViewResizingMode; +@property(nonatomic) int horizontalContentViewResizingMode; // @synthesize horizontalContentViewResizingMode=_horizontalContentViewResizingMode; +@property(nonatomic) int verticalAlignmentWhenClipping; // @synthesize verticalAlignmentWhenClipping=_verticalAlignmentWhenClipping; +@property(nonatomic) int horizontalAlignmentWhenClipping; // @synthesize horizontalAlignmentWhenClipping=_horizontalAlignmentWhenClipping; +@property(nonatomic) struct CGSize minimumContentViewFrameSize; // @synthesize minimumContentViewFrameSize=_minContentFrameSize; +@property(nonatomic) int verticalAlignmentWhenPadding; // @synthesize verticalAlignmentWhenPadding=_verticalAlignmentWhenPadding; +@property(nonatomic) int horizontalAlignmentWhenPadding; // @synthesize horizontalAlignmentWhenPadding=_horizontalAlignmentWhenPadding; +@property(nonatomic) struct CGSize maximumContentViewFrameSize; // @synthesize maximumContentViewFrameSize=_maxContentFrameSize; +- (BOOL)performKeyEquivalent:(id)arg1; +- (void)_invalidateLayoutBecauseOfSubviewFrameChange:(id)arg1; +- (void)willRemoveSubview:(id)arg1; +- (void)didAddSubview:(id)arg1; +- (void)windowWillClose:(id)arg1; +- (void)viewDidMoveToSuperview; +- (void)viewDidMoveToWindow; +- (void)viewWillMoveToSuperview:(id)arg1; +- (void)viewWillMoveToWindow:(id)arg1; +@property(readonly) BOOL isInstalled; +- (void)_viewDidInstall; +- (void)_viewWillUninstall; +@property(retain) IBOutlet NSView *contentView; +- (void)replaceSubview:(id)arg1 with:(id)arg2; +- (void)setSubviews:(id)arg1; +- (void)addSubview:(id)arg1; +- (void)layoutBottomUp; +- (void)layoutTopDown; +- (void)setTranslatesAutoresizingMaskIntoConstraints:(BOOL)arg1; +- (void)_syncContentViewTranslatesAutoresizingMaskIntoConstraintsValue; +- (void)updateConstraints; +- (void)setNextResponder:(id)arg1; +@property(retain, nonatomic) DVTViewController *viewController; +- (void)_checkKvoWindow; +@property(readonly) NSWindow *kvoWindow; +- (void)primitiveInvalidate; +- (id)initWithFrame:(struct CGRect)arg1; +- (void)awakeFromNib; +- (id)accessibilityAttributeValue:(id)arg1; +- (BOOL)accessibilityIsIgnored; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end + +@interface DVTBorderedView : DVTLayoutView_ML +{ + NSColor *_topBorderColor; + NSColor *_bottomBorderColor; + NSColor *_leftBorderColor; + NSColor *_rightBorderColor; + NSColor *_topInactiveBorderColor; + NSColor *_bottomInactiveBorderColor; + NSColor *_leftInactiveBorderColor; + NSColor *_rightInactiveBorderColor; + NSColor *_shadowColor; + NSColor *_backgroundColor; + NSColor *_inactiveBackgroundColor; + NSGradient *_backgroundGradient; + NSGradient *_inactiveBackgroundGradient; + NSView *_contentView; + int _verticalContentViewResizingMode; + int _horizontalContentViewResizingMode; + int _borderSides; + int _shadowSides; + // id _windowActivationObservation; + // int _highlightSides; + // id _backgroundPainter; +} + +//@property(retain) id backgroundPainter; // @synthesize backgroundPainter=_backgroundPainter; +@property(nonatomic) int highlightSides; // @synthesize highlightSides=_highlightSides; +@property(nonatomic) int verticalContentViewResizingMode; // @synthesize verticalContentViewResizingMode=_verticalContentViewResizingMode; +@property(copy, nonatomic) NSColor *topInactiveBorderColor; // @synthesize topInactiveBorderColor=_topInactiveBorderColor; +@property(copy, nonatomic) NSColor *topBorderColor; // @synthesize topBorderColor=_topBorderColor; +@property int shadowSides; // @synthesize shadowSides=_shadowSides; +@property(copy) NSColor *shadowColor; // @synthesize shadowColor=_shadowColor; +@property(copy, nonatomic) NSColor *rightInactiveBorderColor; // @synthesize rightInactiveBorderColor=_rightInactiveBorderColor; +@property(copy, nonatomic) NSColor *rightBorderColor; // @synthesize rightBorderColor=_rightBorderColor; +@property(copy, nonatomic) NSColor *leftInactiveBorderColor; // @synthesize leftInactiveBorderColor=_leftInactiveBorderColor; +@property(copy, nonatomic) NSColor *leftBorderColor; // @synthesize leftBorderColor=_leftBorderColor; +@property(copy, nonatomic) NSGradient *inactiveBackgroundGradient; // @synthesize inactiveBackgroundGradient=_inactiveBackgroundGradient; +@property(copy, nonatomic) NSColor *inactiveBackgroundColor; // @synthesize inactiveBackgroundColor=_inactiveBackgroundColor; +@property(nonatomic) int horizontalContentViewResizingMode; // @synthesize horizontalContentViewResizingMode=_horizontalContentViewResizingMode; +@property(nonatomic) NSView *contentView; // @synthesize contentView=_contentView; +@property(copy, nonatomic) NSColor *bottomInactiveBorderColor; // @synthesize bottomInactiveBorderColor=_bottomInactiveBorderColor; +@property(copy, nonatomic) NSColor *bottomBorderColor; // @synthesize bottomBorderColor=_bottomBorderColor; +@property(nonatomic) int borderSides; // @synthesize borderSides=_borderSides; +@property(copy, nonatomic) NSGradient *backgroundGradient; // @synthesize backgroundGradient=_backgroundGradient; +@property(copy, nonatomic) NSColor *backgroundColor; // @synthesize backgroundColor=_backgroundColor; +- (void)window:(id)arg1 didChangeActivationState:(long long)arg2; +- (void)viewWillMoveToWindow:(id)arg1; +- (void)drawRect:(struct CGRect)arg1; +- (void)drawBorderInRect:(struct CGRect)arg1; +- (void)drawHighlightInRect:(struct CGRect)arg1; +- (void)drawBackgroundInRect:(struct CGRect)arg1; +- (BOOL)_isInactive; +- (void)layoutBottomUp; +- (void)layoutTopDown; +- (void)_contentViewFrameDidChange:(id)arg1; +- (struct CGSize)frameSizeForContentSize:(struct CGSize)arg1; +- (struct CGSize)boundSizeForContentSize:(struct CGSize)arg1; +@property(readonly) struct CGRect contentRect; +- (struct CGRect)_contentRectExcludingShadow; +//- (CDStruct_bf6d4a14)_contentInset; +//- (CDStruct_bf6d4a14)_borderInset; +//- (CDStruct_bf6d4a14)_shadowInset; +- (BOOL)isShowingShadow; +- (void)setAllInactiveBordersToColor:(id)arg1; +- (void)setAllBordersToColor:(id)arg1; +- (void)setShadowSide:(int)arg1; +- (void)_setBorderSides:(int)arg1; +- (void)dealloc; +- (void)encodeWithCoder:(id)arg1; +- (id)initWithCoder:(id)arg1; +- (id)initWithFrame:(struct CGRect)arg1; + +@end + +@class DVTBorderedView, DVTObservingToken, DVTReplacementView, DVTTabChooserView, NSArray, NSArrayController, NSColor, NSFont, NSObjectController, NSTableView, NSView; + +@interface IDEFontAndColorPrefsPaneController : IDEViewController +{ + DVTReplacementView *preferenceSetReplacementView; + DVTBorderedView *_fontAndColorBorderView; + DVTTabChooserView *_tabChooserView; + NSTableView *_fontAndColorItemTable; + NSArrayController *_categoriesArrayController; + NSObjectController *_currentThemeObjectController; + DVTBorderedView *_generalColorView; + NSView *_sourceEditorGeneralView; + NSView *_consoleGeneralView; + NSArray *_fontAndColorItems; + DVTObservingToken *_selectedTabObserver; + DVTObservingToken *_backgroundColorObserver; + DVTObservingToken *_selectionIndexesObserver; +} + ++ (void)initialize; +@property(readonly) NSArrayController *categoriesArrayController; // @synthesize categoriesArrayController=_categoriesArrayController; +@property(retain) NSArray *fontAndColorItems; // @synthesize fontAndColorItems=_fontAndColorItems; +- (void)changeFont:(id)arg1; +- (void)chooseFont:(id)arg1; +- (double)tableView:(id)arg1 heightOfRow:(long long)arg2; +- (void)tableView:(id)arg1 willDisplayCell:(id)arg2 forTableColumn:(id)arg3 row:(long long)arg4; +- (id)_theme; +- (void)_sourceTextColorsChanged:(id)arg1; +- (void)_updateBindingsBasedOnSelectedTab; +- (void)_handleTabChanged; +- (void)_initTabChooserView; +- (void)viewWillUninstall; +- (void)viewDidInstall; +- (void)loadView; +- (void)_updateFontPickerAndColorWell; +@property(copy) NSFont *combinedSyntaxFont; +@property(copy) NSColor *combinedSyntaxColor; +- (void)primitiveInvalidate; + +@end + +@class DVTChoice, NSArray, NSMapTable, NSMutableArray, NSSearchField; + +@interface DVTTabChooserView : DVTBorderedView +{ + double *_currentChoiceXCoordinates; + NSSearchField *_searchField; + DVTChoice *_selectedChoice; + long long _pressedIndex; + long long _mouseDownIndex; + NSMutableArray *_choices; + NSMapTable *_accessibilityProxiesByChoice; + struct { + unsigned int hasSearchField:1; + unsigned int _reserved:7; + } _flags; + // id _delegate; + double _choicesOffset; +} + ++ (id)keyPathsForValuesAffectingSelectedChoice; ++ (void)initialize; +@property double choicesOffset; // @synthesize choicesOffset=_choicesOffset; +//@property __weak id delegate; // @synthesize delegate=_delegate; +@property(retain, nonatomic) NSSearchField *searchField; // @synthesize searchField=_searchField; +- (id)accessibilityHitTest:(struct CGPoint)arg1; +- (BOOL)accessibilityIsAttributeSettable:(id)arg1; +- (id)accessibilityAttributeValue:(id)arg1; +- (id)accessibilityAttributeNames; +- (BOOL)accessibilityIsIgnored; +- (id)accessibilityProxyForChoice:(id)arg1; +@property BOOL hasSearchField; +- (void)installSearchField; +- (struct CGRect)searchFieldFrame; +- (void)mouseUp:(id)arg1; +- (void)mouseDragged:(id)arg1; +- (void)mouseDown:(id)arg1; +- (BOOL)acceptsFirstMouse:(id)arg1; +- (id)choiceForEvent:(id)arg1 index:(long long *)arg2; +- (id)choiceForPoint:(struct CGPoint)arg1 index:(long long *)arg2; +- (void)drawRect:(struct CGRect)arg1; +- (void)drawChoiceAtIndex:(long long)arg1; +- (void)drawOneChoice; +- (id)attributedTitleForChoice:(id)arg1 forceActive:(BOOL)arg2; +- (void)updateGeometryForDrawing; +- (struct CGRect)rectForChoice:(id)arg1; +- (struct CGRect)rectForChoiceAtIndex:(long long)arg1; +@property(readonly) double minimumWidth; +- (struct CGRect)totalChoicesRect; +- (double)totalWidth; +- (double)widthForChoiceAtIndex:(long long)arg1; +- (double)widthForChoice:(id)arg1; +- (void)updateBoundSelectedObjects; +@property(retain) DVTChoice *selectedChoice; // @synthesize selectedChoice=_selectedChoice; +@property(readonly) NSMutableArray *mutableChoices; +- (void)updateBoundContent; +@property(copy) NSArray *choices; +- (id)choiceWithIdentifier:(id)arg1; +- (id)choiceAtIndex:(long long)arg1; +- (void)viewWillMoveToWindow:(id)arg1; +- (void)dealloc; +- (id)initWithCoder:(id)arg1; +- (id)initWithFrame:(struct CGRect)arg1; +- (void)commonInit; +- (id)dvtExtraBindings; + +@end + + +@interface DVTChoice : NSObject +{ + NSString *_title; + NSString *_toolTip; + NSImage *_image; + NSString *_identifier; + id _representedObject; + BOOL _enabled; +} + +@property(getter=isEnabled) BOOL enabled; // @synthesize enabled=_enabled; +@property(readonly) id representedObject; // @synthesize representedObject=_representedObject; +@property(copy) NSString *identifier; // @synthesize identifier=_identifier; +@property(readonly) NSImage *image; // @synthesize image=_image; +@property(readonly) NSString *toolTip; // @synthesize toolTip=_toolTip; +@property(readonly) NSString *title; // @synthesize title=_title; +- (id)description; +- (id)initWithTitle:(id)arg1 toolTip:(id)arg2 image:(id)arg3 representedObject:(id)arg4; + +@end + +@interface IDEFontAndColorFontTransformer : NSValueTransformer +{ +} + ++ (BOOL)allowsReverseTransformation; ++ (Class)transformedValueClass; +- (id)transformedValue:(id)arg1; + +@end + +// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +// +// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +// +// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +//// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +//// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +//// +// DVTInterfaces.h +// Polychromatic +// +// Created by Kolin Krewinkel on 3/30/14. +// Copyright 2014 Apple Inc. All rights reserved. +// +// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. +// \ No newline at end of file diff --git a/SCXcodeMinimap/Xcode Headers/DVTCompletingTextView.h b/SCXcodeMinimap/Xcode Headers/DVTCompletingTextView.h new file mode 100644 index 0000000..06b02d4 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTCompletingTextView.h @@ -0,0 +1,123 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import + +@class DVTFoldingLayoutManager, DVTFoldingManager, DVTSourceCodeLanguage, DVTTextCompletionController, DVTTextCompletionDataSource, NSColor; + +@interface DVTCompletingTextView : NSTextView +{ + DVTTextCompletionController *_completionController; + DVTTextCompletionDataSource *_completionsDataSource; + NSColor *_secondarySelectedTextBackgroundColor; + unsigned long long _accessoryAnnotationWidth; + unsigned long long _modifierFlagsAtLastSingleMouseDown; + BOOL _tabSelectsNextPlaceholder; +} + ++ (id)readableTextPasteboardTypes; ++ (long long)scrollerKnobStyleForBackgroundColor:(id)arg1; ++ (id)_operatorChars; ++ (id)autoCompleteChars; ++ (id)identifierChars; ++ (id)_identifierCharsForImportStatements; ++ (BOOL)appSupportsActionMonitoring; +@property(copy, nonatomic) NSColor *secondarySelectedTextBackgroundColor; // @synthesize secondarySelectedTextBackgroundColor=_secondarySelectedTextBackgroundColor; +@property BOOL tabSelectsNextPlaceholder; // @synthesize tabSelectsNextPlaceholder=_tabSelectsNextPlaceholder; +@property(readonly) DVTTextCompletionController *completionController; // @synthesize completionController=_completionController; +@property unsigned long long modifierFlagsAtLastSingleMouseDown; // @synthesize modifierFlagsAtLastSingleMouseDown=_modifierFlagsAtLastSingleMouseDown; +@property unsigned long long accessoryAnnotationWidth; // @synthesize accessoryAnnotationWidth=_accessoryAnnotationWidth; +- (void)setMarkedText:(id)arg1 selectedRange:(struct _NSRange)arg2; +- (void)becomeMainWindow; +- (void)resignKeyWindow; +- (void)becomeKeyWindow; +- (BOOL)becomeFirstResponder; +- (BOOL)resignFirstResponder; +- (void)_invalidateDisplayForViewStatusChange; +- (void)setBackgroundColor:(id)arg1; +- (void)updateScrollerKnobStyle; +- (BOOL)readSelectionFromPasteboard:(id)arg1 type:(id)arg2; +- (id)attributedStringForCompletionPlaceholderCell:(id)arg1 atCharacterIndex:(unsigned long long)arg2 withDefaultAttributes:(id)arg3; +- (void)doubleClickedOnCell:(id)arg1 inRect:(struct CGRect)arg2 atIndexInToken:(unsigned long long)arg3; +- (void)clickedOnCell:(id)arg1 inRect:(struct CGRect)arg2 atIndexInToken:(unsigned long long)arg3; +- (BOOL)isThereOnlyATokenAttachmentAtUserTextChange; +- (void)replaceSelectedTokenWithTokenText; +- (void)useSelectionForFind:(id)arg1; +- (struct _NSRange)_characterRangeForRect:(struct CGRect)arg1; +- (struct _NSRange)clipViewBoundsCharacterRange; +- (struct _NSRange)visibleCharacterRange; +- (void)mouseDown:(id)arg1; +- (void)setNeedsDisplayInRect:(struct CGRect)arg1 avoidAdditionalLayout:(BOOL)arg2; +- (void)drawRect:(struct CGRect)arg1; +- (void)_drawRect:(struct CGRect)arg1 clip:(BOOL)arg2; +- (void)_drawOverlayRect:(struct CGRect)arg1; +- (void)setSelectedRange:(struct _NSRange)arg1; +- (void)setSelectedRanges:(id)arg1 affinity:(unsigned long long)arg2 stillSelecting:(BOOL)arg3; +- (void)_replaceFoldWithContents:(id)arg1; +- (id)_formatBlockLiteralFromDeclaration:(id)arg1 lineCount:(unsigned long long *)arg2; +- (void)textStorage:(id)arg1 didEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; +- (void)textStorage:(id)arg1 willEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; +- (id)textStorage; +- (id)layoutManager; +- (void)didInsertCompletionTextAtRange:(struct _NSRange)arg1; +- (void)invalidateDisplayForRange:(struct _NSRange)arg1; +- (unsigned long long)draggingEntered:(id)arg1; +- (void)paste:(id)arg1; +- (void)viewWillMoveToWindow:(id)arg1; +- (void)removeFromSuperview; +- (void)_mouseInside:(id)arg1; +- (void)debugDumpCompletionState:(id)arg1; +- (void)selectPreviousPlaceholder:(id)arg1; +- (void)selectNextPlaceholder:(id)arg1; +- (BOOL)handleInsertBackTab; +- (BOOL)handleInsertTab; +- (id)menuForEvent:(id)arg1; +- (BOOL)handleCancel; +- (void)previousCompletion:(id)arg1; +- (void)nextCompletion:(id)arg1; +- (void)complete:(id)arg1; +- (BOOL)shouldChangeTextInRange:(struct _NSRange)arg1 replacementString:(id)arg2; +- (void)deleteForward:(id)arg1; +- (void)deleteBackward:(id)arg1; +- (void)insertText:(id)arg1 replacementRange:(struct _NSRange)arg2; +- (void)doCommandBySelector:(SEL)arg1; +- (void)foldingLayoutManagerFoldsChanged:(id)arg1; +- (id)layoutManager:(id)arg1 shouldUseTextBackgroundColor:(id)arg2 rectArray:(struct CGRect *)arg3 count:(unsigned long long)arg4 forCharacterRange:(struct _NSRange)arg5; +- (id)layoutManager:(id)arg1 shouldUseTemporaryAttributes:(id)arg2 forDrawingToScreen:(BOOL)arg3 atCharacterIndex:(unsigned long long)arg4 effectiveRange:(struct _NSRange *)arg5; +- (void)showMatchingBraceAtLocation:(id)arg1; +- (void)autoHighlightMatchingBracketAtLocationIfNecessary:(unsigned long long)arg1; +- (BOOL)shouldTryToCompleteOpeningBracketForStringOrAttributedStringToInsert:(id)arg1; +- (BOOL)shouldTryToCompleteOpeningBracketForStringToInsert:(id)arg1; +- (BOOL)shouldTryToCompleteOpeningBracketForStringToInsert:(id)arg1 usingLanguage:(id)arg2; +- (BOOL)_moveToNextPlaceholderFromCharacterIndex:(unsigned long long)arg1 forward:(BOOL)arg2 onlyIfNearby:(BOOL)arg3; +- (struct _NSRange)_findString:(id)arg1 inString:(id)arg2 fromRange:(struct _NSRange)arg3 limitRange:(struct _NSRange)arg4 forward:(BOOL)arg5 wrap:(BOOL)arg6; +- (struct _NSRange)rangeOfPlaceholderFromCharacterIndex:(unsigned long long)arg1 forward:(BOOL)arg2 wrap:(BOOL)arg3 limit:(unsigned long long)arg4; +- (BOOL)selectFirstPlaceholderInCharacterRange:(struct _NSRange)arg1; +- (BOOL)handleSelectPreviousPlaceholder; +- (BOOL)handleSelectNextPlaceholder; +- (id)ghostComplementTextColor; +- (BOOL)shouldAutoCompleteAtLocation:(unsigned long long)arg1; +- (BOOL)shouldSuppressTextCompletion; +@property(readonly) double autoCompletionDelay; +- (id)contextForCompletionStrategiesAtWordStartLocation:(unsigned long long)arg1; +@property(readonly) DVTTextCompletionDataSource *completionsDataSource; +- (struct _NSRange)wordRangeAtLocation:(unsigned long long)arg1; +@property(readonly) DVTSourceCodeLanguage *language; +- (struct CGRect)frameForRange:(struct _NSRange)arg1; +- (void)dealloc; +- (id)initWithCoder:(id)arg1; +- (id)initWithFrame:(struct CGRect)arg1; +- (id)initWithFrame:(struct CGRect)arg1 textContainer:(id)arg2; +- (void)_dvtCommonInit; +- (id)currentTheme; +@property(readonly) DVTFoldingManager *foldingManager; +@property(readonly) DVTFoldingLayoutManager *foldingLayoutManager; +- (BOOL)removeMenusNotInWhiteList:(id)arg1 fromMenu:(id)arg2 removeSeparators:(BOOL)arg3; +- (id)cell; +- (id)selectedCell; +- (id)accessibilityAttributeValue:(id)arg1; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTFontAndColorTheme.h b/SCXcodeMinimap/Xcode Headers/DVTFontAndColorTheme.h new file mode 100755 index 0000000..5da67f3 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTFontAndColorTheme.h @@ -0,0 +1,142 @@ +/* + * Generated by class-dump 3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. + */ + +#import "DVTPreferenceSet-Protocol.h" + +@class DVTCustomDataSpecifier, DVTPointerArray, DVTStackBacktrace, NSColor, NSFont, NSImage, NSString, NSURL; + +@interface DVTFontAndColorTheme : NSObject +{ + NSString *_name; + NSImage *_image; + NSURL *_dataURL; + DVTCustomDataSpecifier *_customDataSpecifier; + NSColor *_sourceTextBackgroundColor; + NSColor *_sourceTextSidebarBackgroundColor; + NSColor *_sourceTextSidebarEdgeColor; + NSColor *_sourceTextSidebarNumbersColor; + NSColor *_sourceTextFoldbarBackgroundColor; + NSColor *_sourceTextSelectionColor; + NSColor *_sourceTextSecondarySelectionColor; + NSColor *_sourceTextInsertionPointColor; + NSColor *_sourceTextInvisiblesColor; + NSColor *_sourceTextBlockDimBackgroundColor; + NSColor *_sourceTextTokenizedBorderColor; + NSColor *_sourceTextTokenizedBackgroundColor; + NSColor *_sourceTextTokenizedBorderSelectedColor; + NSColor *_sourceTextTokenizedBackgroundSelectedColor; + NSColor *_consoleTextBackgroundColor; + NSColor *_consoleTextSelectionColor; + NSColor *_consoleTextSecondarySelectionColor; + NSColor *_consoleTextInsertionPointColor; + NSColor *_consoleDebuggerPromptTextColor; + NSColor *_consoleDebuggerInputTextColor; + NSColor *_consoleDebuggerOutputTextColor; + NSColor *_consoleExecutableInputTextColor; + NSColor *_consoleExecutableOutputTextColor; + NSFont *_consoleDebuggerPromptTextFont; + NSFont *_consoleDebuggerInputTextFont; + NSFont *_consoleDebuggerOutputTextFont; + NSFont *_consoleExecutableInputTextFont; + NSFont *_consoleExecutableOutputTextFont; + NSColor *_debuggerInstructionPointerColor; + NSColor *_sourcePlainTextColor; + NSFont *_sourcePlainTextFont; + DVTPointerArray *_syntaxColorsByNodeType; + DVTPointerArray *_syntaxFontsByNodeType; + NSColor *_sourceTextCompletionPreviewColor; + BOOL _builtIn; + BOOL _loadedData; + BOOL _contentNeedsSaving; + BOOL _hasMultipleSourceTextFonts; +} + ++ (id)_defaultSourceCodeFont; ++ (id)keyPathsForValuesAffectingConsoleTextSecondarySelectionColor; ++ (id)keyPathsForValuesAffectingSourceTextSecondarySelectionColor; ++ (id)titleForNewPreferenceSetFromTemplate; ++ (id)preferenceSetsListHeader; ++ (id)preferenceSetsFileExtension; ++ (id)defaultKeyForExcludedBuiltInPreferenceSets; ++ (id)defaultKeyForCurrentPreferenceSet; ++ (id)builtInPreferenceSetsDirectoryURL; ++ (id)systemPreferenceSet; ++ (id)preferenceSetGroupingName; ++ (id)_nodeTypesIncludedInPreferences; ++ (id)_stringRepresentationOfFont:(id)arg1; ++ (id)_fontWithName:(id)arg1 size:(double)arg2; ++ (id)currentTheme; ++ (id)preferenceSetsManager; ++ (void)initialize; +@property(readonly) BOOL loadedData; // @synthesize loadedData=_loadedData; +@property(readonly) DVTPointerArray *syntaxFontsByNodeType; // @synthesize syntaxFontsByNodeType=_syntaxFontsByNodeType; +@property(readonly) DVTPointerArray *syntaxColorsByNodeType; // @synthesize syntaxColorsByNodeType=_syntaxColorsByNodeType; +@property(nonatomic) BOOL hasMultipleSourceTextFonts; // @synthesize hasMultipleSourceTextFonts=_hasMultipleSourceTextFonts; +@property BOOL contentNeedsSaving; // @synthesize contentNeedsSaving=_contentNeedsSaving; +@property(retain) DVTCustomDataSpecifier *customDataSpecifier; // @synthesize customDataSpecifier=_customDataSpecifier; +@property(readonly, getter=isBuiltIn) BOOL builtIn; // @synthesize builtIn=_builtIn; +@property(retain) NSImage *image; // @synthesize image=_image; +@property(copy) NSString *name; // @synthesize name=_name; +- (void)setFont:(id)arg1 forNodeTypes:(id)arg2; +- (void)setColor:(id)arg1 forNodeTypes:(id)arg2; +- (void)_setColorOrFont:(id)arg1 forNodeTypes:(id)arg2; +- (id)fontForNodeType:(short)arg1; +- (id)colorForNodeType:(short)arg1; +@property(readonly) NSFont *sourcePlainTextFont; +@property(readonly) NSColor *sourcePlainTextColor; +- (void)primitiveSetConsoleDebuggerPromptTextColor:(id)arg1; +- (void)_setColorOrFont:(id)arg1 forKey:(id)arg2 colorOrFontivar:(id *)arg3; +@property NSColor *debuggerInstructionPointerColor; +@property NSFont *consoleExecutableOutputTextFont; +@property NSFont *consoleExecutableInputTextFont; +@property NSFont *consoleDebuggerOutputTextFont; +@property NSFont *consoleDebuggerInputTextFont; +@property NSFont *consoleDebuggerPromptTextFont; +@property NSColor *consoleExecutableOutputTextColor; +@property NSColor *consoleExecutableInputTextColor; +@property NSColor *consoleDebuggerOutputTextColor; +@property NSColor *consoleDebuggerInputTextColor; +@property NSColor *consoleDebuggerPromptTextColor; +@property NSColor *consoleTextInsertionPointColor; +@property NSColor *consoleTextSecondarySelectionColor; +@property NSColor *consoleTextSelectionColor; +@property NSColor *consoleTextBackgroundColor; +@property(readonly) NSColor *sourceTextTokenizedBackgroundSelectedColor; +@property(readonly) NSColor *sourceTextTokenizedBorderSelectedColor; +@property(readonly) NSColor *sourceTextTokenizedBackgroundColor; +@property(readonly) NSColor *sourceTextTokenizedBorderColor; +@property(readonly) NSColor *sourceTextLinkColor; +@property(readonly) NSColor *sourceTextCompletionPreviewColor; +@property(readonly) NSColor *sourceTextBlockDimBackgroundColor; +@property NSColor *sourceTextInvisiblesColor; +@property NSColor *sourceTextInsertionPointColor; +@property(readonly) NSColor *sourceTextSecondarySelectionColor; +@property NSColor *sourceTextSelectionColor; +@property(readonly) NSColor *sourceTextFoldbarBackgroundColor; +@property(readonly) NSColor *sourceTextSidebarNumbersColor; +@property(readonly) NSColor *sourceTextSidebarEdgeColor; +@property(readonly) NSColor *sourceTextSidebarBackgroundColor; +@property NSColor *sourceTextBackgroundColor; +- (id)description; +@property(readonly) NSString *localizedName; +- (void)_updateHasMultipleSourceTextFonts; +- (void)_updateDerivedColors; +- (BOOL)_loadFontsAndColors; +- (id)dataRepresentationWithError:(id *)arg1; +- (void)primitiveInvalidate; +- (id)initWithCustomDataSpecifier:(id)arg1 basePreferenceSet:(id)arg2; +- (id)initWithName:(id)arg1 dataURL:(id)arg2; +- (id)_initWithName:(id)arg1 syntaxColorsByNodeType:(id)arg2 syntaxFontsByNodeType:(id)arg3; +- (void)_themeCommonInit; +- (id)init; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end + diff --git a/SCXcodeMinimap/Xcode Headers/DVTInvalidation-Protocol.h b/SCXcodeMinimap/Xcode Headers/DVTInvalidation-Protocol.h new file mode 100755 index 0000000..5a44213 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTInvalidation-Protocol.h @@ -0,0 +1,18 @@ +/* + * Generated by class-dump 3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. + */ + +@class DVTStackBacktrace; + +@protocol DVTInvalidation +- (void)primitiveInvalidate; + +@optional +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; +- (void)invalidate; +@end + diff --git a/SCXcodeMinimap/Xcode Headers/DVTPointerArray.h b/SCXcodeMinimap/Xcode Headers/DVTPointerArray.h new file mode 100644 index 0000000..cc869e7 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTPointerArray.h @@ -0,0 +1,38 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + + +@interface DVTPointerArray : NSObject +{ +} + ++ (id)allocWithZone:(struct _NSZone *)arg1; ++ (id)pointerArrayWithPointerFunctions:(id)arg1; ++ (id)pointerArrayWithOptions:(int)arg1; ++ (id)pointerArrayWithWeakObjects; ++ (id)pointerArrayWithStrongObjects; +- (void)encodeWithCoder:(id)arg1; +- (id)copyWithZone:(struct _NSZone *)arg1; +- (void)setCount:(unsigned long long)arg1; +- (unsigned long long)count; +- (void)compact; +- (void)replacePointerAtIndex:(unsigned long long)arg1 withPointer:(id)arg2; +- (void)insertPointer:(id)arg1 atIndex:(unsigned long long)arg2; +- (void)removePointerAtIndex:(unsigned long long)arg1; +- (void)addPointer:(id)arg1; +- (id)pointerAtIndex:(unsigned long long)arg1; +- (id)pointerFunctions; +- (id)initWithCoder:(id)arg1; +- (id)initWithPointerFunctions:(id)arg1; +- (id)initWithOptions:(int)arg1; +- (id)init; +- (void)getPointers:(id *)arg1; +- (void)getPointers:(id *)arg1 range:(struct _NSRange)arg2; +- (unsigned long long)indexOfPointerIdenticalTo:(id)arg1; +- (id)allObjects; +- (id)mutableArray; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTPreferenceSet-Protocol.h b/SCXcodeMinimap/Xcode Headers/DVTPreferenceSet-Protocol.h new file mode 100755 index 0000000..1f2bd75 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTPreferenceSet-Protocol.h @@ -0,0 +1,34 @@ +/* + * Generated by class-dump 3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. + */ + +#import "DVTInvalidation-Protocol.h" + +@class DVTCustomDataSpecifier, NSImage, NSString; + +@protocol DVTPreferenceSet ++ (id)titleForNewPreferenceSetFromTemplate; ++ (id)preferenceSetsListHeader; ++ (id)preferenceSetsFileExtension; ++ (id)defaultKeyForExcludedBuiltInPreferenceSets; ++ (id)defaultKeyForCurrentPreferenceSet; ++ (id)builtInPreferenceSetsDirectoryURL; ++ (id)systemPreferenceSet; ++ (id)preferenceSetGroupingName; ++ (id)preferenceSetsManager; +@property BOOL contentNeedsSaving; +@property(readonly, getter=isBuiltIn) BOOL builtIn; +@property(retain) DVTCustomDataSpecifier *customDataSpecifier; +@property(retain) NSImage *image; +@property(readonly) NSString *localizedName; +@property(copy,readonly) NSString *name; +- (id)dataRepresentationWithError:(id *)arg1; +- (id)initWithCustomDataSpecifier:(id)arg1 basePreferenceSet:(id)arg2; +- (id)initWithName:(id)arg1 dataURL:(id)arg2; + +@optional ++ (id)titleForManagePreferenceSets; +@end + diff --git a/SCXcodeMinimap/Xcode Headers/DVTSourceLanguageSourceModelService.h b/SCXcodeMinimap/Xcode Headers/DVTSourceLanguageSourceModelService.h new file mode 100644 index 0000000..dc7df3b --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTSourceLanguageSourceModelService.h @@ -0,0 +1,15 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +@protocol DVTSourceLanguageSourceModelService +- (struct _NSRange)rangeForBlockContainingRange:(struct _NSRange)arg1; +- (NSString *)stringForItem:(DVTSourceModelItem *)arg1; +- (DVTSourceModelItem *)commonSourceModelItemAtRange:(struct _NSRange)arg1; +- (DVTSourceModelItem *)sourceModelItemAtCharacterIndex:(unsigned long long)arg1; +- (DVTSourceModelItem *)sourceModelItemAtCharacterIndex:(unsigned long long)arg1 affinity:(unsigned long long)arg2; +- (DVTSourceModel *)sourceModelWithoutParsing; +- (DVTSourceModel *)sourceModel; +@end \ No newline at end of file diff --git a/SCXcodeMinimap/Xcode Headers/DVTSourceModel.h b/SCXcodeMinimap/Xcode Headers/DVTSourceModel.h new file mode 100644 index 0000000..8a54d6f --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTSourceModel.h @@ -0,0 +1,92 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTSourceModelItem.h" + +@interface DVTSourceModel : NSObject +{ + struct _NSRange _dirtyRange; + long long _batchDelta; + DVTSourceModelItem *_sourceItems; + BOOL _isDoingBatchEdit; +} + ++ (id)editorResponsivenessPerformanceLogAspect; ++ (void)initialize; +@property BOOL isDoingBatchEdit; // @synthesize isDoingBatchEdit=_isDoingBatchEdit; +@property long long batchDelta; // @synthesize batchDelta=_batchDelta; +@property struct _NSRange dirtyRange; // @synthesize dirtyRange=_dirtyRange; +@property(retain) DVTSourceModelItem *sourceItems; // @synthesize sourceItems=_sourceItems; +- (id)objCMethodNameForItem:(id)arg1 nameRanges:(id *)arg2; +- (BOOL)isItemDictionaryLiteral:(id)arg1; +- (BOOL)isItemObjectLiteral:(id)arg1; +- (BOOL)isItemForStatement:(id)arg1; +- (BOOL)isItemSemanticBlock:(id)arg1; +- (BOOL)isItemBracketExpression:(id)arg1; +- (BOOL)isItemAngleExpression:(id)arg1; +- (BOOL)isItemParenExpression:(id)arg1; +- (BOOL)isPostfixExpressionAtLocation:(unsigned long long)arg1; +- (BOOL)isInTokenizableCodeAtLocation:(unsigned long long)arg1; +- (BOOL)isInPlainCodeAtLocation:(unsigned long long)arg1; +- (BOOL)isInKeywordAtLocation:(unsigned long long)arg1; +- (BOOL)isIncompletionPlaceholderAtLocation:(unsigned long long)arg1; +- (BOOL)isInNumberConstantAtLocation:(unsigned long long)arg1; +- (BOOL)isInCharacterConstantAtLocation:(unsigned long long)arg1; +- (BOOL)isInIdentifierAtLocation:(unsigned long long)arg1; +- (BOOL)isInStringConstantAtLocation:(unsigned long long)arg1; +- (BOOL)isInIncludeStatementAtLocation:(unsigned long long)arg1; +- (BOOL)isInPreprocessorStatementAtLocation:(unsigned long long)arg1; +- (BOOL)isInDocCommentAtLocation:(unsigned long long)arg1; +- (BOOL)isInCommentAtLocation:(unsigned long long)arg1; +- (id)completionPlaceholderItemAtLocation:(unsigned long long)arg1; +- (id)identOrKeywordItemAtLocation:(unsigned long long)arg1; +- (id)objCDeclaratorItemAtLocation:(unsigned long long)arg1; +- (id)numberConstantAtLocation:(unsigned long long)arg1; +- (id)characterConstantAtLocation:(unsigned long long)arg1; +- (id)stringConstantAtLocation:(unsigned long long)arg1; +- (id)moduleImportStatementAtLocation:(unsigned long long)arg1; +- (id)includeStatementAtLocation:(unsigned long long)arg1; +- (id)preprocessorStatementAtLocation:(unsigned long long)arg1; +- (id)docCommentAtLocation:(unsigned long long)arg1; +- (id)commentAtLocation:(unsigned long long)arg1; +- (id)placeholderItemsFromItem:(id)arg1; +- (id)identifierItemsFromItem:(id)arg1; +- (id)commentBlockItems; +- (id)functionsAndMethodItems; +- (id)classItems; +- (void)addBlockItemsInTypeList:(long long *)arg1 fromItem:(id)arg2 toArray:(id)arg3; +- (void)addIdentifierItemsFromItem:(id)arg1 toArray:(id)arg2; +- (void)addItemsInTypeList:(long long *)arg1 fromItem:(id)arg2 toArray:(id)arg3; +- (id)functionOrMethodDefinitionAtLocation:(unsigned long long)arg1; +- (id)functionOrMethodAtLocation:(unsigned long long)arg1; +- (id)interfaceDeclarationAtLocation:(unsigned long long)arg1; +- (id)typeDeclarationAtLocation:(unsigned long long)arg1; +- (id)classAtLocation:(unsigned long long)arg1; +- (id)itemNameAtLocation:(unsigned long long)arg1 inTypeList:(long long *)arg2 nameRanges:(id *)arg3 scopeRange:(struct _NSRange *)arg4; +- (id)nameOfItem:(id)arg1 nameRanges:(id *)arg2 scopeRange:(struct _NSRange *)arg3; +- (void)enumerateIdentifierItemsInRange:(struct _NSRange)arg1 usingBlock:(id)arg2; +- (id)itemAtLocation:(unsigned long long)arg1 ofType:(id)arg2; +- (id)itemAtLocation:(unsigned long long)arg1 inTypeList:(long long *)arg2; +- (long long *)typeListForSpecNames:(id)arg1; +- (id)builtUpNameForItem:(id)arg1 nameRanges:(id *)arg2; +- (id)_builtUpNameForItem:(id)arg1 mutableNameRanges:(id)arg2; +- (id)_builtUpNameForSubTree:(id)arg1 mutableNameRanges:(id)arg2; +- (id)objectLiteralItemAtLocation:(unsigned long long)arg1; +- (id)parenItemAtLocation:(unsigned long long)arg1; +- (id)parenLikeItemAtLocation:(unsigned long long)arg1; +- (id)foldableBlockItemForLocation:(unsigned long long)arg1; +- (id)foldableBlockItemForLineAtLocation:(unsigned long long)arg1; +- (id)blockItemAtLocation:(unsigned long long)arg1; +- (long long)indentForItem:(id)arg1; +- (id)adjoiningItemAtLocation:(unsigned long long)arg1; +- (id)enclosingItemAtLocation:(unsigned long long)arg1; +- (id)_topLevelSourceItem; +- (void)parse; +- (void)doingBatchEdit:(BOOL)arg1; +- (void)dirtyRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (id)initWithSourceBufferProvider:(id)arg1; + +@end \ No newline at end of file diff --git a/SCXcodeMinimap/Xcode Headers/DVTSourceModelItem.h b/SCXcodeMinimap/Xcode Headers/DVTSourceModelItem.h new file mode 100644 index 0000000..555004f --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTSourceModelItem.h @@ -0,0 +1,99 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +@interface DVTSourceModelItem : NSObject +{ + int _rc; + struct _NSRange _relativeLocation; + long long _langId; + long long _token; + DVTSourceModelItem *_parent; + NSMutableArray *_children; + unsigned int _nodeType:15; + unsigned int _isOpaque:1; + unsigned int _dirty:1; + unsigned int _isBlock:1; + unsigned int _ignoreToken:1; + unsigned int _inheritsNodeType:1; + unsigned int _isIdentifier:1; + unsigned int _needsAdjustNodeType:1; + unsigned int _isSimpleToken:1; + unsigned int _isVolatile:1; + unsigned int _needToDirtyRightEdges:1; +} + ++ (id)sourceModelItemWithRange:(struct _NSRange)arg1 language:(long long)arg2 token:(long long)arg3 nodeType:(short)arg4; +@property struct _NSRange relativeLocation; // @synthesize relativeLocation=_relativeLocation; +@property(retain, nonatomic) NSMutableArray *children; // @synthesize children=_children; +@property(nonatomic) DVTSourceModelItem *parent; // @synthesize parent=_parent; +@property long long token; // @synthesize token=_token; +@property long long langId; // @synthesize langId=_langId; +- (void)enumerateIdentifierItemsInRelativeRange:(struct _NSRange)arg1 usingBlock:(id)arg2; +- (void)clearAdjustedNodeTypes; +- (long long)compare:(id)arg1; +- (id)followingItem; +- (id)precedingItem; +- (id)_lastLeafItem; +- (id)_firstLeafItem; +- (id)nextItem; +- (id)previousItem; +- (BOOL)isAncestorOf:(id)arg1; +- (id)childAdjoiningLocation:(unsigned long long)arg1; +- (id)childEnclosingLocation:(unsigned long long)arg1; +- (id)_childEnclosingLocation:(unsigned long long)arg1; +- (unsigned long long)indexOfChildAtLocation:(unsigned long long)arg1; +- (unsigned long long)indexOfChildAfterLocation:(unsigned long long)arg1; +- (unsigned long long)indexOfChildBeforeLocation:(unsigned long long)arg1; +- (unsigned long long)numberOfChildren; +- (void)addChildrenFromArray:(id)arg1 inRange:(struct _NSRange)arg2; +- (void)addChildren:(id)arg1; +- (void)addChild:(id)arg1; +- (void)assignAllParents:(id)arg1; +- (void)assignParents:(id)arg1; +- (BOOL)isVolatile; +- (void)setVolatile:(BOOL)arg1; +@property BOOL needsAdjustNodeType; +- (BOOL)needToDirtyRightEdges; +- (void)setNeedToDirtyRightEdges:(BOOL)arg1; +- (BOOL)isSimpleToken; +- (void)setIsSimpleToken:(BOOL)arg1; +- (BOOL)inheritsNodeType; +- (void)setInheritsNodeType:(BOOL)arg1; +- (BOOL)ignoreToken; +- (void)setIgnoreToken:(BOOL)arg1; +- (BOOL)dirty; +- (void)setDirty:(BOOL)arg1; +- (BOOL)isIdentifier; +- (short)rawNodeType; +- (BOOL)isOpaque; +- (void)setIsOpaque:(BOOL)arg1; +- (short)nodeType; +- (void)setNodeType:(short)arg1; +- (struct _NSRange)innerRange; +- (void)offsetBy:(long long)arg1; +- (void)setRange:(struct _NSRange)arg1; +- (struct _NSRange)range; +- (id)enclosingBlock; +- (long long)blockDepth; +- (void)setIsBlock:(BOOL)arg1; +- (BOOL)isBlock; +- (void)dirtyRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (void)dirtyRelativeRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (void)validate; +- (id)dumpContext; +- (id)contextArray; +- (id)simpleDescription; +- (id)diffableDescription; +- (id)description; +- (id)innerDescription:(id)arg1 showSelf:(BOOL)arg2; +- (id)initWithRange:(struct _NSRange)arg1 language:(long long)arg2 token:(long long)arg3 nodeType:(short)arg4; +- (BOOL)_isDeallocating; +- (BOOL)_tryRetain; +- (unsigned long long)retainCount; +- (oneway void)release; +- (id)retain; + +@end \ No newline at end of file diff --git a/SCXcodeMinimap/Xcode Headers/DVTSourceNodeTypes.h b/SCXcodeMinimap/Xcode Headers/DVTSourceNodeTypes.h new file mode 100644 index 0000000..6ac8f94 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTSourceNodeTypes.h @@ -0,0 +1,18 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import + +@interface DVTSourceNodeTypes : NSObject +{ +} + ++ (long long)nodeTypesCount; ++ (id)nodeTypeNameForId:(short)arg1; ++ (short)registerNodeTypeNamed:(id)arg1; ++ (void)initialize; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h b/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h new file mode 100644 index 0000000..d2e32da --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h @@ -0,0 +1,348 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTCompletingTextView.h" + +@class DVTAnnotationManager, DVTHashTable, DVTMutableRangeArray, DVTObservingToken, DVTTextAnnotationIndicatorAnimation, DVTTextDocumentLocation, DVTTextPageGuideVisualization, NSAnimation, NSArray, NSColor, NSDictionary, NSMutableArray, NSString, NSTimer, NSView, NSWindow; + +@interface DVTSourceTextView : DVTCompletingTextView +{ + unsigned long long _oldFocusLocation; + NSAnimation *_blockAnimation; + struct CGPoint _lastMouseMovedLocation; + struct _NSRange _foldingHoverRange; + DVTTextAnnotationIndicatorAnimation *_annotationIndicatorAnimation; + NSArray *_temporaryLinkRanges; + unsigned long long _temporaryLinkHoverModifierFlags; + unsigned long long _temporaryLinkHoverAltModifierFlags; + NSArray *_clickedTemporaryLinkRanges; + NSMutableArray *_clickedLinkProgressIndicators; + struct _NSRange _ghostStringRange; + NSTimer *_autoHighlightTokenTimer; + DVTObservingToken *_autoHighlightTextCompletionObserver; + DVTMutableRangeArray *_autoHighlightTokenRanges; + NSTimer *_autoHighlightTokenMenuTimer; + struct _NSRange _autoHighlightTokenMenuRange; + double _autoHighlightTokenMenuAnimationDuration; + NSTimer *_autoHighlightTokenMenuAnimationTimer; + double _autoHighlightTokenMenuAnimationStartTime; + NSWindow *_autoHighlightTokenWindow; + DVTMutableRangeArray *_tokenizedEditingTokenRanges; + unsigned long long _tokenizedEditingEditedTokenIndex; + unsigned long long _tokenizedEditingDeferedOffset; + struct _NSRange _tokenizedEditingSelectionRange; + NSColor *_tokenizedEditingTokenColors[4]; + NSArray *_foundLocations; + DVTTextDocumentLocation *_currentFoundLocation; + NSMutableArray *_visualizations; + unsigned long long _pageGuideColumn; + DVTTextPageGuideVisualization *_pageGuideVisualization; + unsigned long long _locationOfAutoOpenedCloseBracket; + unsigned long long _locationOfOpenBracePendingClose; + NSTimer *_scrollbarMarkerUpdateTimer; + DVTAnnotationManager *_annotationManager; + DVTHashTable *_visibleViewAnnotations; + NSView *_staticVisualizationView; + int _findResultStyle; + DVTMutableRangeArray *_typeOverCompletionRanges; + DVTMutableRangeArray *_typeOverCompletionOpenRanges; + NSString *_pendingTypeOverCompletion; + struct _NSRange _pendingTypeOverCompletionOpenRange; + BOOL _didChangeText; + struct { + unsigned int dDidFinishAnimatingScroll:1; + unsigned int dDidScroll:1; + unsigned int dColoringContext:1; + unsigned int delegateRespondsToWillReturnPrintJobTitle:1; + unsigned int temporaryLinkIsAlternate:1; + unsigned int updatingInsertionPoint:1; + unsigned int wasPostsFrameChangedNotifications:1; + unsigned int doingDidChangeSelection:1; + } _sFlags; + BOOL _isDoingBatchEdit; + BOOL _allowsCodeFolding; + BOOL _showingCodeFocus; + BOOL _lastMouseEventWasClick; + BOOL _autoHighlightTokens; + BOOL _tokenizedEditingEnabled; + BOOL _animatesCurrentScroll; + BOOL _disableUpdatingInsertionPointCount; + BOOL _currentlyAutoCompletingBracket; + BOOL _addedSpaceWhenAutoOpeningCloseBracket; + BOOL _wrapsLines; + BOOL _postsLayoutManagerNotifications; + BOOL _scrollingInScrollView; + BOOL _annotationLayoutScheduled; + struct _NSRange _selectedRangeBeforeMouseDown; +} + ++ (id)autoCompleteChars; ++ (id)performanceLogAspect; ++ (id)foldingLogAspect; ++ (id)drawingLogAspect; ++ (void)initialize; +@property BOOL postsLayoutManagerNotifications; // @synthesize postsLayoutManagerNotifications=_postsLayoutManagerNotifications; +@property BOOL addedSpaceWhenAutoOpeningCloseBracket; // @synthesize addedSpaceWhenAutoOpeningCloseBracket=_addedSpaceWhenAutoOpeningCloseBracket; +@property unsigned long long locationOfAutoOpenedCloseBracket; // @synthesize locationOfAutoOpenedCloseBracket=_locationOfAutoOpenedCloseBracket; +@property(nonatomic, getter=isTokenizedEditingEnabled) BOOL tokenizedEditingEnabled; // @synthesize tokenizedEditingEnabled=_tokenizedEditingEnabled; +@property struct _NSRange tokenizedEditingSelectionRange; // @synthesize tokenizedEditingSelectionRange=_tokenizedEditingSelectionRange; +@property(readonly) NSArray *tokenizedEditingTokenRanges; // @synthesize tokenizedEditingTokenRanges=_tokenizedEditingTokenRanges; +@property(nonatomic) BOOL autoHighlightTokens; // @synthesize autoHighlightTokens=_autoHighlightTokens; +@property int findResultStyle; // @synthesize findResultStyle=_findResultStyle; +@property(nonatomic) unsigned long long pageGuideColumn; // @synthesize pageGuideColumn=_pageGuideColumn; +@property(readonly) NSArray *visualizations; // @synthesize visualizations=_visualizations; +@property(retain) DVTAnnotationManager *annotationManager; // @synthesize annotationManager=_annotationManager; +@property(nonatomic) struct _NSRange ghostStringRange; // @synthesize ghostStringRange=_ghostStringRange; +@property unsigned long long temporaryLinkHoverAltModifierFlags; // @synthesize temporaryLinkHoverAltModifierFlags=_temporaryLinkHoverAltModifierFlags; +@property unsigned long long temporaryLinkHoverModifierFlags; // @synthesize temporaryLinkHoverModifierFlags=_temporaryLinkHoverModifierFlags; +@property(nonatomic) BOOL wrapsLines; // @synthesize wrapsLines=_wrapsLines; +- (void)viewDidEndLiveResize; +- (void)viewWillStartLiveResize; +- (void)updateInsertionPointStateAndRestartTimer:(BOOL)arg1; +- (void)resignKeyWindow; +- (BOOL)resignFirstResponder; +- (void)_invalidateDisplayForViewStatusChange; +- (void)_reloadAnnotationProviders; +- (void)_unloadAnnotationProviders; +- (void)dvt_viewDidEndLiveAnimation; +- (void)dvt_viewWillBeginLiveAnimation; +- (void)_updateLayoutEstimation; +- (void)drawFoundLocationsInRange:(struct _NSRange)arg1; +- (id)_findResultUnderlineColor; +- (id)_findResultCurrentUnderlineColor; +- (id)_findResultGradient; +- (id)_findResultCurrentGradient; +- (void)setCurrentFoundLocation:(id)arg1; +- (void)setFoundLocations:(id)arg1; +- (void)unfoldAllComments:(id)arg1; +- (void)foldAllComments:(id)arg1; +- (void)unfoldAllMethods:(id)arg1; +- (void)foldAllMethods:(id)arg1; +- (void)unfoldRecursive:(id)arg1; +- (void)unfold:(id)arg1; +- (void)unfoldAll:(id)arg1; +- (void)foldSelection:(id)arg1; +- (void)foldRecursive:(id)arg1; +- (void)fold:(id)arg1; +- (BOOL)writeSelectionToPasteboard:(id)arg1 type:(id)arg2; +- (BOOL)writeRTFSelectionToPasteboard:(id)arg1; +- (id)writablePasteboardTypes; +- (void)balance:(id)arg1; +- (void)shiftLeft:(id)arg1; +- (void)shiftRight:(id)arg1; +- (void)_indentSelectionByNumberOfLevels:(long long)arg1; +- (struct _NSRange)_indentInsertedTextIfNecessaryAtRange:(struct _NSRange)arg1; +- (void)indentSelectionIfIndentable:(id)arg1; +- (void)indentSelection:(id)arg1; +- (void)commentAndUncommentCurrentLines:(id)arg1; +- (void)moveCurrentLineDown:(id)arg1; +- (void)moveCurrentLineUp:(id)arg1; +- (void)_didChangeSelection:(id)arg1; +- (void)PBX_toggleShowsInvisibleCharacters:(id)arg1; +- (void)PBX_toggleShowsControlCharacters:(id)arg1; +- (void)useSelectionForReplace:(id)arg1; +- (BOOL)validateMenuItem:(id)arg1; +- (BOOL)validateUserInterfaceItem:(id)arg1; +- (void)layoutManager:(id)arg1 didCompleteLayoutForTextContainer:(id)arg2 atEnd:(BOOL)arg3; +- (id)layoutManager:(id)arg1 shouldUseTemporaryAttributes:(id)arg2 forDrawingToScreen:(BOOL)arg3 atCharacterIndex:(unsigned long long)arg4 effectiveRange:(struct _NSRange *)arg5; +- (BOOL)scrollRectToVisible:(struct CGRect)arg1; +- (void)scrollPoint:(struct CGPoint)arg1; +- (void)setMarkedText:(id)arg1 selectedRange:(struct _NSRange)arg2; +- (BOOL)shouldChangeTextInRanges:(id)arg1 replacementStrings:(id)arg2; +- (void)_invalidateAllRevealovers; +- (BOOL)isEditable; +- (void)moveDown:(id)arg1; +- (void)moveUp:(id)arg1; +- (BOOL)_couldHaveBlinkTimer; +- (BOOL)_shouldHaveBlinkTimer; +- (void)_centeredScrollRectToVisible:(struct CGRect)arg1 forceCenter:(BOOL)arg2; +- (void)scrollViewDidSetFrameSize:(id)arg1; +- (void)setFrameSize:(struct CGSize)arg1; +- (void)_adjustAccessoryAnnotations; +- (void)viewWillDraw; +- (void)viewWillMoveToWindow:(id)arg1; +- (void)breakUndoCoalescing; +- (void)didChangeText; +- (void)scrollRangeToVisible:(struct _NSRange)arg1 animate:(BOOL)arg2; +- (void)didEndScrollInScrollView:(id)arg1; +- (void)didBeginScrollInScrollView:(id)arg1; +- (void)scrollRangeToVisible:(struct _NSRange)arg1; +- (void)flagsChanged:(id)arg1; +- (void)selectPreviousToken:(id)arg1; +- (void)selectNextToken:(id)arg1; +- (void)toggleTokenizedEditing:(id)arg1; +@property(retain) NSColor *tokenizedEditingSelectedTokenBackgroundColor; // @dynamic tokenizedEditingSelectedTokenBackgroundColor; +@property(retain) NSColor *tokenizedEditingSelectedTokenBorderColor; // @dynamic tokenizedEditingSelectedTokenBorderColor; +@property(retain) NSColor *tokenizedEditingTokenBackgroundColor; // @dynamic tokenizedEditingTokenBackgroundColor; +@property(retain) NSColor *tokenizedEditingTokenBorderColor; // @dynamic tokenizedEditingTokenBorderColor; +- (id)tokenizedEditingTokenPathsForCharacterRange:(struct _NSRange)arg1; +- (id)tokenPathsForCharacterRange:(struct _NSRange)arg1 displayOnly:(BOOL)arg2; +- (void)textStorage:(id)arg1 didEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; +- (void)textStorage:(id)arg1 willEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; +- (unsigned long long)_indexOfTokenizedEditingRange:(struct _NSRange)arg1; +- (void)updateTokenizedEditingRanges; +- (void)_scheduleAutoHighlightTokenTimerIfNeeded; +- (void)_autoHighlightTokenWithTimer:(id)arg1; +- (void)tokenizableItemsForItemAtRange:(struct _NSRange)arg1 completionBlock:(id)arg2; +- (void)_scheduleAutoHighlightTokenMenuTimerIfNeeded; +- (void)_showAutoHighlightTokenMenuWithTimer:(id)arg1; +- (id)_autoHighlightTokenWindowWithTokenRect:(struct CGRect)arg1; +- (void)_scheduleAutoHighlightTokenMenuAnimationTimerIfNeeded; +- (struct CGRect)_hitTestRectForAutoHighlightTokenWindow:(id)arg1; +- (struct CGRect)_autoHighlightTokenRectAtPoint:(struct CGPoint)arg1; +- (struct _NSRange)_autoHighlightTokenMenuRangeAtPoint:(struct CGPoint)arg1; +- (void)_animateAutoHighlightTokenMenuWithTimer:(id)arg1; +- (void)_popUpTokenMenu:(id)arg1; +- (id)_autoHighlightTokenMenu; +- (void)_clearAutoHighlightTokenMenu; +- (void)_clearDisplayForAutoHighlightTokens; +- (void)_displayAutoHighlightTokens; +- (void)removeStaticVisualizationView; +- (void)addStaticVisualizationView:(id)arg1; +- (void)removeVisualization:(id)arg1 fadeOut:(BOOL)arg2 completionBlock:(id)arg3; +- (void)addVisualization:(id)arg1 fadeIn:(BOOL)arg2 completionBlock:(id)arg3; +- (void)adjustTypeOverCompletionForSelectionChange:(struct _NSRange)arg1; +- (void)removeInvalidTypeOverCompletion; +- (void)removeTypeOverCompletionIfAppropriateForEditedRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (void)adjustTypeOverCompletionForEditedRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (void)addTypeOverCompletionForRange:(struct _NSRange)arg1 openRange:(struct _NSRange)arg2; +- (struct _NSRange)lastTypeOverCompletionRange; +- (struct _NSRange)typeOverCompletionToSkipOverAtLocation:(unsigned long long)arg1 withInsertionText:(id)arg2; +- (struct _NSRange)typeOverCompletionRangeFollowingLocation:(unsigned long long)arg1; +- (void)didInsertCompletionTextAtRange:(struct _NSRange)arg1; +- (struct _NSRange)_suggestedOpenRangeForTypeOverRange:(struct _NSRange)arg1; +- (BOOL)shouldAutoCompleteAtLocation:(unsigned long long)arg1; +- (BOOL)shouldSuppressTextCompletion; +- (id)contextForCompletionStrategiesAtWordStartLocation:(unsigned long long)arg1; +- (void)autoInsertCloseBrace; +- (void)deleteExpressionBackward:(id)arg1; +- (void)deleteExpressionForward:(id)arg1; +- (void)moveExpressionBackwardAndModifySelection:(id)arg1; +- (void)moveExpressionBackward:(id)arg1; +- (void)moveExpressionForwardAndModifySelection:(id)arg1; +- (void)moveExpressionForward:(id)arg1; +- (void)deleteSubWordBackward:(id)arg1; +- (void)deleteSubWordForward:(id)arg1; +- (void)moveSubWordBackwardAndModifySelection:(id)arg1; +- (void)moveSubWordForwardAndModifySelection:(id)arg1; +- (void)moveSubWordBackward:(id)arg1; +- (void)moveSubWordForward:(id)arg1; +- (void)deleteForward:(id)arg1; +- (void)deleteBackward:(id)arg1; +- (void)pasteAndPreserveFormatting:(id)arg1; +- (void)paste:(id)arg1; +- (void)_paste:(id)arg1 indent:(BOOL)arg2; +- (void)insertNewline:(id)arg1; +- (BOOL)handleInsertTab; +- (BOOL)handleSelectPreviousPlaceholder; +- (BOOL)handleSelectNextPlaceholder; +- (BOOL)isCandidateTypeOverString:(id)arg1; +- (id)autoCloseStringForString:(id)arg1; +- (void)insertText:(id)arg1; +- (id)foldString; +- (void)setFoldsFromString:(id)arg1; +- (struct CGRect)frameForRange:(struct _NSRange)arg1 ignoreWhitespace:(BOOL)arg2; +- (struct _NSRange)visibleParagraphRange; +- (long long)_currentLineNumber; +- (struct _NSRange)rangeOfCenterLine; +- (void)doingBatchEdit:(BOOL)arg1; +- (void)quickLookWithEvent:(id)arg1; +- (void)rightMouseDown:(id)arg1; +- (void)rightMouseUp:(id)arg1; +- (void)mouseDragged:(id)arg1; +- (void)mouseUp:(id)arg1; +- (void)mouseDown:(id)arg1; +- (void)scrollWheel:(id)arg1; +- (void)_clipViewAncestorDidScroll:(id)arg1; +- (void)_finishedAnimatingScroll; +- (void)mouseMoved:(id)arg1; +- (void)_mouseInside:(id)arg1; +- (void)removeFromSuperview; +- (void)viewDidMoveToWindow; +- (void)_updateScrollerMarkersWithAnnotations:(id)arg1 clearCurrent:(BOOL)arg2; +- (void)_refreshScrollerMarkers; +- (double)_markForLineNumber:(unsigned long long)arg1; +- (void)setUsesMarkedScrollbar:(BOOL)arg1; +- (id)attributedStringForCompletionPlaceholderCell:(id)arg1 atCharacterIndex:(unsigned long long)arg2 withDefaultAttributes:(id)arg3; +- (void)clickedOnCell:(id)arg1 inRect:(struct CGRect)arg2 atIndexInToken:(unsigned long long)arg3; +- (void)_didClickOnTemporaryLinkWithEvent:(id)arg1; +- (void)_updateTemporaryLinkUnderMouseForEvent:(id)arg1; +- (unsigned long long)_nonBlankCharIndexUnderMouse; +- (void)_clearClickedLinkProgressIndicators; +- (void)_adjustClickedLinkProgressIndicators; +- (void)_adjustClickedLinkProgressIndicator:(id)arg1 withRect:(struct CGRect)arg2; +- (void)_showClickedLinkProgressIndicators; +- (void)_invalidateClickedLinks; +- (id)_clickedLinkProgressIndicatorWithRect:(struct CGRect)arg1; +- (void)_clearTemporaryLinkRanges; +- (void)_setTemporaryLinkRanges:(id)arg1 isAlternate:(BOOL)arg2; +- (void)animation:(id)arg1 didReachProgressMark:(float)arg2; +- (void)animationDidEnd:(id)arg1; +- (void)animationDidStop:(id)arg1; +- (BOOL)animationShouldStart:(id)arg1; +- (void)stopBlockHighlighting; +- (void)startBlockHighlighting; +- (void)focusLocationMayHaveChanged:(id)arg1; +- (void)toggleCodeFocus:(id)arg1; +- (void)_drawViewBackgroundInRect:(struct CGRect)arg1; +- (void)_drawTokensInRect:(struct CGRect)arg1; +- (void)_drawCaretForTextAnnotationsInRect:(struct CGRect)arg1; +- (void)drawTextAnnotationsInRect:(struct CGRect)arg1; +- (long long)_drawRoundedBackgroundForItem:(id)arg1 dynamicItem:(id)arg2; +- (id)_roundedRect:(struct CGRect)arg1 withRadius:(double)arg2; +- (unsigned long long)_drawBlockBackground:(struct CGRect)arg1 atLocation:(unsigned long long)arg2 forItem:(id)arg3 dynamicItem:(id)arg4; +- (double)_grayLevelForDepth:(long long)arg1; +- (id)alternateColor; +- (void)setFoldingHoverRange:(struct _NSRange)arg1; +- (struct _NSRange)foldingHoverRange; +- (void)_loadColorsFromCurrentTheme; +- (void)_themeColorsChanged:(id)arg1; +- (void)_scheduleAnnotationLayoutAfterResize; +- (void)drawRect:(struct CGRect)arg1; +- (unsigned long long)foldedCharacterIndexForPoint:(struct CGPoint)arg1; +- (void)setSelectedRanges:(id)arg1 affinity:(unsigned long long)arg2 stillSelecting:(BOOL)arg3; +- (void)_delayedTrimTrailingWhitespaceForLine:(id)arg1; +- (void)trimTrailingWhitespaceOnLine:(unsigned long long)arg1; +- (void)trimTrailingWhitespaceOnLine:(unsigned long long)arg1 trimWhitespaceOnlyLine:(BOOL)arg2; +- (void)trimTrailingWhitespaceOnLineFromCharacterIndex:(unsigned long long)arg1 trimWhitespaceOnlyLine:(BOOL)arg2; +- (BOOL)shouldTrimTrailingWhitespace; +- (void)setSelectedRange:(struct _NSRange)arg1; +- (void)contextMenu_toggleMessageBubbleShown:(id)arg1; +- (void)toggleMessageBubbleShown:(id)arg1; +- (void)_enumerateMessageBubbleAnnotationsInSelection:(id)arg1; +- (void)setAccessoryAnnotationWidth:(unsigned long long)arg1; +- (void)_updateAccessoryAnnotationViews; +- (void)_adjustSizeOfAccessoryAnnotation:(id)arg1; +- (void)showAnnotation:(id)arg1 animateIndicator:(BOOL)arg2; +- (void)_animateBubbleView:(id)arg1; +- (void)didRemoveAnnotations:(id)arg1; +- (void)didAddAnnotations:(id)arg1; +- (id)visibleAnnotationsForLineNumberRange:(struct _NSRange)arg1; +- (id)annotationForRepresentedObject:(id)arg1; +@property(readonly) NSArray *annotations; +- (void)setShowsFoldingSidebar:(BOOL)arg1; +- (BOOL)showsFoldingSidebar; +- (void)getParagraphRect:(struct CGRect *)arg1 firstLineRect:(struct CGRect *)arg2 forLineRange:(struct _NSRange)arg3 ensureLayout:(BOOL)arg4; +- (struct _NSRange)lineNumberRangeForBoundingRect:(struct CGRect)arg1; +- (unsigned long long)lineNumberForPoint:(struct CGPoint)arg1; +- (id)printJobTitle; +@property(readonly) NSDictionary *syntaxColoringContext; +- (id)language; +- (BOOL)allowsCodeFolding; +- (void)setAllowsCodeFolding:(BOOL)arg1; +- (void)setTextStorage:(id)arg1; +- (void)setTextStorage:(id)arg1 keepOldLayout:(BOOL)arg2; +- (id)initWithCoder:(id)arg1; +- (id)initWithFrame:(struct CGRect)arg1 textContainer:(id)arg2; +- (void)_commonInitDVTSourceTextView; +- (id)menuForEvent:(id)arg1; +- (double)fmc_maxY; +- (double)fmc_startOfLine:(long long)arg1; +- (long long)fmc_lineNumberForPosition:(double)arg1; +- (BOOL)shouldIndentPastedText:(id)arg1; +- (void)indentUserChangeBy:(long long)arg1; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTTextStorage.h b/SCXcodeMinimap/Xcode Headers/DVTTextStorage.h new file mode 100644 index 0000000..4189cff --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTTextStorage.h @@ -0,0 +1,24 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTSourceModel.h" +#import "DVTSourceLanguageSourceModelService.h" + +@interface DVTTextStorage : NSTextStorage + +@property DVTSourceModel* sourceModel; +@property(readonly) id sourceModelService; // DVTSourceTextStorage + +@property(readonly) unsigned long long currentChangeIndex; + +-(NSColor*)colorAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; +-(void)fixSyntaxColoringInRange:(NSRange)range; +-(short)nodeTypeAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; +// FIXME: Workaround for NSObject+YOLO buggyness +-(NSColor*)yl_colorAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; +- (id)sourceModelItemAtCharacterIndex:(unsigned long long)arg1; //DVTSourceTextStorage in Xcode 5, DVTSourceLanguageSourceModelService protocol in Xcode 5.1 + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTViewController.h b/SCXcodeMinimap/Xcode Headers/DVTViewController.h new file mode 100644 index 0000000..8da4b8f --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTViewController.h @@ -0,0 +1,50 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import + +@class DVTExtension, DVTStackBacktrace, NSString; + +@interface DVTViewController : NSViewController +{ + DVTExtension *_representedExtension; + BOOL _isViewLoaded; + BOOL _didCallViewWillUninstall; + void *_keepSelfAliveUntilCancellationRef; +} + ++ (id)defaultViewNibBundle; ++ (id)defaultViewNibName; ++ (void)initialize; +@property(retain, nonatomic) DVTExtension *representedExtension; // @synthesize representedExtension=_representedExtension; +@property BOOL isViewLoaded; // @synthesize isViewLoaded=_isViewLoaded; +- (void)primitiveInvalidate; +- (void)invalidate; +- (BOOL)commitEditingForAction:(int)arg1 errors:(id)arg2; +- (void)_willUninstallContentView:(id)arg1; +- (void)_didInstallContentView:(id)arg1; +- (void)viewWillUninstall; +- (void)viewDidInstall; +- (void)loadView; +- (void)setView:(id)arg1; +- (void)separateKeyViewLoops; +- (BOOL)delegateFirstResponder; +- (id)supplementalMainViewController; +- (id)description; +- (BOOL)becomeFirstResponder; +- (id)view; +- (id)initWithCoder:(id)arg1; +- (id)initWithNibName:(id)arg1 bundle:(id)arg2; +- (id)initUsingDefaultNib; +- (void)dvtViewController_commonInit; +@property(readonly) BOOL canBecomeMainViewController; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDEEditor.h b/SCXcodeMinimap/Xcode Headers/IDEEditor.h new file mode 100644 index 0000000..e841a9c --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEEditor.h @@ -0,0 +1,54 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "IDEViewController.h" + +@class DVTFindBar, DVTNotificationToken, DVTObservingToken, DVTScopeBarsManager, IDEEditorContext, IDEEditorDocument, IDEFileTextSettings, NSScrollView; + +@interface IDEEditor : IDEViewController +{ + IDEEditorDocument *_document; + IDEEditorDocument *_documentForNavBarStructure; + IDEEditorContext *_editorContext; + DVTFindBar *_findBar; + DVTNotificationToken *_documentDidChangeNotificationToken; + DVTNotificationToken *_documentForNavBarStructureDidChangeNotificationToken; + DVTObservingToken *_documentFileURLObservingToken; + IDEFileTextSettings *_fileTextSettings; + BOOL _discardsFindResultsWhenContentChanges; +} + ++ (BOOL)canProvideCurrentSelectedItems; +@property(retain, nonatomic) IDEFileTextSettings *fileTextSettings; // @synthesize fileTextSettings=_fileTextSettings; +@property(retain) IDEEditorContext *editorContext; // @synthesize editorContext=_editorContext; +@property(retain) IDEEditorDocument *document; // @synthesize document=_document; +@property(retain, nonatomic) IDEEditorDocument *documentForNavBarStructure; // @synthesize documentForNavBarStructure=_documentForNavBarStructure; +@property BOOL discardsFindResultsWhenContentChanges; // @synthesize discardsFindResultsWhenContentChanges=_discardsFindResultsWhenContentChanges; +- (id)relatedMenuItemsForNavItem:(id)arg1; +- (void)didSetupEditor; +- (void)navigateToAnnotationWithRepresentedObject:(id)arg1 wantsIndicatorAnimation:(BOOL)arg2 exploreAnnotationRepresentedObject:(id)arg3; +- (void)selectDocumentLocations:(id)arg1; +- (id)currentSelectedDocumentLocations; +- (id)currentSelectedItems; +- (void)primitiveInvalidate; +- (id)supplementalTargetForAction:(SEL)arg1 sender:(id)arg2; +@property(readonly) NSScrollView *mainScrollView; +@property(readonly) DVTScopeBarsManager *scopeBarsManager; +@property(readonly, getter=isPrimaryEditor) BOOL primaryEditor; +- (void)setupContextMenuWithMenu:(id)arg1 withContext:(id)arg2; +- (void)takeFocus; +@property(readonly) DVTFindBar *findBar; // @synthesize findBar=_findBar; +- (void)editorContextDidHideFindBar; +- (id)createFindBar; +@property(readonly) BOOL findBarSupported; +- (id)_getUndoManager:(BOOL)arg1; +- (id)undoManager; +- (id)initWithNibName:(id)arg1 bundle:(id)arg2 document:(id)arg3; +- (id)_initWithNibName:(id)arg1 bundle:(id)arg2; +- (id)initWithNibName:(id)arg1 bundle:(id)arg2; +- (id)initUsingDefaultNib; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDESourceCodeEditor.h b/SCXcodeMinimap/Xcode Headers/IDESourceCodeEditor.h new file mode 100644 index 0000000..2730912 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDESourceCodeEditor.h @@ -0,0 +1,283 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "IDEEditor.h" +#import "IDESourceCodeEditorContainerView.h" + +@class DVTDispatchLock, DVTLayoutManager, DVTNotificationToken, DVTObservingToken, DVTOperation, DVTScopeBarController, DVTSourceExpression, DVTSourceTextView, DVTStackBacktrace, DVTTextDocumentLocation, DVTTextSidebarView, DVTWeakInterposer, IDEAnalyzerResultsExplorer, IDENoteAnnotationExplorer, IDESingleFileProcessingToolbarController, IDESourceCodeDocument, IDESourceCodeEditorAnnotationProvider, IDESourceCodeEditorContainerView, IDESourceCodeHelpNavigationRequest, IDESourceCodeNavigationRequest, IDESourceCodeSingleLineBlameProvider, IDESourceControlLogDetailViewController, NSArray, NSDictionary, NSMutableArray, NSOperationQueue, NSPopover, NSProgressIndicator, NSScrollView, NSString, NSTimer, NSTrackingArea, NSView; + +@interface IDESourceCodeEditor : IDEEditor +{ + NSScrollView *_scrollView; + DVTSourceTextView *_textView; + DVTLayoutManager *_layoutManager; + IDESourceCodeEditorContainerView *_containerView; + DVTTextSidebarView *_sidebarView; + NSArray *_currentSelectedItems; + NSDictionary *_syntaxColoringContext; + DVTSourceExpression *_selectedExpression; + DVTSourceExpression *_mouseOverExpression; + IDESourceCodeNavigationRequest *_currentNavigationRequest; + IDESourceCodeHelpNavigationRequest *_helpNavigationRequest; + struct dispatch_queue_s *_symbolLookupQueue; + NSMutableArray *_stateChangeObservingTokens; + DVTObservingToken *_topLevelItemsObserverToken; + DVTObservingToken *_firstResponderObserverToken; + DVTObservingToken *_editorLiveIssuesEnabledObserverToken; + DVTObservingToken *_navigatorLiveIssuesEnabledObserverToken; + DVTNotificationToken *_workspaceLiveSourceIssuesEnabledObserver; + DVTObservingToken *_needsDiagnosisObserverToken; + DVTObservingToken *_diagnosticItemsObserverToken; + NSOperationQueue *_diagnoseRelatedFilesQueue; + DVTOperation *_findRelatedFilesOperation; + DVTObservingToken *_sessionInProgressObserverToken; + DVTNotificationToken *_blueprintDidChangeNotificationObservingToken; + DVTNotificationToken *_textStorageDidProcessEndingObserver; + DVTNotificationToken *_textViewBoundsDidChangeObservingToken; + DVTNotificationToken *_sourceCodeDocumentWillSaveNotificationToken; + DVTNotificationToken *_sourceCodeDocumentDidSaveNotificationToken; + DVTNotificationToken *_indexDidChangeNotificationToken; + IDESourceCodeEditorAnnotationProvider *_annotationProvider; + IDEAnalyzerResultsExplorer *_analyzerResultsExplorer; + DVTWeakInterposer *_analyzerResultsScopeBar_dvtWeakInterposer; + BOOL _hidingAnalyzerExplorer; + IDENoteAnnotationExplorer *_noteAnnotationExplorer; + IDESourceCodeSingleLineBlameProvider *_blameProvider; + NSPopover *_blameLogPopover; + IDESourceControlLogDetailViewController *_blameDetailController; + IDESingleFileProcessingToolbarController *_singleFileProcessingToolbarController; + NSView *_emptyView; + NSProgressIndicator *_contentGenerationProgressIndicator; + NSTimer *_contentGenerationProgressTimer; + NSOperationQueue *_tokenizeQueue; + DVTDispatchLock *_tokenizeAccessLock; + unsigned long long _tokenizeGeneration; + NSTrackingArea *_mouseTracking; + NSDictionary *_previouslyRestoredStateDictionary; + long long _previousLineNumber; + unsigned long long _lastFocusedAnnotationIndex; + struct _NSRange _lastEditedCharRange; + DVTTextDocumentLocation *_continueToHereDocumentLocation; + DVTTextDocumentLocation *_continueToLineDocumentLocation; + DVTWeakInterposer *_hostViewController_dvtWeakInterposer; + struct { + unsigned int wantsDidScroll:1; + unsigned int wantsDidFinishAnimatingScroll:1; + unsigned int supportsContextMenuCustomization:1; + unsigned int supportsAnnotationContextCreation:1; + unsigned int wantsDidLoadAnnotationProviders:1; + unsigned int reserved:3; + } _hvcFlags; + BOOL _trackingMouse; + BOOL _initialSetupDone; + BOOL _nodeTypesPrefetchingStarted; + BOOL _isUninstalling; +} + ++ (id)keyPathsForValuesAffectingIsWorkspaceBuilding; ++ (void)revertStateWithDictionary:(id)arg1 withSourceTextView:(id)arg2 withEditorDocument:(id)arg3; ++ (void)commitStateToDictionary:(id)arg1 withSourceTextView:(id)arg2; ++ (long long)version; ++ (void)configureStateSavingObjectPersistenceByName:(id)arg1; +@property(retain) IDESingleFileProcessingToolbarController *singleFileProcessingToolbarController; // @synthesize singleFileProcessingToolbarController=_singleFileProcessingToolbarController; +@property(retain) IDEAnalyzerResultsExplorer *analyzerResultsExplorer; // @synthesize analyzerResultsExplorer=_analyzerResultsExplorer; +@property(retain, nonatomic) DVTSourceExpression *mouseOverExpression; // @synthesize mouseOverExpression=_mouseOverExpression; +@property(retain) IDESourceCodeEditorContainerView *containerView; // @synthesize containerView=_containerView; +@property(retain) DVTSourceTextView *textView; // @synthesize textView=_textView; +@property(retain) NSScrollView *scrollView; // @synthesize scrollView=_scrollView; +- (BOOL)editorWantsAnnotationsFromProviderClass:(Class)arg1; +- (BOOL)editorDocumentIsCurrentRevision; +- (BOOL)editorIsHostedInComparisonEditor; +- (id)_documentLocationForLineNumber:(long long)arg1; +- (void)_createFileBreakpointAtLocation:(long long)arg1; +- (id)_breakpointManager; +- (long long)_currentOneBasedLineNubmer; +- (id)currentEditorContext; +- (id)documentLocationForOpenQuicklyQuery:(id)arg1; +- (void)openQuicklyScoped:(id)arg1; +- (void)debugLogJumpToDefinitionState:(id)arg1; +- (id)_jumpToDefinitionOfExpression:(id)arg1 fromScreenPoint:(struct CGPoint)arg2 clickCount:(long long)arg3 modifierFlags:(unsigned long long)arg4; +- (void)_cancelHelpNavigationRequest; +- (void)_cancelCurrentNavigationRequest; +- (void)contextMenu_revealInSymbolNavigator:(id)arg1; +- (void)jumpToSelection:(id)arg1; +- (void)jumpToDefinitionWithShiftPlusAlternate:(id)arg1; +- (void)jumpToDefinitionWithAlternate:(id)arg1; +- (void)jumpToDefinition:(id)arg1; +- (void)revealInSymbolNavigator:(id)arg1; +- (unsigned long long)_insertionIndexUnderMouse; +- (id)_documentLocationUnderMouse; +- (id)_calculateContinueToDocumentLocationFromDocumentLocation:(id)arg1; +- (id)_calculateContinueToLineDocumentLocation; +- (id)_calculateContinueToHereDocumentLocation; +- (BOOL)validateMenuItem:(id)arg1; +- (void)menuNeedsUpdate:(id)arg1; +- (void)mouseExited:(id)arg1; +- (void)mouseEntered:(id)arg1; +- (void)mouseMoved:(id)arg1; +- (void)deregisterForMouseEvents; +- (void)registerForMouseEvents; +- (struct CGRect)expressionFrameForExpression:(id)arg1; +- (id)importStringInExpression:(id)arg1; +- (BOOL)isExpressionModuleImport:(id)arg1; +- (BOOL)isExpressionPoundImport:(id)arg1; +- (BOOL)_isExpressionImport:(id)arg1 module:(BOOL)arg2; +- (BOOL)expressionContainsExecutableCode:(id)arg1; +- (BOOL)isExpressionFunctionOrMethodCall:(id)arg1; +- (BOOL)isExpressionInFunctionOrMethodBody:(id)arg1; +- (BOOL)isLocationInFunctionOrMethodBody:(id)arg1; +- (BOOL)isExpressionFunctionOrMethodDefinition:(id)arg1; +- (BOOL)isExpressionInPlainCode:(id)arg1; +- (BOOL)isExpressionWithinComment:(id)arg1; +- (void)symbolsForExpression:(id)arg1 inQueue:(struct dispatch_queue_s *)arg2 completionBlock:(id)arg3; +@property(readonly, nonatomic) NSString *selectedText; +@property(readonly, nonatomic) struct CGRect currentSelectionFrame; +- (void)_sendDelayedSelectedExpressionDidChangeMessage; +@property(retain, nonatomic) DVTSourceExpression *selectedExpression; // @synthesize selectedExpression=_selectedExpression; +- (void)_invalidateMouseOverExpression; +@property(readonly) DVTSourceExpression *quickHelpExpression; +@property(readonly) DVTSourceExpression *contextMenuExpression; +- (void)_updatedMouseOverExpression; +- (void)_updateSelectedExpression; +- (BOOL)_expression:(id)arg1 representsTheSameLocationAsExpression:(id)arg2; +- (id)_expressionAtCharacterIndex:(unsigned long long)arg1; +- (id)refactoringExpressionUsingContextMenu:(BOOL)arg1; +- (id)selectedTestsAndTestables; +- (id)_testFromModelItem:(id)arg1 fromTests:(id)arg2; +- (void)specialPaste:(id)arg1; +- (id)_specialPasteContext; +- (void)_changeSourceCodeLanguageAction:(id)arg1; +- (void)_useSourceCodeLanguageFromFileDataTypeAction:(id)arg1; +- (void)_askToPromoteToUnicodeSheetDidEnd:(id)arg1 returnCode:(long long)arg2 contextInfo:(void *)arg3; +- (void)_askToPromoteToUnicode; +- (void)_applyPerFileTextSettings; +- (void)textView:(id)arg1 doubleClickedOnCell:(id)arg2 inRect:(struct CGRect)arg3 atIndex:(unsigned long long)arg4; +- (void)textView:(id)arg1 clickedOnCell:(id)arg2 inRect:(struct CGRect)arg3 atIndex:(unsigned long long)arg4; +- (void)contextMenu_toggleIssueShown:(id)arg1; +- (void)toggleIssueShown:(id)arg1; +- (void)_enumerateDiagnosticAnnotationsInSelection:(id)arg1; +- (id)_jumpToAnnotationWithSelectedRange:(struct _NSRange)arg1 fixIt:(BOOL)arg2 backwards:(BOOL)arg3; +- (void)fixAllInScope:(id)arg1; +- (id)fixableDiagnosticAnnotationsInScope; +- (id)_diagnosticAnnotationsInScopeFixableOnly:(BOOL)arg1; +- (id)_diagnosticAnnotationsInRange:(struct _NSRange)arg1 fixableOnly:(BOOL)arg2; +- (void)popoverWillClose:(id)arg1; +- (id)viewWindow; +- (BOOL)detailShouldShowOpenBlameView; +- (void)openBlameView; +- (void)openComparisonView; +- (void)blameSelectedLine:(id)arg1; +- (void)_showDocumentationForSelectedSymbol:(id)arg1; +- (void)showQuickHelp:(id)arg1; +- (void)continueToCurrentLine:(id)arg1; +- (void)continueToHere:(id)arg1; +- (void)toggleInvisibleCharactersShown:(id)arg1; +- (void)toggleBreakpointAtCurrentLine:(id)arg1; +- (void)_stopShowingContentGenerationProgressInidcator; +- (void)_showContentGenerationProgressIndicatorWithDelay:(double)arg1; +- (void)_contentGenerationProgressTimerFired:(id)arg1; +- (void)_hideEmptyView; +- (void)_showEmptyViewWithMessage:(id)arg1; +- (void)_centerViewInSuperView:(id)arg1; +- (void)compileCurrentFile; +- (void)analyzeCurrentFile; +- (void)preprocessCurrentFile; +- (void)assembleCurrentFile; +- (void)_processCurrentFileUsingBuildCommand:(int)arg1; +- (id)_singleFileProcessingFilePath; +- (void)startSingleProcessingModeForURL:(id)arg1; +@property(readonly) BOOL isWorkspaceBuilding; +- (BOOL)canAssembleFile; +- (BOOL)canPreprocessFile; +- (BOOL)canAnalyzeFile; +- (BOOL)canCompileFile; +- (void)stopNoteExplorer; +- (void)startNoteExplorerForItem:(id)arg1; +- (void)showErrorsOnly:(id)arg1; +- (void)showAllIssues:(id)arg1; +- (void)toggleMessageBubbles:(id)arg1; +- (void)hideAnalyzerExplorerAnimate:(BOOL)arg1; +- (void)showAnalyzerExplorerForMessage:(id)arg1 animate:(BOOL)arg2; +- (void)_startPrefetchingNodeTypesInUpDirection:(BOOL)arg1 initialLineRange:(struct _NSRange)arg2 noProgressIterations:(unsigned long long)arg3; +- (void)revertStateWithDictionary:(id)arg1; +- (void)commitStateToDictionary:(id)arg1; +- (void)configureStateSavingObservers; +- (id)_transientStateDictionaryForDocument:(id)arg1; +- (id)_stateDictionariesForDocuments; +- (id)cursorForAltTemporaryLink; +- (void)_textViewDidLoseFirstResponder; +- (BOOL)completingTextViewHandleCancel:(id)arg1; +- (void)textViewDidScroll:(id)arg1; +- (void)textViewDidFinishAnimatingScroll:(id)arg1; +- (id)textView:(id)arg1 menu:(id)arg2 forEvent:(id)arg3 atIndex:(unsigned long long)arg4; +- (void)tokenizableItemsForItemAtRange:(struct _NSRange)arg1 completionBlock:(id)arg2; +- (void)textViewBoundsDidChange:(id)arg1; +- (void)textView:(id)arg1 handleMouseDidExitSidebar:(id)arg2; +- (void)textView:(id)arg1 handleMouseDidMoveOverSidebar:(id)arg2 atLineNumber:(unsigned long long)arg3; +- (void)textView:(id)arg1 handleMouseDownInSidebar:(id)arg2 atLineNumber:(unsigned long long)arg3; +- (id)completingTextView:(id)arg1 documentLocationForWordStartLocation:(unsigned long long)arg2; +- (void)completingTextView:(id)arg1 willPassContextToStrategies:(id)arg2 atWordStartLocation:(unsigned long long)arg3; +- (void)textView:(id)arg1 didClickOnTemporaryLinkAtCharacterIndex:(unsigned long long)arg2 event:(id)arg3 isAltEvent:(BOOL)arg4; +- (void)_doubleClickOnTemporaryHelpLinkTimerExpired; +- (void)_doubleClickOnTemporaryLinkTimerExpired; +- (BOOL)textView:(id)arg1 shouldShowTemporaryLinkForCharacterAtIndex:(unsigned long long)arg2 proposedRange:(struct _NSRange)arg3 effectiveRanges:(id *)arg4; +- (void)textView:(id)arg1 didRemoveAnnotations:(id)arg2; +- (void)textViewDidLoadAnnotationProviders:(id)arg1; +- (id)annotationContextForTextView:(id)arg1; +- (id)syntaxColoringContextForTextView:(id)arg1; +- (BOOL)textView:(id)arg1 shouldChangeTextInRange:(struct _NSRange)arg2 replacementString:(id)arg3; +- (void)setupTextViewContextMenuWithMenu:(id)arg1; +- (void)setupGutterContextMenuWithMenu:(id)arg1; +- (void)textViewDidChangeSelection:(id)arg1; +- (void)textDidChange:(id)arg1; +- (void)removeVisualization:(id)arg1 fadeOut:(BOOL)arg2 completionBlock:(id)arg3; +- (void)addVisualization:(id)arg1 fadeIn:(BOOL)arg2 completionBlock:(id)arg3; +@property(readonly) NSArray *visualizations; +- (id)pathCell:(id)arg1 menuItemForNavigableItem:(id)arg2 defaultMenuItem:(id)arg3; +- (BOOL)pathCell:(id)arg1 shouldInitiallyShowMenuSearch:(id)arg2; +- (BOOL)pathCell:(id)arg1 shouldSeparateDisplayOfChildItemsForItem:(id)arg2; +- (struct _NSRange)selectedRangeForFindBar:(id)arg1; +- (id)startingLocationForFindBar:(id)arg1 findingBackwards:(BOOL)arg2; +- (void)dvtFindBar:(id)arg1 didUpdateCurrentResult:(id)arg2; +- (void)dvtFindBar:(id)arg1 didUpdateResults:(id)arg2; +- (void)_sourceCodeDocumentDidSave:(id)arg1; +- (void)_sourceCodeDocumentWillSave:(id)arg1; +- (void)didSetupEditor; +- (void)takeFocus; +- (BOOL)canBecomeMainViewController; +- (id)undoManagerForTextView:(id)arg1; +- (void)viewWillUninstall; +- (void)viewDidInstall; +- (void)contentViewDidCompleteLayout; +- (void)_doInitialSetup; +- (void)_liveIssuesPreferencesUpdatedInvalidateDiagnosticController:(BOOL)arg1; +- (void)_blueprintDidChangeForSourceCodeEditor:(id)arg1; +- (void)_endObservingDiagnosticItems; +- (void)_startObservingDiagnosticItems; +- (void)primitiveInvalidate; +- (void)selectDocumentLocations:(id)arg1 highlightSelection:(BOOL)arg2; +- (void)selectAndHighlightDocumentLocations:(id)arg1; +- (void)selectDocumentLocations:(id)arg1; +- (void)navigateToAnnotationWithRepresentedObject:(id)arg1 wantsIndicatorAnimation:(BOOL)arg2 exploreAnnotationRepresentedObject:(id)arg3; +- (id)currentSelectedDocumentLocations; +- (id)_currentSelectedLandmarkItem; +- (void)setCurrentSelectedItems:(id)arg1; +- (id)currentSelectedItems; +- (void)_refreshCurrentSelectedItemsIfNeeded; +- (BOOL)_isCurrentSelectedItemsValid; +@property(readonly) IDESourceCodeEditorAnnotationProvider *annotationProvider; // @synthesize annotationProvider=_annotationProvider; +- (id)mainScrollView; +@property(readonly) IDESourceCodeDocument *sourceCodeDocument; +- (void)loadView; +- (id)initWithNibName:(id)arg1 bundle:(id)arg2 document:(id)arg3; +@property __weak DVTScopeBarController *analyzerResultsScopeBar; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDESourceCodeEditorContainerView.h b/SCXcodeMinimap/Xcode Headers/IDESourceCodeEditorContainerView.h new file mode 100644 index 0000000..57bd178 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDESourceCodeEditorContainerView.h @@ -0,0 +1,27 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + + +@class DVTStackBacktrace, IDESourceCodeEditor, IDEViewController; + +@interface IDESourceCodeEditorContainerView : NSView +{ + IDESourceCodeEditor *_editor; + IDEViewController *_toolbarViewController; +} + ++ (void)initialize; +@property(retain) IDESourceCodeEditor *editor; // @synthesize editor=_editor; +- (void)primitiveInvalidate; +- (void)showToolbarWithViewController:(id)arg1; +- (void)didCompleteLayout; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDEViewController.h b/SCXcodeMinimap/Xcode Headers/IDEViewController.h new file mode 100644 index 0000000..69501aa --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEViewController.h @@ -0,0 +1,39 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTViewController.h" + +@class DVTStateToken, IDESelection, IDEWorkspace, IDEWorkspaceDocument, IDEWorkspaceTabController; + +@interface IDEViewController : DVTViewController +{ + IDEWorkspaceTabController *_workspaceTabController; + id _outputSelection; + id _contextMenuSelection; + DVTStateToken *_stateToken; +} + ++ (void)configureStateSavingObjectPersistenceByName:(id)arg1; ++ (long long)version; +@property(retain, nonatomic) IDEWorkspaceTabController *workspaceTabController; // @synthesize workspaceTabController=_workspaceTabController; +@property(copy) IDESelection *contextMenuSelection; // @synthesize contextMenuSelection=_contextMenuSelection; +@property(copy) IDESelection *outputSelection; // @synthesize outputSelection=_outputSelection; +- (void)setStateToken:(id)arg1; +- (BOOL)_knowsAboutInstalledState; +- (void)revertState; +- (void)commitState; +- (void)commitStateToDictionary:(id)arg1; +- (void)revertStateWithDictionary:(id)arg1; +- (void)primitiveInvalidate; +@property(readonly) BOOL automaticallyInvalidatesChildViewControllers; +- (void)_invalidateSubViewControllersForView:(id)arg1; +- (id)supplementalTargetForAction:(SEL)arg1 sender:(id)arg2; +@property(readonly) IDEWorkspace *workspace; +@property(readonly) IDEWorkspaceDocument *workspaceDocument; +- (id)workspaceDocumentProvider; +- (id)initWithNibName:(id)arg1 bundle:(id)arg2; + +@end From 36ebc0b89352c7130d10399e7b916aa702cc16d5 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 25 Jan 2015 10:26:08 +0000 Subject: [PATCH 25/96] - added back layout manager delegate methods - added methods for fetching comment and preprocessor colors - removed test file --- SCXcodeMinimap.xcodeproj/project.pbxproj | 2 - SCXcodeMinimap/SCXcodeMinimapView.m | 32 + SCXcodeMinimap/ShitFile.h | 1607 ---------------------- 3 files changed, 32 insertions(+), 1609 deletions(-) delete mode 100644 SCXcodeMinimap/ShitFile.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index f4d8fbd..89d7ac0 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -39,7 +39,6 @@ 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapSelectionView.m; sourceTree = ""; }; 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapView.h; sourceTree = ""; }; 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapView.m; sourceTree = ""; }; - 184C11851A740F97002A7C65 /* ShitFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShitFile.h; sourceTree = ""; }; 184C118E1A741136002A7C65 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDESourceEditor.ideplugin; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin; sourceTree = ""; }; @@ -145,7 +144,6 @@ 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */, 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */, - 184C11851A740F97002A7C65 /* ShitFile.h */, 18FE09BC1707639E00118FEB /* Supporting Files */, 184C11701A740F8A002A7C65 /* Xcode Headers */, ); diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index bd65e4e..51d78bb 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -20,6 +20,8 @@ const CGFloat kDefaultZoomLevel = 0.1f; const CGFloat kDefaultShadowLevel = 0.1f; +static NSString * const kXcodeSyntaxCommentColor = @"xcode.syntax.comment"; +static NSString * const kXcodeSyntaxPreprocessorColor = @"xcode.syntax.preprocessor"; static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; @interface SCXcodeMinimapView () @@ -102,8 +104,28 @@ - (void)setVisible:(BOOL)visible if(visible) { [self updateOffset]; } + + // Ensure the layout manager's delegate is set to self. The DVTSourceTextView resets it if called to early. + [self.textView.layoutManager setDelegate:self]; +} + +#pragma mark - NSLayoutManagerDelegate + +- (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange +{ + DVTTextStorage *storage = [self.editorTextView textStorage]; + NSColor *color = [storage colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; + return @{NSForegroundColorAttributeName : color}; } +- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinished +{ + if(layoutFinished) { + [self updateOffset]; + } +} + + #pragma mark - Navigation - (void)updateOffset @@ -183,6 +205,16 @@ - (NSColor *)backgroundColor return [[NSColor clearColor] shadowWithLevel:kDefaultShadowLevel]; } +- (NSColor *)commentColor +{ + return [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentColor]]; +} + +- (NSColor *)preprocessorColor +{ + return [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorColor]]; +} + #pragma mark - Autoresizing - (void)resizeWithOldSuperviewSize:(NSSize)oldSize diff --git a/SCXcodeMinimap/ShitFile.h b/SCXcodeMinimap/ShitFile.h deleted file mode 100644 index f747d9a..0000000 --- a/SCXcodeMinimap/ShitFile.h +++ /dev/null @@ -1,1607 +0,0 @@ -// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -//// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -//// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -//// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -// - -#import - -@interface DVTSourceCodeSymbolKind : NSObject -+ (id)containerSymbolKind; -+ (id)globalSymbolKind; -+ (id)callableSymbolKind; -+ (id)memberSymbolKind; -+ (id)memberContainerSymbolKind; -+ (id)categorySymbolKind; -+ (id)classMethodSymbolKind; -+ (id)classSymbolKind; -+ (id)enumSymbolKind; -+ (id)enumConstantSymbolKind; -+ (id)fieldSymbolKind; -+ (id)functionSymbolKind; -+ (id)instanceMethodSymbolKind; -+ (id)instanceVariableSymbolKind; -+ (id)classVariableSymbolKind; -+ (id)macroSymbolKind; -+ (id)parameterSymbolKind; -+ (id)propertySymbolKind; -+ (id)protocolSymbolKind; -+ (id)structSymbolKind; -+ (id)typedefSymbolKind; -+ (id)unionSymbolKind; -+ (id)localVariableSymbolKind; -+ (id)globalVariableSymbolKind; -+ (id)ibActionMethodSymbolKind; -+ (id)ibOutletSymbolKind; -+ (id)ibOutletVariableSymbolKind; -+ (id)ibOutletPropertySymbolKind; -+ (id)ibOutletCollectionSymbolKind; -+ (id)ibOutletCollectionVariableSymbolKind; -+ (id)ibOutletCollectionPropertySymbolKind; -+ (id)namespaceSymbolKind; -+ (id)classTemplateSymbolKind; -+ (id)functionTemplateSymbolKind; -+ (id)instanceMethodTemplateSymbolKind; -+ (id)classMethodTemplateSymbolKind; -+ (void)initialize; -+ (id)sourceCodeSymbolKinds; -- (id)icon; -- (id)description; -- (id)conformedToSymbolKinds; -- (id)allConformingSymbolKinds; -- (char)isContainer; -- (id)identifier; -- (id)localizedDescription; -@end - -@interface IDEDocumentController : NSObject -+ (id)sharedDocumentController; -- (NSArray *)workspaceDocuments; -@end - -@class DVTDocumentLocation, DVTFileDataType; -@interface DVTFilePath : NSObject -- (NSURL *)fileURL; -- (NSString *)pathString; -- (NSString *)fileName; -+ (DVTFilePath *)filePathForPathString:(NSString *)path; -- (DVTFilePath *)file; -- (NSImage *)navigableItem_image; - -- (DVTDocumentLocation *)navigableItem_contentDocumentLocation; -- (DVTFileDataType *)navigableItem_documentType; -- (DVTFilePath *)parentFilePath; -- (DVTFilePath *)volumeFilePath; -@end - -@interface IDEIndex : NSObject -{ -} - -+ (BOOL)languageSupportsSymbolColoring:(id)arg1; -+ (id)resolutionForName:(id)arg1 kind:(id)arg2 containerName:(id)arg3; -+ (id)pathToClang; -+ (id)_dataSourceExtensionForFile:(id)arg1 withLanguage:(id)arg2; -+ (void)syncPerformBlockOnMainThread:(dispatch_block_t)arg1; -+ (void)initialize; -+ (BOOL)includeAutoImportResults; -+ (BOOL)indexFollowsActiveScheme; -+ (id)schedulingLogAspect; -+ (id)clangInvocationLogAspect; -+ (id)symbolAdditionLogAspect; -+ (id)deferredMetricLogAspect; -+ (id)metricLogAspect; -+ (id)logAspect; -@property(readonly, nonatomic) DVTFilePath *databaseFile; // @synthesize databaseFile=_databaseFile; -//@property(readonly, nonatomic) IDEIndexDatabase *database; // @synthesize database=_workspaceDatabase; -- (id)targetIdentifiersForFile:(id)arg1; -- (id)mainFilesForFile:(id)arg1; -- (id)sdkForFile:(id)arg1; -- (id)timestampForFile:(id)arg1; -- (void)_buildOperationDidStop:(id)arg1; -- (void)_buildSettingsDidChange:(id)arg1; -- (void)_activeRunDestinationDidChange:(id)arg1; -- (void)_activeRunContextDidChange:(id)arg1; -- (void)_clearAllCachedBuildSettings; -- (void)_computePreferredTargets; -- (BOOL)isPreferredTarget:(id)arg1 priority:(char *)arg2; -- (BOOL)isPreferredTarget:(id)arg1; -- (id)databaseQueryProvider; -- (id)queryProviderForLocation:(id)arg1 highPriority:(BOOL)arg2; -- (void)dontDeferJobForFile:(id)arg1 indexable:(id)arg2; -- (void)registerHotFile:(id)arg1; -- (id)queryProviderForFile:(id)arg1 highPriority:(BOOL)arg2; -- (id)resolutionForName:(id)arg1 kind:(id)arg2 containerName:(id)arg3; -- (id)indexableForCopiedHeader:(id)arg1; -- (id)originalPathsForPaths:(id)arg1; -- (id)effectivePathForHeader:(id)arg1; -- (void)_initCopiedHeaders; -- (void)indexModuleIfNeeded:(id)arg1; -- (void)_cleanupOldPCHs; -- (void)didCancelIndexingPCHFile:(id)arg1; -- (BOOL)createPCHFile:(id)arg1 arguments:(id)arg2 hashCriteria:(id)arg3 target:(id)arg4 session:(id)arg5 willIndex:(BOOL)arg6 translationUnit:(id *)arg7; -- (void)database:(id)arg1 reportAutoQueryProgress:(double)arg2; -- (void)clearPCHFailuresForDatabase:(id)arg1; -- (void)databaseDidReportError:(id)arg1; -- (void)databaseDidLoad:(id)arg1; -- (void)databaseDidOpen:(id)arg1; -- (id)databaseProvidersAndVersions:(id)arg1; -- (void)database:(id)arg1 didForgetFiles:(id)arg2; -- (void)database:(id)arg1 didEndImportSession:(id)arg2; -- (void)databaseDidSave:(id)arg1; -- (void)databaseDidIndexHotFile:(id)arg1; -- (void)_respondToFileChangeNotification:(id)arg1; -@property(readonly, nonatomic) DVTFilePath *workspaceFile; -@property(readonly, nonatomic) NSString *workspaceName; -- (id)dataSourceExtensionForFile:(id)arg1 settings:(id)arg2; -- (id)_dataSourceExtensionForFile:(id)arg1 withSettings:(id)arg2; -- (id)settingsForFile:(id)arg1 indexable:(id)arg2; -- (id)_waitForSettingsForFile:(id)arg1 object:(id)arg2; -- (id)_waitForSettingsFromObject:(id)arg1; -- (id)workspaceHeadersForIndexable:(id)arg1; -- (void)gatherProductHeadersForIndexable:(id)arg1; -- (long long)purgeCount; -- (void)purgeFileCaches; -- (void)close; -- (void)editorWillSaveFile:(id)arg1; -- (void)expediteIndexing; -- (void)_stopIndexing; -- (void)setThrottleFactor:(double)arg1; -- (void)resumeIndexing; -- (void)suspendIndexing; -@property(readonly, nonatomic) BOOL shouldAllowRefactoring; -@property(readonly, nonatomic) BOOL isQuiescent; -- (void)doWhenFilesReady:(dispatch_block_t)arg1; -- (void)willRegisterMoreFiles:(BOOL)arg1; -- (void)unregisterFile:(id)arg1; -- (void)registerFile:(id)arg1; -- (id)indexableForIdentifier:(id)arg1; -- (void)unregisterObject:(id)arg1; -- (void)registerObject:(id)arg1; -- (void)postNotificationName:(id)arg1; -- (void)postNotificationName:(id)arg1 userInfo:(id)arg2; -- (id)description; -- (void)setIndexState:(id)arg1; -- (id)indexState; -@property(readonly) DVTFilePath *workspaceBuildProductsDirPath; -@property(readonly) DVTFilePath *headerMapFilePath; -- (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; -- (BOOL)isCurrentForWorkspace:(id)arg1; -- (void)beginTextIndexing; -- (id)initWithWorkspace:(id)arg1; -- (id)initWithFolder:(id)arg1; -- (id)initWithFolder:(id)arg1 forWorkspace:(id)arg2; -- (void)_cleanupOldIndexFoldersForWorkspace:(id)arg1; -- (double)_atime:(struct stat *)arg1; -- (BOOL)_stat:(struct stat *)arg1 filePath:(id)arg2; -- (id)_databaseFileURLForFolder:(id)arg1; -- (id)_databaseFolderForWorkspace:(id)arg1; -- (BOOL)_reopenDatabaseWithRemoval:(BOOL)arg1; -- (BOOL)_createDatabaseFolder; -- (void)_setupObservers; -- (id)allAutoImportItemsMatchingKind:(id)arg1 symbolLanguage:(id)arg2; -- (id)allAutoImportItemsMatchingKind:(id)arg1; -- (id)filesWithSymbolOccurrencesMatchingName:(id)arg1 kind:(id)arg2; -- (id)classesWithReferencesToSymbols:(id)arg1; -- (id)allClassesWithMembers:(id)arg1; -- (id)classesWithMembers:(id)arg1; -- (id)allMethodsMatchingMethod:(id)arg1 forReceiver:(id)arg2; -- (id)membersMatchingName:(id)arg1 kinds:(id)arg2 forInterfaces:(id)arg3; -- (id)membersMatchingKinds:(id)arg1 forInterfaces:(id)arg2; -- (id)symbolsForResolutions:(id)arg1; -- (id)parsedCodeCommentAtLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)codeDiagnosticsAtLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)codeCompletionsAtLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2 completionContext:(id *)arg3; -- (id)allParentsOfSymbols:(id)arg1 cancelWhen:(dispatch_block_t)arg2; -- (id)topLevelSymbolsInFile:(id)arg1; -- (unsigned long long)countOfSymbolsMatchingKind:(id)arg1 workspaceOnly:(BOOL)arg2; -- (id)allSymbolsMatchingKind:(id)arg1 workspaceOnly:(BOOL)arg2 cancelWhen:(dispatch_block_t)arg3; -- (id)allSymbolsMatchingKind:(id)arg1 workspaceOnly:(BOOL)arg2; -- (id)allSymbolsMatchingKind:(id)arg1; -- (id)testMethodsForClasses:(id)arg1; -- (id)allSubClassesForClasses:(id)arg1; -- (id)allSymbolsMatchingNames:(id)arg1 kind:(id)arg2; -- (id)allSymbolsMatchingName:(id)arg1 kind:(id)arg2; -- (id)allProtocolsMatchingName:(id)arg1; -- (id)allClassesMatchingName:(id)arg1; -- (id)impliedHeadersForModuleImportLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)importedFileAtDocumentLocation:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)importedFilesAtDocument:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)collectionElementTypeSymbolForSymbol:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)typeSymbolForSymbol:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)messageReceiverInContext:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)referencesToSymbolMatchingName:(id)arg1 inContext:(id)arg2 withCurrentFileContentDictionary:(id)arg3; -- (id)referencesToSymbol:(id)arg1 inContext:(id)arg2 withCurrentFileContentDictionary:(id)arg3; -- (id)symbolsUsedInContext:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)symbolsOccurrencesInContext:(id)arg1 withCurrentFileContentDictionary:(id)arg2; -- (id)symbolsMatchingName:(id)arg1 inContext:(id)arg2 withCurrentFileContentDictionary:(id)arg3; -- (id)symbolsMatchingName:(id)arg1 inContext:(id)arg2; -- (id)symbolsContaining:(id)arg1 anchorStart:(BOOL)arg2 anchorEnd:(BOOL)arg3 subsequence:(BOOL)arg4 ignoreCase:(BOOL)arg5 cancelWhen:(dispatch_block_t)arg6; -- (id)symbolsContaining:(id)arg1 anchorStart:(BOOL)arg2 anchorEnd:(BOOL)arg3 subsequence:(BOOL)arg4 ignoreCase:(BOOL)arg5; -- (id)topLevelProtocolsWorkspaceOnly:(BOOL)arg1 cancelWhen:(dispatch_block_t)arg2; -- (id)topLevelProtocolsWorkspaceOnly:(BOOL)arg1; -- (id)topLevelProtocols; -- (id)topLevelClassesWorkspaceOnly:(BOOL)arg1 cancelWhen:(dispatch_block_t)arg2; -- (id)topLevelClassesWorkspaceOnly:(BOOL)arg1; -- (id)topLevelClasses; -- (id)filesContaining:(id)arg1 anchorStart:(BOOL)arg2 anchorEnd:(BOOL)arg3 subsequence:(BOOL)arg4 ignoreCase:(BOOL)arg5 cancelWhen:(dispatch_block_t)arg6; -- (id)filesIncludedByFile:(id)arg1; -- (id)filesIncludingFile:(id)arg1; -- (id)mainFileForSelectionFilePath:(id)arg1 buildSettings:(id *)arg2; -- (id)objCOrCCompilationUnitIndexablesForMainFile:(id)arg1 indexableObjects:(id)arg2; -- (BOOL)isFileObjCCompilationUnitOrHeader:(id)arg1 error:(id *)arg2; -- (id)_localizedPhraseForDependentObjCCompilationUnit:(id)arg1 errorLanguages:(id)arg2 sharedLanguageIdentifier:(id)arg3 sharedIndexableObject:(id)arg4; -- (id)_localizedDescriptionForObjCCompilationUnit:(id)arg1 errorLanguages:(id)arg2; -- (BOOL)_errorLanguages:(id *)arg1 forFilePath:(id)arg2 indexableObjects:(id)arg3; - -@end - -@class IDEIndexDatabase; -@interface IDEIndexDatabaseQueryProvider : NSObject -- (id)topLevelSymbolsInFile:(NSString *)filePath forIndex:(IDEIndex *)index; -- (id)filesContaining:(NSString *)a anchorStart:(NSString *)b anchorEnd:(NSString *)c subsequence:(NSString *)d ignoreCase:(BOOL)ignoreCase forIndex:(IDEIndex *)wwefwew; -- (IDEIndexDatabase *)database; -@end - -@interface IDEIndexDBConnection : NSObject -- (void)close; -- (void)finalize; -- (id)dbConnection; -@end - -@interface IDEIndexDatabase : NSObject -- (IDEIndexDatabase *)initWithFileURL:(NSURL *)fileURL; -- (IDEIndexDatabaseQueryProvider *)queryProvider; -- (void)open; -- (void)openReadonly; -- (void)openInDiagnosticMode; -- (void)close; -- (id)mainFilesForTarget:(NSString *)targetNameOrWTF; -- (IDEIndexDBConnection *)newConnection; -- (NSURL *)fileURL; -@end - -@interface DVTModelObject : NSObject -@end - -@interface IDEContainerItem : DVTModelObject -@end - -@interface IDEGroup : IDEContainerItem -- (NSArray *)subitems; -- (NSImage *)navigableItem_image; -@end - -@interface IDEContainer : DVTModelObject -- (DVTFilePath *)filePath; -- (IDEGroup *)rootGroup; -- (void)debugPrintInnerStructure; -- (void)debugPrintStructure; -@end - -@interface IDEXMLPackageContainer : IDEContainer -@end - -@interface IDEWorkspace : IDEXMLPackageContainer -- (IDEIndex *)index; -- (NSString *)name; -- (NSSet *)referencedContainers; -@end - -@interface IDEWorkspaceDocument : NSObject -- (IDEWorkspace *)workspace; -- (NSArray *)recentEditorDocumentURLs; -- (id)sdefSupport_fileReferences; -@end - -@interface IDEWorkspaceWindow : NSWindow -- (IDEWorkspaceDocument *)document; -@end - -@interface IDEWorkspaceWindow (MissingMethods) -+ (IDEWorkspaceWindow *)mc_lastActiveWorkspaceWindow; -@end - -@interface IDEFileReference : NSObject -- (IDEContainer *)referencedContainer; -@end - -@interface PBXObject : NSObject -@end - -@interface PBXContainer : PBXObject -- (NSString *)name; -@end - -@interface PBXContainerItem : PBXObject -@end - -@class PBXGroup; -@interface PBXReference : PBXContainerItem -- (BOOL)isGroup; -- (NSString *)name; -- (NSString *)absolutePath; -- (PBXGroup *)group; -- (PBXContainer *)container; -@end - -@interface PBXGroup : PBXReference -- (NSArray *)children; -@end - -@interface Xcode3Group : IDEGroup -- (PBXGroup *)group; -@end - -@interface Xcode3Project : IDEContainer -- (Xcode3Group *)rootGroup; -@end - -@interface DVTApplication : NSApplication -@end - -@interface IDEApplication : DVTApplication -+ (IDEApplication *)sharedApplication; -@end - -@interface IDEApplicationController : NSObject -+ (IDEApplicationController *)sharedAppController; -- (BOOL)application:(IDEApplication *)application openFile:(NSString *)filePath; -@end - -@interface XCSpecification : NSObject -@end - -@interface PBXFileType : XCSpecification -- (BOOL)isBundle; -- (BOOL)isApplication; -- (BOOL)isLibrary; -- (BOOL)isFramework; -- (BOOL)isProjectWrapper; -- (BOOL)isTargetWrapper; -- (BOOL)isExecutable; -@end - -@interface PBXFileReference : PBXReference -- (NSString *)resolvedAbsolutePath; -- (id)fileType; -- (NSArray *)children; -@end - -@interface IDEIndexSymbolOccurrence : NSObject -- (id)file; -- (id)location; -- (long long)lineNumber; -@end - -@interface IDEIndexCollection : NSObject -- (NSArray *)allObjects; -@end - -@interface IDEIndexSymbolOccurrenceCollection : IDEIndexCollection -@end - -@interface IDEIndexSymbol : NSObject -- (NSString *)name; -- (DVTSourceCodeSymbolKind *)symbolKind; -- (NSString *)displayText; -- (NSString *)completionText; -- (NSString *)displayType; -- (NSString *)descriptionText; -- (NSImage *)icon; - -- (IDEIndexSymbolOccurrence *)modelOccurrence; -- (IDEIndexSymbolOccurrenceCollection *)occurrences; -- (IDEIndexSymbolOccurrenceCollection *)declarations; -- (IDEIndexSymbolOccurrenceCollection *)definitions; - -- (NSArray *)containerSymbols; -- (id)containerSymbol; - -- (unsigned long long)hash; -@end - -@interface IDEIndexContainerSymbol : IDEIndexSymbol -- (NSArray *)children; -@end - -@interface IDEIndexClassSymbol : IDEIndexContainerSymbol -- (NSArray *)categories; -@end - -@interface IDEIndexProtocolSymbol : IDEIndexContainerSymbol -@end - -@interface IDEIndexCategorySymbol : IDEIndexContainerSymbol -- (NSArray *)classMethods; -- (NSArray *)instanceMethods; -- (NSArray *)properties; -@end - -@interface IDENavigableItem : NSObject -+ (IDENavigableItem *)navigableItemWithRepresentedObject:(id)object; -@end - -@interface IDEFileNavigableItem : IDENavigableItem -+ (IDEFileNavigableItem *)navigableItemWithRepresentedObject:(id)object; -@end - -@interface IDEFileReferenceNavigableItem : IDEFileNavigableItem -+ (IDEFileReferenceNavigableItem *)navigableItemWithRepresentedObject:(id)object; -@end - -@interface DVTDocumentLocation : NSObject -- (DVTDocumentLocation *)initWithDocumentURL:(NSURL *)documentURL timestamp:(NSNumber *)timestamp; -- (NSURL *)documentURL; -@end - -@interface DVTTextDocumentLocation : DVTDocumentLocation -- (DVTTextDocumentLocation *)initWithDocumentURL:(NSURL *)documentURL timestamp:(NSNumber *)timestamp lineRange:(NSRange)lineRange; -- (NSRange)characterRange; -- (NSURL *)documentURL; -@end - -@interface DVTViewController : NSViewController -@end - -@class DVTExtension; -@interface IDEViewController : DVTViewController - -@property (nonatomic, retain) DVTExtension *representedExtension; - -@end - -@interface IDEEditorOpenSpecifier : NSObject -- (IDEEditorOpenSpecifier *)initWithNavigableItem:(IDENavigableItem *)navigableItem error:(NSError *)error; -+ (IDEEditorOpenSpecifier *)structureEditorOpenSpecifierForDocumentLocation:(DVTDocumentLocation *)documentLocation inWorkspace:(IDEWorkspace *)workspace error:(NSError *)error; -@end - -@interface IDEEditorHistoryItem : NSObject -- (NSString *)historyMenuItemTitle; -- (NSURL *)documentURL; -@end - -@interface DVTSourceExpression : NSObject -- (NSString *)textSelectionString; -@end - -@interface IDEEditorHistoryStack : NSObject -- (NSArray *)previousHistoryItems; -- (NSArray *)nextHistoryItems; -- (IDEEditorHistoryItem *)currentEditorHistoryItem; -@end - -@class IDEEditor; -@interface IDEEditorContext : IDEViewController -- (BOOL)openEditorOpenSpecifier:(IDEEditorOpenSpecifier *)openSpecifier; -- (IDEEditorHistoryStack *)currentHistoryStack; -- (IDEEditor *)editor; -@end - -@interface IDEEditorArea : IDEViewController -- (IDEEditorContext *)primaryEditorContext; -- (IDEEditorContext *)lastActiveEditorContext; -@end - -@interface IDEWorkspaceWindowController : NSWindowController -+ (NSArray *)workspaceWindowControllers; -+ (IDEWorkspaceWindowController *)workspaceWindowControllerForWindow:(IDEWorkspaceWindow *)window; -- (IDEEditorArea *)editorArea; -@end - -@interface IDEKeyBinding : NSObject -- (NSString *)title; -- (NSString *)group; -- (NSArray *)actions; -- (NSArray *)keyboardShortcuts; -+ (IDEKeyBinding *)keyBindingWithTitle:(NSString *)title group:(NSString *)group actions:(NSArray *)actions keyboardShortcuts:(NSArray *)keyboardShortcuts; -+ (IDEKeyBinding *)keyBindingWithTitle:(NSString *)title parentTitle:(NSString *)parentTitle group:(NSString *)group actions:(NSArray *)actions keyboardShortcuts:(NSArray *)keyboardShortcuts; -@end - -@interface IDEMenuKeyBinding : IDEKeyBinding -- (NSString *)commandIdentifier; -+ (IDEMenuKeyBinding *)keyBindingWithTitle:(NSString *)title group:(NSString *)group actions:(NSArray *)actions keyboardShortcuts:(NSArray *)keyboardShortcuts; -+ (IDEMenuKeyBinding *)keyBindingWithTitle:(NSString *)title parentTitle:(NSString *)parentTitle group:(NSString *)group actions:(NSArray *)actions keyboardShortcuts:(NSArray *)keyboardShortcuts; -- (void)setCommandIdentifier:(NSString *)commandIdentifier; -@end - -@class IDEKeyBindingPreferenceSetManager; -@class IDEMenuKeyBindingSet; -@interface IDEKeyBindingPreferenceSet : NSObject -+ (IDEKeyBindingPreferenceSetManager *)preferenceSetsManager; -- (IDEMenuKeyBindingSet *)menuKeyBindingSet; -@end - -@interface IDEKeyBindingPreferenceSetManager : NSObject -- (IDEKeyBindingPreferenceSet *)currentPreferenceSet; -@end - -@interface IDEKeyBindingSet : NSObject -- (void)addKeyBinding:(IDEKeyBinding *)keyBinding; -- (void)insertObject:(IDEKeyBinding *)keyBinding inKeyBindingsAtIndex:(NSUInteger)index; -- (void)updateDictionary; -@end - -@interface IDEKeyboardShortcut : NSObject -+ (id)keyboardShortcutFromStringRepresentation:(NSString *)stringRep; -- (NSString *)stringRepresentation; -- (NSString *)keyEquivalent; -- (IDEKeyboardShortcut *)keyboardShortcutFromStringRepresentation:(NSString *)stringRep; -- (unsigned long long)modifierMask; -@end - -@interface IDEMenuKeyBindingSet : IDEKeyBindingSet -- (NSArray *)keyBindings; -@end - -@interface DVTLayoutView_ML : NSView -{ - NSMutableDictionary *invalidationTokens; - BOOL _layoutNeeded; - BOOL _implementsLayoutCompletionCallback; - NSCountedSet *_frameChangeObservations; - NSCountedSet *_boundsChangeObservations; - BOOL _implementsDrawRect; - BOOL _needsSecondLayoutPass; -} - -+ (void)_layoutWindow:(id)arg1; -+ (void)_recursivelyLayoutSubviewsOfView:(id)arg1 populatingSetWithLaidOutViews:(id)arg2; -+ (void)_doRecursivelyLayoutSubviewsOfView:(id)arg1 populatingSetWithLaidOutViews:(id)arg2 completionCallBackHandlers:(id)arg3 currentLayoutPass:(long long)arg4 needsSecondPass:(char *)arg5; -+ (void)scheduleWindowForLayout:(id)arg1; -+ (id)alreadyLaidOutViewsForCurrentDisplayPassOfWindow:(id)arg1; -+ (void)clearAlreadyLaidOutViewsForCurrentDisplayPassOfWindow:(id)arg1; -@property BOOL needsSecondLayoutPass; // @synthesize needsSecondLayoutPass=_needsSecondLayoutPass; -@property(getter=isLayoutNeeded) BOOL layoutNeeded; // @synthesize layoutNeeded=_layoutNeeded; -- (BOOL)wantsDefaultClipping; -- (void)stopInvalidatingLayoutWithChangesToKeyPath:(id)arg1 ofObject:(id)arg2; -- (void)invalidateLayoutWithChangesToKeyPath:(id)arg1 ofObject:(id)arg2; -- (void)_autoLayoutViewViewFrameDidChange:(id)arg1; -- (void)_autoLayoutViewViewBoundsDidChange:(id)arg1; -- (void)stopInvalidatingLayoutWithBoundsChangesToView:(id)arg1; -- (void)stopInvalidatingLayoutWithFrameChangesToView:(id)arg1; -- (void)invalidateLayoutWithBoundsChangesToView:(id)arg1; -- (void)invalidateLayoutWithFrameChangesToView:(id)arg1; -- (void)tearDownObservationForObservedObject:(id)arg1 notificationName:(id)arg2 table:(id)arg3; -- (void)setupObservationForObservedObject:(id)arg1 selector:(SEL)arg2 notificationName:(id)arg3 table:(id *)arg4; -- (void)setFrameSize:(struct CGSize)arg1; -- (void)didCompleteLayout; -- (void)layoutBottomUp; -- (void)layoutTopDown; -- (void)layoutIfNeeded; -- (void)didLayoutSubview:(id)arg1; -- (id)subviewsOrderedForLayout; -- (void)viewWillDraw; -- (void)_reallyLayoutIfNeededBottomUp; -- (void)_reallyLayoutIfNeededTopDown; -- (void)invalidateLayout; -- (void)viewDidMoveToWindow; -- (id)initWithCoder:(id)arg1; -- (id)initWithFrame:(struct CGRect)arg1; -- (void)_DVTLayoutView_MLSharedInit; -- (void)dealloc; - -@end - -@class DVTExtension, DVTStackBacktrace, DVTViewController, NSMapTable, NSString; - -@interface DVTReplacementView : DVTLayoutView_ML -{ - Class _controllerClass; - NSString *_controllerExtensionIdentifier; - DVTExtension *_controllerExtension; - DVTViewController *_installedViewController; - id _forwardedBindingInfo; - // id _delegate; - int _horizontalContentViewResizingMode; - int _verticalContentViewResizingMode; - struct { - unsigned int _needToReloadSubview:1; - unsigned int _shouldNotifyInstalledViewControllerObservers:1; - unsigned int _delegate_willInstallViewController:1; - unsigned int _delegate_didInstallViewController:1; - unsigned int _delegate_willCloseViewController:1; - unsigned int _delegate_willDisplayInRect:1; - unsigned int _reserved:26; - } _DVTReplacementViewFlags; - BOOL _isGrouped; - NSMapTable *_subviewFrameChangeTokens; - void *_keepSelfAliveUntilCancellationRef; -} - -+ (void)initialize; -@property BOOL isGrouped; // @synthesize isGrouped=_isGrouped; -@property(nonatomic) Class controllerClass; // @synthesize controllerClass=_controllerClass; -@property(nonatomic) int verticalContentViewResizingMode; // @synthesize verticalContentViewResizingMode=_verticalContentViewResizingMode; -@property(nonatomic) int horizontalContentViewResizingMode; // @synthesize horizontalContentViewResizingMode=_horizontalContentViewResizingMode; -- (void)discardEditing; -- (BOOL)commitEditingForAction:(int)arg1 errors:(id)arg2; -- (void)updateBoundControllerExtensionIdentifier; -- (void)updateBoundControllerClass; -@property(copy) NSString *controllerExtensionIdentifier; -- (void)_clearCurrentController; -- (void)_tearDownBinding:(id)arg1; -- (void)_forwardBinding:(id)arg1 toObject:(id)arg2 withKeyPath:(id)arg3 options:(id)arg4; -- (void)_tearDownBindings; -- (void)_forwardBindings; -- (void)layoutBottomUp; -- (void)layoutTopDown; -@property(retain) DVTViewController *installedViewController; -- (void)_tearDownViewController; -- (void)_setupViewController; -- (void)_configureExtension; -- (id)infoForBinding:(id)arg1; -- (void)unbind:(id)arg1; -- (void)bind:(id)arg1 toObject:(id)arg2 withKeyPath:(id)arg3 options:(id)arg4; -- (id)_forwardedBindingInfo; -- (void)_clearInfoForBinding:(id)arg1; -- (void)_recordInfoForBinding:(id)arg1 toObject:(id)arg2 keyPath:(id)arg3 options:(id)arg4; -- (void)primitiveInvalidate; -- (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)arg1 visRect:(struct CGRect)arg2; -- (id)exposedBindings; -- (void)_invalidateLayoutBecauseOfSubviewFrameChange:(id)arg1; -- (void)willRemoveSubview:(id)arg1; -- (void)didAddSubview:(id)arg1; -- (id)initWithFrame:(struct CGRect)arg1; -- (void)awakeFromNib; -- (void)encodeWithCoder:(id)arg1; -- (id)initWithCoder:(id)arg1; -- (void)_commonInit; -//@property(retain, nonatomic) id delegate; -- (id)accessibilityAttributeValue:(id)arg1; -- (BOOL)accessibilityIsIgnored; - -// Remaining properties -@property(nonatomic, retain) DVTStackBacktrace *creationBacktrace; -@property(readonly) DVTStackBacktrace *invalidationBacktrace; -@property(readonly, nonatomic, getter=isValid) BOOL valid; - -@end - -@class DVTDelayedInvocation, DVTExtension, DVTReplacementView, DVTStateRepository, DVTStateToken, IDEViewController, NSString; - -@interface IDEPreferencesController : NSWindowController -{ - DVTReplacementView *_paneReplacementView; - DVTExtension *_currentExtension; - DVTStateRepository *_stateRepository; - DVTDelayedInvocation *_stateSavingInvocation; - DVTStateToken *_stateToken; -} - -+ (void)configureStateSavingObjectPersistenceByName:(id)arg1; -+ (void)restoreWindowWithIdentifier:(id)arg1 state:(id)arg2 completionHandler:(id)arg3; -+ (id)defaultPreferencesController; -@property(readonly) DVTDelayedInvocation *stateSavingInvocation; // @synthesize stateSavingInvocation=_stateSavingInvocation; -@property(retain) DVTStateToken *stateToken; // @synthesize stateToken=_stateToken; -@property(readonly) DVTStateRepository *stateRepository; // @synthesize stateRepository=_stateRepository; -@property(retain) DVTExtension *currentExtension; // @synthesize currentExtension=_currentExtension; -@property(retain) DVTReplacementView *paneReplacementView; // @synthesize paneReplacementView=_paneReplacementView; -- (BOOL)_loadStateData:(id *)arg1; -- (BOOL)_saveStateData:(id *)arg1; -- (id)_stateRepositoryFilePath; -- (void)commitStateToDictionary:(id)arg1; -- (void)revertStateWithDictionary:(id)arg1; -- (void)replacementView:(id)arg1 willCloseViewController:(id)arg2; -- (void)replacementView:(id)arg1 didInstallViewController:(id)arg2; -- (void)replacementView:(id)arg1 willInstallViewController:(id)arg2; -- (void)stateRepositoryDidChange:(id)arg1; -- (void)selectPreviousTab:(id)arg1; -- (void)selectNextTab:(id)arg1; -- (void)_selectToolbarItem:(id)arg1; -- (void)showPreferencesPanel:(id)arg1; -- (id)toolbarSelectableItemIdentifiers:(id)arg1; -- (id)toolbarDefaultItemIdentifiers:(id)arg1; -- (id)toolbarAllowedItemIdentifiers:(id)arg1; -- (id)toolbar:(id)arg1 itemForItemIdentifier:(id)arg2 willBeInsertedIntoToolbar:(BOOL)arg3; -- (void)windowWillClose:(id)arg1; -- (void)selectPreferencePaneWithIdentifier:(id)arg1; -@property(readonly) IDEViewController *currentPreferencePaneViewController; -@property(readonly) NSString *downloadsPrefPaneIdentifier; -- (void)windowDidLoad; -- (id)initWithWindow:(id)arg1; -- (void)_cachePreferencePaneExtensions; - -@end - -@interface DVTPlugInManager : NSObject -{ - // DVTDispatchLock *_plugInManagerLock; - NSFileManager *_fileManager; - NSString *_hostAppName; - NSString *_hostAppContainingPath; - NSMutableArray *_searchPaths; - NSArray *_extraSearchPaths; - NSMutableSet *_pathExtensions; - NSMutableSet *_exposedCapabilities; - NSMutableSet *_defaultPlugInCapabilities; - NSMutableSet *_requiredPlugInIdentifiers; - NSString *_plugInCachePath; - NSDictionary *_plugInCache; - BOOL _shouldClearPlugInCaches; - id _plugInLocator; - NSMutableDictionary *_plugInsByIdentifier; - NSMutableDictionary *_extensionPointsByIdentifier; - NSMutableDictionary *_extensionsByIdentifier; - NSMutableDictionary *_invalidExtensionsByIdentifier; - NSMutableSet *_warnedExtensionPointFailures; - NSMutableSet *_nonApplePlugInSanitizedStatuses; -} - -+ (void)_setDefaultPlugInManager:(id)arg1; -+ (id)defaultPlugInManager; -+ (void)initialize; -@property(retain) id plugInLocator; // @synthesize plugInLocator=_plugInLocator; -@property BOOL shouldClearPlugInCaches; // @synthesize shouldClearPlugInCaches=_shouldClearPlugInCaches; -- (id)_invalidExtensionWithIdentifier:(id)arg1; -- (id)_plugInCachePath; -- (id)_applicationCachesPath; -- (id)_toolsVersionName; -- (void)_createPlugInObjectsFromCache; -- (BOOL)_savePlugInCacheWithScanRecords:(id)arg1 error:(id *)arg2; -- (BOOL)_removePlugInCacheAndReturnError:(id *)arg1; -- (BOOL)_removePlugInCacheAtPath:(id)arg1 error:(id *)arg2; -- (id)_plugInCacheSaveFailedErrorWithUnderlyingError:(id)arg1; -- (BOOL)_loadPlugInCache:(id *)arg1; -- (BOOL)_cacheCoversPlugInsWithScanRecords:(id)arg1; -- (id)_modificationDateOfFileAtPath:(id)arg1; -@property(readonly) BOOL usePlugInCache; -- (void)_preLoadPlugIns; -- (BOOL)_checkPresenceOfRequiredPlugIns:(id)arg1 error:(id *)arg2; -- (BOOL)_checkMarketingVersionOfApplePlugIns:(id)arg1 error:(id *)arg2; -- (BOOL)shouldPerformConsistencyCheck; -- (void)_registerPlugInsFromScanRecords:(id)arg1; -- (void)_pruneUnusablePlugInsAndScanRecords:(id)arg1; -- (void)_recordSanitizedPluginStatus:(id)arg1 errorMessage:(id)arg2; -- (void)_addSanitizedNonApplePlugInStatusForBundle:(id)arg1 reason:(id)arg2; -@property(readonly) NSSet *sanitizedNonApplePlugInStatuses; -- (void)_createPlugInObjectsFromScanRecords:(id)arg1; -- (void)_applyActivationRulesToScanRecords:(id)arg1; -- (id)_scanForPlugInsInDirectories:(id)arg1 skippingDuplicatesOfPlugIns:(id)arg2; -- (BOOL)_scanForPlugIns:(id *)arg1; -@property(readonly) NSUUID *plugInHostUUID; -@property BOOL hasScannedForPlugIns; // @dynamic hasScannedForPlugIns; -- (id)_scanRecordForBundle:(id)arg1 atPath:(id)arg2; -- (BOOL)_isInitialScan; -- (id)_defaultPathExtensions; -@property(readonly) NSArray *defaultSearchPaths; -- (id)_defaultApplicationSupportSubdirectory; -@property(readonly) NSArray *extraSearchPaths; -- (id)_extensionsForExtensionPoint:(id)arg1 matchingPredicate:(id)arg2; -- (id)sharedExtensionsForExtensionPoint:(id)arg1 matchingPredicate:(id)arg2; -- (id)sharedExtensionWithIdentifier:(id)arg1; -- (id)extensionWithIdentifier:(id)arg1; -- (id)extensionPointWithIdentifier:(id)arg1; -- (id)plugInWithIdentifier:(id)arg1; -- (BOOL)scanForPlugIns:(id *)arg1; -- (id)init; -- (id)_hostAppName; -- (id)_hostAppContainingPath; - -// Remaining properties -@property(copy) NSSet *defaultPlugInCapabilities; // @dynamic defaultPlugInCapabilities; -@property(copy) NSSet *exposedCapabilities; // @dynamic exposedCapabilities; -@property(readonly) NSMutableSet *mutableDefaultPlugInCapabilities; // @dynamic mutableDefaultPlugInCapabilities; -@property(readonly) NSMutableSet *mutableExposedCapabilities; // @dynamic mutableExposedCapabilities; -@property(readonly) NSMutableSet *mutablePathExtensions; // @dynamic mutablePathExtensions; -@property(readonly) NSMutableSet *mutableRequiredPlugInIdentifiers; // @dynamic mutableRequiredPlugInIdentifiers; -@property(readonly) NSMutableArray *mutableSearchPaths; // @dynamic mutableSearchPaths; -@property(copy) NSSet *pathExtensions; // @dynamic pathExtensions; -@property(copy) NSSet *requiredPlugInIdentifiers; // @dynamic requiredPlugInIdentifiers; -@property(copy) NSArray *searchPaths; // @dynamic searchPaths; - -@end - -@class DVTDispatchLock, DVTExtensionPoint, DVTPlugIn, DVTPlugInManager, NSBundle, NSDictionary, NSMutableDictionary, NSString, NSXMLElement; - -@interface DVTExtension : NSObject -{ - -} - -+ (void)initialize; -@property(readonly) DVTExtension *basedOnExtension; // @synthesize basedOnExtension=_basedOnExtension; -@property(readonly) DVTExtensionPoint *extensionPoint; // @synthesize extensionPoint=_extensionPoint; -@property(readonly) DVTPlugIn *plugIn; // @synthesize plugIn=_plugIn; -@property(readonly) NSDictionary *extensionData; // @synthesize extensionData=_extensionData; -@property(readonly) DVTPlugInManager *plugInManager; // @synthesize plugInManager=_plugInManager; -@property(readonly) NSString *name; // @synthesize name=_name; -@property(readonly) NSString *version; // @synthesize version=_version; -@property(readonly) NSString *identifier; // @synthesize identifier=_identifier; -- (id)_localizedStringForString:(id)arg1; -- (BOOL)_fireExtensionFault:(id *)arg1; -- (void)_adjustClassReferencesInParameterData:(id)arg1 usingSchema:(id)arg2; -- (void)_adjustElementClassAttributes:(id)arg1 forKey:(id)arg2 inParameterData:(id)arg3; -- (void)_adjustClassAttribute:(id)arg1 forKey:(id)arg2 inParameterData:(id)arg3; -- (BOOL)_adjustElement:(id)arg1 forKey:(id)arg2 inParameterData:(id)arg3; -- (BOOL)_adjustAttribute:(id)arg1 forKey:(id)arg2 inParameterData:(id)arg3; -- (BOOL)_adjustParameterData:(id)arg1 usingSchema:(id)arg2; -- (BOOL)hasValueForKey:(id)arg1; -- (BOOL)_hasValueForKey:(id)arg1 inParameterData:(id)arg2 usingSchema:(id)arg3; -- (id)valueForKey:(id)arg1 error:(id *)arg2; -- (id)valueForKey:(id)arg1; -- (id)_valueForKey:(id)arg1 inParameterData:(id)arg2 usingSchema:(id)arg3 error:(id *)arg4; -@property(readonly) NSXMLElement *extensionElement; -@property(readonly, getter=isValid) BOOL valid; -@property(readonly) NSBundle *bundle; -- (id)description; -- (void)encodeIntoPropertyList:(id)arg1; -- (void)awakeWithPropertyList:(id)arg1; -- (id)initWithPropertyList:(id)arg1 owner:(id)arg2; -- (id)initWithExtensionData:(id)arg1 plugIn:(id)arg2; - -@end - -@interface IDEEditor : IDEViewController -- (NSArray *)currentSelectedDocumentLocations; -- (DVTSourceExpression *)selectedExpression; -@end - -@interface DVTSourceLandmarkItem : NSObject -- (NSString *)name; -@end - -@interface IDEDocSymbolUtilities : NSObject -- (NSDictionary *)queryInfoFromIndexSymbol:(IDEIndexSymbol *)symbol; -- (id)typeForSymbol:(IDEIndexSymbol *)symbol; -- (void)queryInfoFromIndexSymbol:(IDEIndexSymbol *)symbol handlerBlock:(void(^)(id foo))block; -@end - -@interface IDEQuickHelpQueries : NSObject -@end - -extern NSString *IDEEditorDocumentDidChangeNotification; - -@interface IDESourceCodeDocument -- (id)knownFileReferences; -@end - -@interface Xcode3FileReference -- (id)resolvedFilePath; -@end - -@interface DVTSourceNodeTypes : NSObject -{ -} - -+ (BOOL)nodeType:(short)arg1 conformsToNodeTypeNamed:(id)arg2; -+ (long long)nodeTypesCount; -+ (id)nodeTypeNameForId:(short)arg1; -+ (short)registerNodeTypeNamed:(id)arg1; -+ (void)initialize; - -@end - -@interface DVTSourceModelItem : NSObject -{ - int _rc; - struct _NSRange _relativeLocation; - long long _langId; - long long _token; - DVTSourceModelItem *_parent; - NSMutableArray *_children; - unsigned int _nodeType:15; - unsigned int _isOpaque:1; - unsigned int _dirty:1; - unsigned int _isBlock:1; - unsigned int _ignoreToken:1; - unsigned int _inheritsNodeType:1; - unsigned int _isIdentifier:1; - unsigned int _needsAdjustNodeType:1; - unsigned int _isSimpleToken:1; - unsigned int _isVolatile:1; - unsigned int _needToDirtyRightEdges:1; -} - -+ (id)sourceModelItemWithRange:(struct _NSRange)arg1 language:(long long)arg2 token:(long long)arg3 nodeType:(short)arg4; -@property struct _NSRange relativeLocation; // @synthesize relativeLocation=_relativeLocation; -@property(retain, nonatomic) NSMutableArray *children; // @synthesize children=_children; -@property(nonatomic) DVTSourceModelItem *parent; // @synthesize parent=_parent; -@property long long token; // @synthesize token=_token; -@property long long langId; // @synthesize langId=_langId; -- (void)enumerateIdentifierItemsInRelativeRange:(struct _NSRange)arg1 usingBlock:(id)arg2; -- (void)clearAdjustedNodeTypes; -- (long long)compare:(id)arg1; -- (id)followingItem; -- (id)precedingItem; -- (id)_lastLeafItem; -- (id)_firstLeafItem; -- (id)nextItem; -- (id)previousItem; -- (BOOL)isAncestorOf:(id)arg1; -- (id)childAdjoiningLocation:(unsigned long long)arg1; -- (id)childEnclosingLocation:(unsigned long long)arg1; -- (id)_childEnclosingLocation:(unsigned long long)arg1; -- (unsigned long long)indexOfChildAtLocation:(unsigned long long)arg1; -- (unsigned long long)indexOfChildAfterLocation:(unsigned long long)arg1; -- (unsigned long long)indexOfChildBeforeLocation:(unsigned long long)arg1; -- (unsigned long long)numberOfChildren; -- (void)addChildrenFromArray:(id)arg1 inRange:(struct _NSRange)arg2; -- (void)addChildren:(id)arg1; -- (void)addChild:(id)arg1; -- (void)assignAllParents:(id)arg1; -- (void)assignParents:(id)arg1; -- (BOOL)isVolatile; -- (void)setVolatile:(BOOL)arg1; -@property BOOL needsAdjustNodeType; -- (BOOL)needToDirtyRightEdges; -- (void)setNeedToDirtyRightEdges:(BOOL)arg1; -- (BOOL)isSimpleToken; -- (void)setIsSimpleToken:(BOOL)arg1; -- (BOOL)inheritsNodeType; -- (void)setInheritsNodeType:(BOOL)arg1; -- (BOOL)ignoreToken; -- (void)setIgnoreToken:(BOOL)arg1; -- (BOOL)dirty; -- (void)setDirty:(BOOL)arg1; -- (BOOL)isIdentifier; -- (short)rawNodeType; -- (BOOL)isOpaque; -- (void)setIsOpaque:(BOOL)arg1; -- (short)nodeType; -- (void)setNodeType:(short)arg1; -- (struct _NSRange)innerRange; -- (void)offsetBy:(long long)arg1; -- (void)setRange:(struct _NSRange)arg1; -- (struct _NSRange)range; -- (id)enclosingBlock; -- (long long)blockDepth; -- (void)setIsBlock:(BOOL)arg1; -- (BOOL)isBlock; -- (void)dirtyRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; -- (void)dirtyRelativeRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; -- (void)validate; -- (id)dumpContext; -- (id)contextArray; -- (id)simpleDescription; -- (id)diffableDescription; -- (id)description; -- (id)innerDescription:(id)arg1 showSelf:(BOOL)arg2; -- (id)initWithRange:(struct _NSRange)arg1 language:(long long)arg2 token:(long long)arg3 nodeType:(short)arg4; -- (BOOL)_isDeallocating; -- (BOOL)_tryRetain; -- (unsigned long long)retainCount; -- (oneway void)release; -- (id)retain; - -@end - -#pragma mark - - -@interface DVTSourceModel : NSObject -{ - struct _NSRange _dirtyRange; - long long _batchDelta; - DVTSourceModelItem *_sourceItems; - BOOL _isDoingBatchEdit; -} - -+ (id)editorResponsivenessPerformanceLogAspect; -+ (void)initialize; -@property BOOL isDoingBatchEdit; // @synthesize isDoingBatchEdit=_isDoingBatchEdit; -@property long long batchDelta; // @synthesize batchDelta=_batchDelta; -@property struct _NSRange dirtyRange; // @synthesize dirtyRange=_dirtyRange; -@property(retain) DVTSourceModelItem *sourceItems; // @synthesize sourceItems=_sourceItems; -- (id)objCMethodNameForItem:(id)arg1 nameRanges:(id *)arg2; -- (BOOL)isItemDictionaryLiteral:(id)arg1; -- (BOOL)isItemObjectLiteral:(id)arg1; -- (BOOL)isItemForStatement:(id)arg1; -- (BOOL)isItemSemanticBlock:(id)arg1; -- (BOOL)isItemBracketExpression:(id)arg1; -- (BOOL)isItemAngleExpression:(id)arg1; -- (BOOL)isItemParenExpression:(id)arg1; -- (BOOL)isPostfixExpressionAtLocation:(unsigned long long)arg1; -- (BOOL)isInTokenizableCodeAtLocation:(unsigned long long)arg1; -- (BOOL)isInPlainCodeAtLocation:(unsigned long long)arg1; -- (BOOL)isInKeywordAtLocation:(unsigned long long)arg1; -- (BOOL)isIncompletionPlaceholderAtLocation:(unsigned long long)arg1; -- (BOOL)isInNumberConstantAtLocation:(unsigned long long)arg1; -- (BOOL)isInCharacterConstantAtLocation:(unsigned long long)arg1; -- (BOOL)isInIdentifierAtLocation:(unsigned long long)arg1; -- (BOOL)isInStringConstantAtLocation:(unsigned long long)arg1; -- (BOOL)isInIncludeStatementAtLocation:(unsigned long long)arg1; -- (BOOL)isInPreprocessorStatementAtLocation:(unsigned long long)arg1; -- (BOOL)isInDocCommentAtLocation:(unsigned long long)arg1; -- (BOOL)isInCommentAtLocation:(unsigned long long)arg1; -- (id)completionPlaceholderItemAtLocation:(unsigned long long)arg1; -- (id)identOrKeywordItemAtLocation:(unsigned long long)arg1; -- (id)objCDeclaratorItemAtLocation:(unsigned long long)arg1; -- (id)numberConstantAtLocation:(unsigned long long)arg1; -- (id)characterConstantAtLocation:(unsigned long long)arg1; -- (id)stringConstantAtLocation:(unsigned long long)arg1; -- (id)moduleImportStatementAtLocation:(unsigned long long)arg1; -- (id)includeStatementAtLocation:(unsigned long long)arg1; -- (id)preprocessorStatementAtLocation:(unsigned long long)arg1; -- (id)docCommentAtLocation:(unsigned long long)arg1; -- (id)commentAtLocation:(unsigned long long)arg1; -- (id)placeholderItemsFromItem:(id)arg1; -- (id)identifierItemsFromItem:(id)arg1; -- (id)commentBlockItems; -- (id)functionsAndMethodItems; -- (id)classItems; -- (void)addBlockItemsInTypeList:(long long *)arg1 fromItem:(id)arg2 toArray:(id)arg3; -- (void)addIdentifierItemsFromItem:(id)arg1 toArray:(id)arg2; -- (void)addItemsInTypeList:(long long *)arg1 fromItem:(id)arg2 toArray:(id)arg3; -- (id)functionOrMethodDefinitionAtLocation:(unsigned long long)arg1; -- (id)functionOrMethodAtLocation:(unsigned long long)arg1; -- (id)interfaceDeclarationAtLocation:(unsigned long long)arg1; -- (id)typeDeclarationAtLocation:(unsigned long long)arg1; -- (id)classAtLocation:(unsigned long long)arg1; -- (id)itemNameAtLocation:(unsigned long long)arg1 inTypeList:(long long *)arg2 nameRanges:(id *)arg3 scopeRange:(struct _NSRange *)arg4; -- (id)nameOfItem:(id)arg1 nameRanges:(id *)arg2 scopeRange:(struct _NSRange *)arg3; -- (void)enumerateIdentifierItemsInRange:(struct _NSRange)arg1 usingBlock:(id)arg2; -- (id)itemAtLocation:(unsigned long long)arg1 ofType:(id)arg2; -- (id)itemAtLocation:(unsigned long long)arg1 inTypeList:(long long *)arg2; -- (long long *)typeListForSpecNames:(id)arg1; -- (id)builtUpNameForItem:(id)arg1 nameRanges:(id *)arg2; -- (id)_builtUpNameForItem:(id)arg1 mutableNameRanges:(id)arg2; -- (id)_builtUpNameForSubTree:(id)arg1 mutableNameRanges:(id)arg2; -- (id)objectLiteralItemAtLocation:(unsigned long long)arg1; -- (id)parenItemAtLocation:(unsigned long long)arg1; -- (id)parenLikeItemAtLocation:(unsigned long long)arg1; -- (id)foldableBlockItemForLocation:(unsigned long long)arg1; -- (id)foldableBlockItemForLineAtLocation:(unsigned long long)arg1; -- (id)blockItemAtLocation:(unsigned long long)arg1; -- (long long)indentForItem:(id)arg1; -- (id)adjoiningItemAtLocation:(unsigned long long)arg1; -- (id)enclosingItemAtLocation:(unsigned long long)arg1; -- (id)_topLevelSourceItem; -- (void)parse; -- (void)doingBatchEdit:(BOOL)arg1; -- (void)dirtyRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; -- (id)initWithSourceBufferProvider:(id)arg1; - -@end - -#pragma mark - - -@interface DVTSourceTextView : NSTextView - --(void)_commonInitDVTSourceTextView; - -@end - -#pragma mark - - -@protocol DVTSourceLanguageSourceModelService -- (struct _NSRange)rangeForBlockContainingRange:(struct _NSRange)arg1; -- (NSString *)stringForItem:(DVTSourceModelItem *)arg1; -- (DVTSourceModelItem *)commonSourceModelItemAtRange:(struct _NSRange)arg1; -- (DVTSourceModelItem *)sourceModelItemAtCharacterIndex:(unsigned long long)arg1; -- (DVTSourceModelItem *)sourceModelItemAtCharacterIndex:(unsigned long long)arg1 affinity:(unsigned long long)arg2; -- (DVTSourceModel *)sourceModelWithoutParsing; -- (DVTSourceModel *)sourceModel; -@end - -@interface DVTTextStorage : NSTextStorage - -@property DVTSourceModel* sourceModel; -@property(readonly) id sourceModelService; // DVTSourceTextStorage - -@property(readonly) unsigned long long currentChangeIndex; - --(NSColor*)colorAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; --(void)fixSyntaxColoringInRange:(NSRange)range; --(short)nodeTypeAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; -// FIXME: Workaround for NSObject+YOLO buggyness --(NSColor*)yl_colorAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; -- (id)sourceModelItemAtCharacterIndex:(unsigned long long)arg1; //DVTSourceTextStorage in Xcode 5, DVTSourceLanguageSourceModelService protocol in Xcode 5.1 - -@end - -@class DVTCustomDataSpecifier, DVTPointerArray, DVTStackBacktrace, NSColor, NSFont, NSImage, NSString, NSURL; - -@interface DVTFontAndColorTheme : NSObject -{ - NSString *_name; - NSImage *_image; - NSURL *_dataURL; - DVTCustomDataSpecifier *_customDataSpecifier; - NSColor *_sourceTextBackgroundColor; - NSColor *_sourceTextSidebarBackgroundColor; - NSColor *_sourceTextSidebarEdgeColor; - NSColor *_sourceTextSidebarNumbersColor; - NSColor *_sourceTextFoldbarBackgroundColor; - NSColor *_sourceTextSelectionColor; - NSColor *_sourceTextSecondarySelectionColor; - NSColor *_sourceTextInsertionPointColor; - NSColor *_sourceTextInvisiblesColor; - NSColor *_sourceTextBlockDimBackgroundColor; - NSColor *_sourceTextTokenizedBorderColor; - NSColor *_sourceTextTokenizedBackgroundColor; - NSColor *_sourceTextTokenizedBorderSelectedColor; - NSColor *_sourceTextTokenizedBackgroundSelectedColor; - NSColor *_consoleTextBackgroundColor; - NSColor *_consoleTextSelectionColor; - NSColor *_consoleTextSecondarySelectionColor; - NSColor *_consoleTextInsertionPointColor; - NSColor *_consoleDebuggerPromptTextColor; - NSColor *_consoleDebuggerInputTextColor; - NSColor *_consoleDebuggerOutputTextColor; - NSColor *_consoleExecutableInputTextColor; - NSColor *_consoleExecutableOutputTextColor; - NSFont *_consoleDebuggerPromptTextFont; - NSFont *_consoleDebuggerInputTextFont; - NSFont *_consoleDebuggerOutputTextFont; - NSFont *_consoleExecutableInputTextFont; - NSFont *_consoleExecutableOutputTextFont; - NSColor *_debuggerInstructionPointerColor; - NSColor *_sourcePlainTextColor; - NSFont *_sourcePlainTextFont; - DVTPointerArray *_syntaxColorsByNodeType; - DVTPointerArray *_syntaxFontsByNodeType; - NSColor *_sourceTextCompletionPreviewColor; - BOOL _builtIn; - BOOL _loadedData; - BOOL _contentNeedsSaving; - BOOL _hasMultipleSourceTextFonts; -} - -+ (id)_defaultSourceCodeFont; -+ (id)keyPathsForValuesAffectingConsoleTextSecondarySelectionColor; -+ (id)keyPathsForValuesAffectingSourceTextSecondarySelectionColor; -+ (id)titleForNewPreferenceSetFromTemplate; -+ (id)preferenceSetsListHeader; -+ (id)preferenceSetsFileExtension; -+ (id)defaultKeyForExcludedBuiltInPreferenceSets; -+ (id)defaultKeyForCurrentPreferenceSet; -+ (id)builtInPreferenceSetsDirectoryURL; -+ (id)systemPreferenceSet; -+ (id)preferenceSetGroupingName; -+ (id)_nodeTypesIncludedInPreferences; -+ (id)_stringRepresentationOfFont:(id)arg1; -+ (id)_fontWithName:(id)arg1 size:(double)arg2; -+ (id)currentTheme; -+ (id)preferenceSetsManager; -+ (void)initialize; -@property(readonly) BOOL loadedData; // @synthesize loadedData=_loadedData; -@property(readonly) DVTPointerArray *syntaxFontsByNodeType; // @synthesize syntaxFontsByNodeType=_syntaxFontsByNodeType; -@property(readonly) DVTPointerArray *syntaxColorsByNodeType; // @synthesize syntaxColorsByNodeType=_syntaxColorsByNodeType; -@property(nonatomic) BOOL hasMultipleSourceTextFonts; // @synthesize hasMultipleSourceTextFonts=_hasMultipleSourceTextFonts; -@property BOOL contentNeedsSaving; // @synthesize contentNeedsSaving=_contentNeedsSaving; -@property(retain) DVTCustomDataSpecifier *customDataSpecifier; // @synthesize customDataSpecifier=_customDataSpecifier; -@property(readonly, getter=isBuiltIn) BOOL builtIn; // @synthesize builtIn=_builtIn; -@property(retain) NSImage *image; // @synthesize image=_image; -@property(copy) NSString *name; // @synthesize name=_name; -- (void)setFont:(id)arg1 forNodeTypes:(id)arg2; -- (void)setColor:(id)arg1 forNodeTypes:(id)arg2; -- (void)_setColorOrFont:(id)arg1 forNodeTypes:(id)arg2; -- (id)fontForNodeType:(short)arg1; -- (id)colorForNodeType:(short)arg1; -@property(readonly) NSFont *sourcePlainTextFont; -@property(readonly) NSColor *sourcePlainTextColor; -- (void)setDebuggerInstructionPointerColor:(id)arg1; -- (void)setConsoleExecutableOutputTextFont:(id)arg1; -- (void)setConsoleExecutableInputTextFont:(id)arg1; -- (void)setConsoleDebuggerOutputTextFont:(id)arg1; -- (void)setConsoleDebuggerInputTextFont:(id)arg1; -- (void)setConsoleDebuggerPromptTextFont:(id)arg1; -- (void)setConsoleExecutableOutputTextColor:(id)arg1; -- (void)setConsoleExecutableInputTextColor:(id)arg1; -- (void)setConsoleDebuggerOutputTextColor:(id)arg1; -- (void)setConsoleDebuggerInputTextColor:(id)arg1; -- (void)setConsoleDebuggerPromptTextColor:(id)arg1; -- (void)primitiveSetConsoleDebuggerPromptTextColor:(id)arg1; -- (void)setConsoleTextInsertionPointColor:(id)arg1; -- (void)setConsoleTextSelectionColor:(id)arg1; -- (void)setConsoleTextBackgroundColor:(id)arg1; -- (void)setSourceTextInvisiblesColor:(id)arg1; -- (void)setSourceTextInsertionPointColor:(id)arg1; -- (void)setSourceTextSelectionColor:(id)arg1; -- (void)setSourceTextBackgroundColor:(id)arg1; -- (void)_setColorOrFont:(id)arg1 forKey:(id)arg2 colorOrFontivar:(id *)arg3; -@property(readonly) NSColor *debuggerInstructionPointerColor; -@property(readonly) NSFont *consoleExecutableOutputTextFont; -@property(readonly) NSFont *consoleExecutableInputTextFont; -@property(readonly) NSFont *consoleDebuggerOutputTextFont; -@property(readonly) NSFont *consoleDebuggerInputTextFont; -@property(readonly) NSFont *consoleDebuggerPromptTextFont; -@property(readonly) NSColor *consoleExecutableOutputTextColor; -@property(readonly) NSColor *consoleExecutableInputTextColor; -@property(readonly) NSColor *consoleDebuggerOutputTextColor; -@property(readonly) NSColor *consoleDebuggerInputTextColor; -@property(readonly) NSColor *consoleDebuggerPromptTextColor; -@property(readonly) NSColor *consoleTextInsertionPointColor; -@property(readonly) NSColor *consoleTextSecondarySelectionColor; -@property(readonly) NSColor *consoleTextSelectionColor; -@property(readonly) NSColor *consoleTextBackgroundColor; -@property(readonly) NSColor *sourceTextTokenizedBackgroundSelectedColor; -@property(readonly) NSColor *sourceTextTokenizedBorderSelectedColor; -@property(readonly) NSColor *sourceTextTokenizedBackgroundColor; -@property(readonly) NSColor *sourceTextTokenizedBorderColor; -@property(readonly) NSColor *sourceTextLinkColor; -@property(readonly) NSColor *sourceTextCompletionPreviewColor; -@property(readonly) NSColor *sourceTextBlockDimBackgroundColor; -@property(readonly) NSColor *sourceTextInvisiblesColor; -@property(readonly) NSColor *sourceTextInsertionPointColor; -@property(readonly) NSColor *sourceTextSecondarySelectionColor; -@property(readonly) NSColor *sourceTextSelectionColor; -@property(readonly) NSColor *sourceTextFoldbarBackgroundColor; -@property(readonly) NSColor *sourceTextSidebarNumbersColor; -@property(readonly) NSColor *sourceTextSidebarEdgeColor; -@property(readonly) NSColor *sourceTextSidebarBackgroundColor; -@property(readonly) NSColor *sourceTextBackgroundColor; -- (id)description; -@property(readonly) NSString *localizedName; -- (void)_updateHasMultipleSourceTextFonts; -- (void)_updateDerivedColors; -- (BOOL)_loadFontsAndColors; -- (id)dataRepresentationWithError:(id *)arg1; -- (void)primitiveInvalidate; -- (id)initWithCustomDataSpecifier:(id)arg1 basePreferenceSet:(id)arg2; -- (id)initWithName:(id)arg1 dataURL:(id)arg2; -- (id)_initWithName:(id)arg1 syntaxColorsByNodeType:(id)arg2 syntaxFontsByNodeType:(id)arg3; -- (void)_themeCommonInit; -- (id)init; - -// Remaining properties -@property(retain) DVTStackBacktrace *creationBacktrace; -@property(readonly) DVTStackBacktrace *invalidationBacktrace; -@property(readonly, nonatomic, getter=isValid) BOOL valid; - -@end - -@interface DVTControllerContentView : DVTLayoutView_ML -{ - struct CGSize _minContentFrameSize; - struct CGSize _maxContentFrameSize; - DVTViewController *_viewController; - NSWindow *_kvoWindow; - int _horizontalAlignmentWhenClipping; - int _horizontalAlignmentWhenPadding; - int _verticalAlignmentWhenClipping; - int _verticalAlignmentWhenPadding; - int _verticalContentViewResizingMode; - int _horizontalContentViewResizingMode; - BOOL _isInstalled; - BOOL _isPadding; - BOOL _isReplacingSubview; - BOOL _disablePaddingWarning; - BOOL _isGrouped; - NSMutableArray *_frameChangeTokens; - NSArray *_currentContentViewConstraints; - BOOL _constraintsCameFromNib; -} - -+ (void)initialize; -@property BOOL isGrouped; // @synthesize isGrouped=_isGrouped; -@property BOOL disablePaddingWarning; // @synthesize disablePaddingWarning=_disablePaddingWarning; -@property(nonatomic) int verticalContentViewResizingMode; // @synthesize verticalContentViewResizingMode=_verticalContentViewResizingMode; -@property(nonatomic) int horizontalContentViewResizingMode; // @synthesize horizontalContentViewResizingMode=_horizontalContentViewResizingMode; -@property(nonatomic) int verticalAlignmentWhenClipping; // @synthesize verticalAlignmentWhenClipping=_verticalAlignmentWhenClipping; -@property(nonatomic) int horizontalAlignmentWhenClipping; // @synthesize horizontalAlignmentWhenClipping=_horizontalAlignmentWhenClipping; -@property(nonatomic) struct CGSize minimumContentViewFrameSize; // @synthesize minimumContentViewFrameSize=_minContentFrameSize; -@property(nonatomic) int verticalAlignmentWhenPadding; // @synthesize verticalAlignmentWhenPadding=_verticalAlignmentWhenPadding; -@property(nonatomic) int horizontalAlignmentWhenPadding; // @synthesize horizontalAlignmentWhenPadding=_horizontalAlignmentWhenPadding; -@property(nonatomic) struct CGSize maximumContentViewFrameSize; // @synthesize maximumContentViewFrameSize=_maxContentFrameSize; -- (BOOL)performKeyEquivalent:(id)arg1; -- (void)_invalidateLayoutBecauseOfSubviewFrameChange:(id)arg1; -- (void)willRemoveSubview:(id)arg1; -- (void)didAddSubview:(id)arg1; -- (void)windowWillClose:(id)arg1; -- (void)viewDidMoveToSuperview; -- (void)viewDidMoveToWindow; -- (void)viewWillMoveToSuperview:(id)arg1; -- (void)viewWillMoveToWindow:(id)arg1; -@property(readonly) BOOL isInstalled; -- (void)_viewDidInstall; -- (void)_viewWillUninstall; -@property(retain) IBOutlet NSView *contentView; -- (void)replaceSubview:(id)arg1 with:(id)arg2; -- (void)setSubviews:(id)arg1; -- (void)addSubview:(id)arg1; -- (void)layoutBottomUp; -- (void)layoutTopDown; -- (void)setTranslatesAutoresizingMaskIntoConstraints:(BOOL)arg1; -- (void)_syncContentViewTranslatesAutoresizingMaskIntoConstraintsValue; -- (void)updateConstraints; -- (void)setNextResponder:(id)arg1; -@property(retain, nonatomic) DVTViewController *viewController; -- (void)_checkKvoWindow; -@property(readonly) NSWindow *kvoWindow; -- (void)primitiveInvalidate; -- (id)initWithFrame:(struct CGRect)arg1; -- (void)awakeFromNib; -- (id)accessibilityAttributeValue:(id)arg1; -- (BOOL)accessibilityIsIgnored; - -// Remaining properties -@property(retain) DVTStackBacktrace *creationBacktrace; -@property(readonly) DVTStackBacktrace *invalidationBacktrace; -@property(readonly, nonatomic, getter=isValid) BOOL valid; - -@end - -@interface DVTBorderedView : DVTLayoutView_ML -{ - NSColor *_topBorderColor; - NSColor *_bottomBorderColor; - NSColor *_leftBorderColor; - NSColor *_rightBorderColor; - NSColor *_topInactiveBorderColor; - NSColor *_bottomInactiveBorderColor; - NSColor *_leftInactiveBorderColor; - NSColor *_rightInactiveBorderColor; - NSColor *_shadowColor; - NSColor *_backgroundColor; - NSColor *_inactiveBackgroundColor; - NSGradient *_backgroundGradient; - NSGradient *_inactiveBackgroundGradient; - NSView *_contentView; - int _verticalContentViewResizingMode; - int _horizontalContentViewResizingMode; - int _borderSides; - int _shadowSides; - // id _windowActivationObservation; - // int _highlightSides; - // id _backgroundPainter; -} - -//@property(retain) id backgroundPainter; // @synthesize backgroundPainter=_backgroundPainter; -@property(nonatomic) int highlightSides; // @synthesize highlightSides=_highlightSides; -@property(nonatomic) int verticalContentViewResizingMode; // @synthesize verticalContentViewResizingMode=_verticalContentViewResizingMode; -@property(copy, nonatomic) NSColor *topInactiveBorderColor; // @synthesize topInactiveBorderColor=_topInactiveBorderColor; -@property(copy, nonatomic) NSColor *topBorderColor; // @synthesize topBorderColor=_topBorderColor; -@property int shadowSides; // @synthesize shadowSides=_shadowSides; -@property(copy) NSColor *shadowColor; // @synthesize shadowColor=_shadowColor; -@property(copy, nonatomic) NSColor *rightInactiveBorderColor; // @synthesize rightInactiveBorderColor=_rightInactiveBorderColor; -@property(copy, nonatomic) NSColor *rightBorderColor; // @synthesize rightBorderColor=_rightBorderColor; -@property(copy, nonatomic) NSColor *leftInactiveBorderColor; // @synthesize leftInactiveBorderColor=_leftInactiveBorderColor; -@property(copy, nonatomic) NSColor *leftBorderColor; // @synthesize leftBorderColor=_leftBorderColor; -@property(copy, nonatomic) NSGradient *inactiveBackgroundGradient; // @synthesize inactiveBackgroundGradient=_inactiveBackgroundGradient; -@property(copy, nonatomic) NSColor *inactiveBackgroundColor; // @synthesize inactiveBackgroundColor=_inactiveBackgroundColor; -@property(nonatomic) int horizontalContentViewResizingMode; // @synthesize horizontalContentViewResizingMode=_horizontalContentViewResizingMode; -@property(nonatomic) NSView *contentView; // @synthesize contentView=_contentView; -@property(copy, nonatomic) NSColor *bottomInactiveBorderColor; // @synthesize bottomInactiveBorderColor=_bottomInactiveBorderColor; -@property(copy, nonatomic) NSColor *bottomBorderColor; // @synthesize bottomBorderColor=_bottomBorderColor; -@property(nonatomic) int borderSides; // @synthesize borderSides=_borderSides; -@property(copy, nonatomic) NSGradient *backgroundGradient; // @synthesize backgroundGradient=_backgroundGradient; -@property(copy, nonatomic) NSColor *backgroundColor; // @synthesize backgroundColor=_backgroundColor; -- (void)window:(id)arg1 didChangeActivationState:(long long)arg2; -- (void)viewWillMoveToWindow:(id)arg1; -- (void)drawRect:(struct CGRect)arg1; -- (void)drawBorderInRect:(struct CGRect)arg1; -- (void)drawHighlightInRect:(struct CGRect)arg1; -- (void)drawBackgroundInRect:(struct CGRect)arg1; -- (BOOL)_isInactive; -- (void)layoutBottomUp; -- (void)layoutTopDown; -- (void)_contentViewFrameDidChange:(id)arg1; -- (struct CGSize)frameSizeForContentSize:(struct CGSize)arg1; -- (struct CGSize)boundSizeForContentSize:(struct CGSize)arg1; -@property(readonly) struct CGRect contentRect; -- (struct CGRect)_contentRectExcludingShadow; -//- (CDStruct_bf6d4a14)_contentInset; -//- (CDStruct_bf6d4a14)_borderInset; -//- (CDStruct_bf6d4a14)_shadowInset; -- (BOOL)isShowingShadow; -- (void)setAllInactiveBordersToColor:(id)arg1; -- (void)setAllBordersToColor:(id)arg1; -- (void)setShadowSide:(int)arg1; -- (void)_setBorderSides:(int)arg1; -- (void)dealloc; -- (void)encodeWithCoder:(id)arg1; -- (id)initWithCoder:(id)arg1; -- (id)initWithFrame:(struct CGRect)arg1; - -@end - -@class DVTBorderedView, DVTObservingToken, DVTReplacementView, DVTTabChooserView, NSArray, NSArrayController, NSColor, NSFont, NSObjectController, NSTableView, NSView; - -@interface IDEFontAndColorPrefsPaneController : IDEViewController -{ - DVTReplacementView *preferenceSetReplacementView; - DVTBorderedView *_fontAndColorBorderView; - DVTTabChooserView *_tabChooserView; - NSTableView *_fontAndColorItemTable; - NSArrayController *_categoriesArrayController; - NSObjectController *_currentThemeObjectController; - DVTBorderedView *_generalColorView; - NSView *_sourceEditorGeneralView; - NSView *_consoleGeneralView; - NSArray *_fontAndColorItems; - DVTObservingToken *_selectedTabObserver; - DVTObservingToken *_backgroundColorObserver; - DVTObservingToken *_selectionIndexesObserver; -} - -+ (void)initialize; -@property(readonly) NSArrayController *categoriesArrayController; // @synthesize categoriesArrayController=_categoriesArrayController; -@property(retain) NSArray *fontAndColorItems; // @synthesize fontAndColorItems=_fontAndColorItems; -- (void)changeFont:(id)arg1; -- (void)chooseFont:(id)arg1; -- (double)tableView:(id)arg1 heightOfRow:(long long)arg2; -- (void)tableView:(id)arg1 willDisplayCell:(id)arg2 forTableColumn:(id)arg3 row:(long long)arg4; -- (id)_theme; -- (void)_sourceTextColorsChanged:(id)arg1; -- (void)_updateBindingsBasedOnSelectedTab; -- (void)_handleTabChanged; -- (void)_initTabChooserView; -- (void)viewWillUninstall; -- (void)viewDidInstall; -- (void)loadView; -- (void)_updateFontPickerAndColorWell; -@property(copy) NSFont *combinedSyntaxFont; -@property(copy) NSColor *combinedSyntaxColor; -- (void)primitiveInvalidate; - -@end - -@class DVTChoice, NSArray, NSMapTable, NSMutableArray, NSSearchField; - -@interface DVTTabChooserView : DVTBorderedView -{ - double *_currentChoiceXCoordinates; - NSSearchField *_searchField; - DVTChoice *_selectedChoice; - long long _pressedIndex; - long long _mouseDownIndex; - NSMutableArray *_choices; - NSMapTable *_accessibilityProxiesByChoice; - struct { - unsigned int hasSearchField:1; - unsigned int _reserved:7; - } _flags; - // id _delegate; - double _choicesOffset; -} - -+ (id)keyPathsForValuesAffectingSelectedChoice; -+ (void)initialize; -@property double choicesOffset; // @synthesize choicesOffset=_choicesOffset; -//@property __weak id delegate; // @synthesize delegate=_delegate; -@property(retain, nonatomic) NSSearchField *searchField; // @synthesize searchField=_searchField; -- (id)accessibilityHitTest:(struct CGPoint)arg1; -- (BOOL)accessibilityIsAttributeSettable:(id)arg1; -- (id)accessibilityAttributeValue:(id)arg1; -- (id)accessibilityAttributeNames; -- (BOOL)accessibilityIsIgnored; -- (id)accessibilityProxyForChoice:(id)arg1; -@property BOOL hasSearchField; -- (void)installSearchField; -- (struct CGRect)searchFieldFrame; -- (void)mouseUp:(id)arg1; -- (void)mouseDragged:(id)arg1; -- (void)mouseDown:(id)arg1; -- (BOOL)acceptsFirstMouse:(id)arg1; -- (id)choiceForEvent:(id)arg1 index:(long long *)arg2; -- (id)choiceForPoint:(struct CGPoint)arg1 index:(long long *)arg2; -- (void)drawRect:(struct CGRect)arg1; -- (void)drawChoiceAtIndex:(long long)arg1; -- (void)drawOneChoice; -- (id)attributedTitleForChoice:(id)arg1 forceActive:(BOOL)arg2; -- (void)updateGeometryForDrawing; -- (struct CGRect)rectForChoice:(id)arg1; -- (struct CGRect)rectForChoiceAtIndex:(long long)arg1; -@property(readonly) double minimumWidth; -- (struct CGRect)totalChoicesRect; -- (double)totalWidth; -- (double)widthForChoiceAtIndex:(long long)arg1; -- (double)widthForChoice:(id)arg1; -- (void)updateBoundSelectedObjects; -@property(retain) DVTChoice *selectedChoice; // @synthesize selectedChoice=_selectedChoice; -@property(readonly) NSMutableArray *mutableChoices; -- (void)updateBoundContent; -@property(copy) NSArray *choices; -- (id)choiceWithIdentifier:(id)arg1; -- (id)choiceAtIndex:(long long)arg1; -- (void)viewWillMoveToWindow:(id)arg1; -- (void)dealloc; -- (id)initWithCoder:(id)arg1; -- (id)initWithFrame:(struct CGRect)arg1; -- (void)commonInit; -- (id)dvtExtraBindings; - -@end - - -@interface DVTChoice : NSObject -{ - NSString *_title; - NSString *_toolTip; - NSImage *_image; - NSString *_identifier; - id _representedObject; - BOOL _enabled; -} - -@property(getter=isEnabled) BOOL enabled; // @synthesize enabled=_enabled; -@property(readonly) id representedObject; // @synthesize representedObject=_representedObject; -@property(copy) NSString *identifier; // @synthesize identifier=_identifier; -@property(readonly) NSImage *image; // @synthesize image=_image; -@property(readonly) NSString *toolTip; // @synthesize toolTip=_toolTip; -@property(readonly) NSString *title; // @synthesize title=_title; -- (id)description; -- (id)initWithTitle:(id)arg1 toolTip:(id)arg2 image:(id)arg3 representedObject:(id)arg4; - -@end - -@interface IDEFontAndColorFontTransformer : NSValueTransformer -{ -} - -+ (BOOL)allowsReverseTransformation; -+ (Class)transformedValueClass; -- (id)transformedValue:(id)arg1; - -@end - -// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -// -// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -// -// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -//// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -//// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -//// -// DVTInterfaces.h -// Polychromatic -// -// Created by Kolin Krewinkel on 3/30/14. -// Copyright 2014 Apple Inc. All rights reserved. -// -// Sourced from class-dump. Some borrowed from CodePilot for quick compilation. -// \ No newline at end of file From d62829b9caefb1df6fded5ea06a86883cb42281d Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 25 Jan 2015 14:12:52 +0000 Subject: [PATCH 26/96] Fixed content offset updates. --- SCXcodeMinimap/SCXcodeMinimapView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 51d78bb..5c118a6 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -150,8 +150,8 @@ - (void)updateOffset return; } - CGPoint offset = NSMakePoint(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification)); - [self.scrollView.contentView scrollToPoint:offset]; + CGPoint offset = NSMakePoint(0, MAX(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification))); + [self.scrollView.documentView scrollPoint:offset]; CGFloat textHeight = [self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer].size.height; ratio = (textHeight - self.selectionView.bounds.size.height) / editorContentHeight; From 0f92e2fc71dc339a6352cecacfb1e7b8e52f9cd4 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 25 Jan 2015 16:51:57 +0000 Subject: [PATCH 27/96] - added comment and preprocessor instructions highlighting - cleaned up theme related methods and selection view. --- SCXcodeMinimap/SCXcodeMinimapSelectionView.h | 1 - SCXcodeMinimap/SCXcodeMinimapSelectionView.m | 36 ------------ SCXcodeMinimap/SCXcodeMinimapView.m | 59 +++++++++++--------- 3 files changed, 33 insertions(+), 63 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapSelectionView.h b/SCXcodeMinimap/SCXcodeMinimapSelectionView.h index 116c777..bda14ef 100644 --- a/SCXcodeMinimap/SCXcodeMinimapSelectionView.h +++ b/SCXcodeMinimap/SCXcodeMinimapSelectionView.h @@ -11,6 +11,5 @@ @interface SCXcodeMinimapSelectionView : NSView @property (nonatomic, strong) NSColor *selectionColor; -@property (nonatomic, assign) BOOL shouldInverseColors; @end diff --git a/SCXcodeMinimap/SCXcodeMinimapSelectionView.m b/SCXcodeMinimap/SCXcodeMinimapSelectionView.m index 02ee548..41d4f70 100644 --- a/SCXcodeMinimap/SCXcodeMinimapSelectionView.m +++ b/SCXcodeMinimap/SCXcodeMinimapSelectionView.m @@ -18,32 +18,6 @@ - (void)drawRect:(NSRect)dirtyRect NSRectFill(dirtyRect); } -- (NSColor *)selectionColor -{ - if(_selectionColor == nil) { - - _selectionColor = [NSColor colorWithDeviceRed:0.0f green:0.0f blue:0.0f alpha:0.3f]; - - NSColor *backgroundColor = [[[DVTFontAndColorTheme currentTheme] sourceTextBackgroundColor] colorUsingColorSpace:[NSColorSpace deviceRGBColorSpace]]; - - if(self.shouldInverseColors) { - - _selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [backgroundColor redComponent]) - green:(1.0f - [backgroundColor greenComponent]) - blue:(1.0f - [backgroundColor blueComponent]) - alpha:0.3f]; - } else { - - _selectionColor = [NSColor colorWithCalibratedHue:0.0f - saturation:0.0f - brightness:(1.0f - [backgroundColor brightnessComponent]) - alpha:0.3f]; - } - } - - return _selectionColor; -} - - (void)setSelectionColor:(NSColor *)selectionColor { if([_selectionColor isEqual:selectionColor]) return; @@ -52,14 +26,4 @@ - (void)setSelectionColor:(NSColor *)selectionColor [self setNeedsDisplay:YES]; } -- (void)setShouldInverseColors:(BOOL)shouldInverseColors -{ - if(_shouldInverseColors == shouldInverseColors) { - return; - } - - _shouldInverseColors = shouldInverseColors; - _selectionColor = nil; -} - @end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 5c118a6..1fffb83 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -16,12 +16,13 @@ #import "DVTSourceNodeTypes.h" #import "DVTFontAndColorTheme.h" - const CGFloat kDefaultZoomLevel = 0.1f; -const CGFloat kDefaultShadowLevel = 0.1f; +const CGFloat kBackgroundColorShadowLevel = 0.1f; +const CGFloat kHighlightColorAlphaLevel = 0.3f; + +static NSString * const kXcodeSyntaxCommentNodeName = @"xcode.syntax.comment"; +static NSString * const kXcodeSyntaxPreprocessorNodeName = @"xcode.syntax.preprocessor"; -static NSString * const kXcodeSyntaxCommentColor = @"xcode.syntax.comment"; -static NSString * const kXcodeSyntaxPreprocessorColor = @"xcode.syntax.preprocessor"; static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; @interface SCXcodeMinimapView () @@ -114,8 +115,26 @@ - (void)setVisible:(BOOL)visible - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange { DVTTextStorage *storage = [self.editorTextView textStorage]; + + short currentNodeId = [storage nodeTypeAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; + NSColor *color = [storage colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; - return @{NSForegroundColorAttributeName : color}; + NSColor *backgroundColor = nil; + + if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]) { + NSColor *color = [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; + backgroundColor = [NSColor colorWithCalibratedRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:kHighlightColorAlphaLevel]; + } else if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { + NSColor *color = [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]; + backgroundColor = [NSColor colorWithCalibratedRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:kHighlightColorAlphaLevel]; + } + + if(backgroundColor) { + NSColor *foregroundColor = [[DVTFontAndColorTheme currentTheme] sourceTextBackgroundColor]; + return @{NSForegroundColorAttributeName : foregroundColor, NSBackgroundColorAttributeName : backgroundColor}; + } else { + return @{NSForegroundColorAttributeName : color}; + } } - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinished @@ -188,31 +207,19 @@ - (void)handleMouseEvent:(NSEvent *)theEvent #pragma mark - Theme - (void)updateTheme -{ - [self.scrollView setBackgroundColor:self.backgroundColor]; - [self.textView setBackgroundColor:self.backgroundColor]; - [self.selectionView setSelectionColor:nil]; -} - -- (NSColor *)backgroundColor { DVTFontAndColorTheme *theme = [DVTFontAndColorTheme currentTheme]; + NSColor *backgroundColor = [theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel]; - if(theme.sourceTextBackgroundColor) { - return [theme.sourceTextBackgroundColor shadowWithLevel:kDefaultShadowLevel]; - } + [self.scrollView setBackgroundColor:backgroundColor]; + [self.textView setBackgroundColor:backgroundColor]; - return [[NSColor clearColor] shadowWithLevel:kDefaultShadowLevel]; -} - -- (NSColor *)commentColor -{ - return [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentColor]]; -} - -- (NSColor *)preprocessorColor -{ - return [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorColor]]; + NSColor *selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [backgroundColor redComponent]) + green:(1.0f - [backgroundColor greenComponent]) + blue:(1.0f - [backgroundColor blueComponent]) + alpha:kHighlightColorAlphaLevel]; + + [self.selectionView setSelectionColor:selectionColor]; } #pragma mark - Autoresizing From e33d98c345c45c9b62b4bba340978d1373d36a4c Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 25 Jan 2015 17:06:10 +0000 Subject: [PATCH 28/96] Re-indented using tabs instead of spaces. --- SCXcodeMinimap/SCXcodeMinimap.m | 108 ++++++++++++++++---------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 5da715c..2f54e40 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -29,72 +29,72 @@ @implementation SCXcodeMinimap + (void)pluginDidLoad:(NSBundle *)plugin { static SCXcodeMinimap *sharedMinimap = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedMinimap = [[self alloc] init]; - }); + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedMinimap = [[self alloc] init]; + }); } - (id)init { - if (self = [super init]) { + if (self = [super init]) { - [self createMenuItem]; - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDidFinishSetup:) name:IDESourceCodeEditorDidFinishSetupNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onCodeEditorBoundsChange:) name:IDESourceCodeEditorTextViewBoundsDidChangeNotification object:nil]; - } - return self; + [self createMenuItem]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDidFinishSetup:) name:IDESourceCodeEditorDidFinishSetupNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onCodeEditorBoundsChange:) name:IDESourceCodeEditorTextViewBoundsDidChangeNotification object:nil]; + } + return self; } #pragma mark - Menu Items and Actions - (void)createMenuItem { - NSMenuItem *editMenuItem = [[NSApp mainMenu] itemWithTitle:@"View"]; - - if(editMenuItem == nil) { - return; - } - - NSMenuItem *miniMapItem = [[NSMenuItem alloc] initWithTitle:@"" - action:NULL - keyEquivalent:@"M"]; - [miniMapItem setKeyEquivalentModifierMask:NSControlKeyMask | NSShiftKeyMask]; - - miniMapItem.target = self; - - [editMenuItem.submenu insertItem:[NSMenuItem separatorItem] - atIndex:[editMenuItem.submenu numberOfItems]]; - [editMenuItem.submenu insertItem:miniMapItem - atIndex:[editMenuItem.submenu numberOfItems]]; - - if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { - [self hideMiniMap:miniMapItem]; - } - else { - [self showMiniMap:miniMapItem]; - } + NSMenuItem *editMenuItem = [[NSApp mainMenu] itemWithTitle:@"View"]; + + if(editMenuItem == nil) { + return; + } + + NSMenuItem *miniMapItem = [[NSMenuItem alloc] initWithTitle:@"" + action:NULL + keyEquivalent:@"M"]; + [miniMapItem setKeyEquivalentModifierMask:NSControlKeyMask | NSShiftKeyMask]; + + miniMapItem.target = self; + + [editMenuItem.submenu insertItem:[NSMenuItem separatorItem] + atIndex:[editMenuItem.submenu numberOfItems]]; + [editMenuItem.submenu insertItem:miniMapItem + atIndex:[editMenuItem.submenu numberOfItems]]; + + if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { + [self hideMiniMap:miniMapItem]; + } + else { + [self showMiniMap:miniMapItem]; + } } - (void)hideMiniMap:(NSMenuItem *)sender { - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:SCXodeMinimapIsInitiallyHidden]; - - [sender setTitle:@"Show Minimap"]; - [sender setAction:@selector(showMiniMap:)]; - - [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapHideNotification object:nil]; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:SCXodeMinimapIsInitiallyHidden]; + + [sender setTitle:@"Show Minimap"]; + [sender setAction:@selector(showMiniMap:)]; + + [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapHideNotification object:nil]; } - (void)showMiniMap:(NSMenuItem *)sender { - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:SCXodeMinimapIsInitiallyHidden]; - - [sender setTitle:@"Hide Minimap"]; - [sender setAction:@selector(hideMiniMap:)]; - - [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapShowNotification object:nil]; + [[NSUserDefaults standardUserDefaults] setBool:NO forKey:SCXodeMinimapIsInitiallyHidden]; + + [sender setTitle:@"Hide Minimap"]; + [sender setAction:@selector(hideMiniMap:)]; + + [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapShowNotification object:nil]; } #pragma mark - Xcode Notification @@ -108,7 +108,7 @@ - (void)onCodeEditorBoundsChange:(NSNotification*)sender IDESourceCodeEditor *editor = (IDESourceCodeEditor *)[sender object]; SCXcodeMinimapView *miniMapView = objc_getAssociatedObject(editor.scrollView, &kAssociatedObjectMinimapViewKey); - [miniMapView updateOffset]; + [miniMapView updateOffset]; } - (void)onDidFinishSetup:(NSNotification*)sender @@ -119,15 +119,15 @@ - (void)onDidFinishSetup:(NSNotification*)sender } IDESourceCodeEditor *editor = (IDESourceCodeEditor *)[sender object]; - [editor.textView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable]; + [editor.textView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable]; - CGFloat width = editor.textView.bounds.size.width * kDefaultZoomLevel; - NSRect miniMapScrollViewFrame = NSMakeRect(editor.containerView.bounds.size.width - width, 0, width, editor.scrollView.bounds.size.height); + CGFloat width = editor.textView.bounds.size.width * kDefaultZoomLevel; + NSRect miniMapScrollViewFrame = NSMakeRect(editor.containerView.bounds.size.width - width, 0, width, editor.scrollView.bounds.size.height); - SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editorScrollView:editor.scrollView editorTextView:editor.textView]; - [editor.containerView addSubview:miniMapView]; + SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editorScrollView:editor.scrollView editorTextView:editor.textView]; + [editor.containerView addSubview:miniMapView]; - objc_setAssociatedObject(editor.scrollView, &kAssociatedObjectMinimapViewKey, miniMapView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + objc_setAssociatedObject(editor.scrollView, &kAssociatedObjectMinimapViewKey, miniMapView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); [miniMapView setVisible:![[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]]; } From 6349e762e4cccb8587bc622c75b856ca2e24d4a7 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 26 Jan 2015 11:10:25 +0000 Subject: [PATCH 29/96] Moved kDefaultZoomLevel to the SCXcodeMinimap class and added highlighting for comment.doc and comment.doc.keyword. --- SCXcodeMinimap/SCXcodeMinimap.h | 2 ++ SCXcodeMinimap/SCXcodeMinimap.m | 2 ++ SCXcodeMinimap/SCXcodeMinimapView.h | 2 -- SCXcodeMinimap/SCXcodeMinimapView.m | 11 ++++++++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index f583f32..99705c1 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -8,6 +8,8 @@ #import +const CGFloat kDefaultZoomLevel; + extern NSString *const SCXodeMinimapShowNotification; extern NSString *const SCXodeMinimapHideNotification; diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 2f54e40..e50a812 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -13,6 +13,8 @@ #import "IDESourceCodeEditor.h" #import "DVTSourceTextView.h" +const CGFloat kDefaultZoomLevel = 0.15f; + static char kAssociatedObjectMinimapViewKey; static NSString * const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.h b/SCXcodeMinimap/SCXcodeMinimapView.h index 230e4f4..ef766be 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.h +++ b/SCXcodeMinimap/SCXcodeMinimapView.h @@ -11,8 +11,6 @@ @class DVTSourceTextView; @class SCSelectionView; -extern const CGFloat kDefaultZoomLevel; - @interface SCXcodeMinimapView : NSView - (instancetype)initWithFrame:(NSRect)frameRect diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 1fffb83..ca709f0 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -16,11 +16,12 @@ #import "DVTSourceNodeTypes.h" #import "DVTFontAndColorTheme.h" -const CGFloat kDefaultZoomLevel = 0.1f; const CGFloat kBackgroundColorShadowLevel = 0.1f; const CGFloat kHighlightColorAlphaLevel = 0.3f; static NSString * const kXcodeSyntaxCommentNodeName = @"xcode.syntax.comment"; +static NSString * const kXcodeSyntaxCommentDocNodeName = @"xcode.syntax.comment.doc"; +static NSString * const kXcodeSyntaxCommentDocKeywordNodeName = @"xcode.syntax.comment.doc.keyword"; static NSString * const kXcodeSyntaxPreprocessorNodeName = @"xcode.syntax.preprocessor"; static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; @@ -121,10 +122,14 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTempor NSColor *color = [storage colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; NSColor *backgroundColor = nil; - if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]) { + if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || + currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || + currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) + { NSColor *color = [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; backgroundColor = [NSColor colorWithCalibratedRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:kHighlightColorAlphaLevel]; - } else if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { + } else if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) + { NSColor *color = [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]; backgroundColor = [NSColor colorWithCalibratedRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:kHighlightColorAlphaLevel]; } From d6095c4110cc1cca60f2c0018e4cc2a61565e7db Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 26 Jan 2015 15:27:39 +0000 Subject: [PATCH 30/96] Fixes the selection view frame when the document and the scrollView heights are equal. --- SCXcodeMinimap/SCXcodeMinimapView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index ca709f0..7d3f29d 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -167,7 +167,7 @@ - (void)updateOffset return; } - CGFloat ratio = (CGRectGetHeight([self.scrollView.documentView frame]) - CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)) / editorContentHeight * (1 / self.scrollView.magnification); + CGFloat ratio = (MAX(CGRectGetHeight(self.scrollView.bounds) , (CGRectGetHeight([self.scrollView.documentView frame]) - CGRectGetHeight(self.scrollView.bounds))) * (1 / self.scrollView.magnification)) / editorContentHeight * (1 / self.scrollView.magnification); if(ratio == 0.0f) { [self.selectionView setFrame:selectionViewFrame]; From 20b50ad38e8df9949519a0919290abf0971af244 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 28 Jan 2015 08:06:06 +0000 Subject: [PATCH 31/96] Various tweaks and fixes. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 26 ++- SCXcodeMinimap/SCXcodeMinimap.m | 2 +- SCXcodeMinimap/SCXcodeMinimapView.h | 7 +- SCXcodeMinimap/SCXcodeMinimapView.m | 22 +-- SCXcodeMinimap/Xcode Headers/DVTTextStorage.h | 7 +- .../Xcode Headers/IDEEditorDocument.h | 187 ++++++++++++++++++ .../Xcode Headers/IDEFileTextSettings.h | 49 +++++ .../Xcode Headers/IDESourceCodeDocument.h | 164 +++++++++++++++ 8 files changed, 433 insertions(+), 31 deletions(-) create mode 100644 SCXcodeMinimap/Xcode Headers/IDEEditorDocument.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEFileTextSettings.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDESourceCodeDocument.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 89d7ac0..50be9c9 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */; }; 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */; }; 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 184C118E1A741136002A7C65 /* DVTFoundation.framework */; }; + 1876135F1A77A74300974BE1 /* IDEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1876135E1A77A74300974BE1 /* IDEKit.framework */; }; 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 188308091A7411830005DF40 /* DVTKit.framework */; }; 1883080C1A7411930005DF40 /* IDESourceEditor.ideplugin in Resources */ = {isa = PBXBuildFile; fileRef = 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */; }; 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 1883080F1A7411A70005DF40 /* IDESourceEditor */; }; @@ -19,7 +20,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTCompletingTextView.h; sourceTree = ""; }; + 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = DVTCompletingTextView.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFontAndColorTheme.h; sourceTree = ""; }; 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTInvalidation-Protocol.h"; sourceTree = ""; }; 184C11741A740F8A002A7C65 /* DVTPointerArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTPointerArray.h; sourceTree = ""; }; @@ -28,18 +30,20 @@ 184C11771A740F8A002A7C65 /* DVTSourceModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceModel.h; sourceTree = ""; }; 184C11781A740F8A002A7C65 /* DVTSourceModelItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceModelItem.h; sourceTree = ""; }; 184C11791A740F8A002A7C65 /* DVTSourceNodeTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceNodeTypes.h; sourceTree = ""; }; - 184C117A1A740F8A002A7C65 /* DVTSourceTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTSourceTextView.h; sourceTree = ""; }; - 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTTextStorage.h; sourceTree = ""; }; + 184C117A1A740F8A002A7C65 /* DVTSourceTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = DVTSourceTextView.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = DVTTextStorage.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 184C117C1A740F8A002A7C65 /* DVTViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTViewController.h; sourceTree = ""; }; 184C117D1A740F8A002A7C65 /* IDEEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEEditor.h; sourceTree = ""; }; - 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDESourceCodeEditor.h; sourceTree = ""; }; - 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDESourceCodeEditorContainerView.h; sourceTree = ""; }; - 184C11801A740F8A002A7C65 /* IDEViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEViewController.h; sourceTree = ""; }; + 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeEditor.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeEditorContainerView.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 184C11801A740F8A002A7C65 /* IDEViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDEViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapSelectionView.h; sourceTree = ""; }; 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapSelectionView.m; sourceTree = ""; }; 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapView.h; sourceTree = ""; }; - 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapView.m; sourceTree = ""; }; + 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = SCXcodeMinimapView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 184C118E1A741136002A7C65 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; + 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDEEditorDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 1876135E1A77A74300974BE1 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = ../../../../../Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDESourceEditor.ideplugin; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin; sourceTree = ""; }; 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; @@ -52,6 +56,7 @@ 18FE09C11707639E00118FEB /* SCXcodeMinimap-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SCXcodeMinimap-Prefix.pch"; sourceTree = ""; }; 18FE09C7170764E400118FEB /* SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimap.h; sourceTree = ""; }; 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimap.m; sourceTree = ""; }; + 18FEFA8C1A782D8600DC98C5 /* IDEFileTextSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEFileTextSettings.h; sourceTree = ""; }; 8742532217307161001C947C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -64,6 +69,7 @@ 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */, 8742532317307161001C947C /* QuartzCore.framework in Frameworks */, 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */, + 1876135F1A77A74300974BE1 /* IDEKit.framework in Frameworks */, 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -90,6 +96,9 @@ 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */, 184C11801A740F8A002A7C65 /* IDEViewController.h */, + 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */, + 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */, + 18FEFA8C1A782D8600DC98C5 /* IDEFileTextSettings.h */, ); path = "Xcode Headers"; sourceTree = ""; @@ -117,6 +126,7 @@ 18FE09B51707639E00118FEB /* Cocoa.framework */, 184C118E1A741136002A7C65 /* DVTFoundation.framework */, 188308091A7411830005DF40 /* DVTKit.framework */, + 1876135E1A77A74300974BE1 /* IDEKit.framework */, 1883080F1A7411A70005DF40 /* IDESourceEditor */, 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */, 18FE09B71707639E00118FEB /* Other Frameworks */, @@ -296,6 +306,7 @@ "$(inherited)", "$(PROJECT_DIR)", "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", ); GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -322,6 +333,7 @@ "$(inherited)", "$(PROJECT_DIR)", "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", ); GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index e50a812..38aa1a1 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -126,7 +126,7 @@ - (void)onDidFinishSetup:(NSNotification*)sender CGFloat width = editor.textView.bounds.size.width * kDefaultZoomLevel; NSRect miniMapScrollViewFrame = NSMakeRect(editor.containerView.bounds.size.width - width, 0, width, editor.scrollView.bounds.size.height); - SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editorScrollView:editor.scrollView editorTextView:editor.textView]; + SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editor:editor]; [editor.containerView addSubview:miniMapView]; objc_setAssociatedObject(editor.scrollView, &kAssociatedObjectMinimapViewKey, miniMapView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); diff --git a/SCXcodeMinimap/SCXcodeMinimapView.h b/SCXcodeMinimap/SCXcodeMinimapView.h index ef766be..eaba1b6 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.h +++ b/SCXcodeMinimap/SCXcodeMinimapView.h @@ -8,14 +8,11 @@ #import -@class DVTSourceTextView; -@class SCSelectionView; +@class IDESourceCodeEditor; @interface SCXcodeMinimapView : NSView -- (instancetype)initWithFrame:(NSRect)frameRect - editorScrollView:(NSScrollView *)editorScrollView - editorTextView:(DVTSourceTextView *)editorTextView; +- (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor; - (void)updateOffset; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 7d3f29d..a2e3cb0 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -10,6 +10,7 @@ #import "SCXcodeMinimap.h" #import "SCXcodeMinimapSelectionView.h" +#import "IDESourceCodeEditor.h" #import "DVTTextStorage.h" #import "DVTPointerArray.h" #import "DVTSourceTextView.h" @@ -44,29 +45,30 @@ - (void)dealloc [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (id)initWithFrame:(NSRect)frame editorScrollView:(NSScrollView *)editorScrollView editorTextView:(DVTSourceTextView *)editorTextView +- (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor { if (self = [super initWithFrame:frame]) { + self.editorScrollView = editor.scrollView; + self.editorTextView = editor.textView; + [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; - self.editorScrollView = editorScrollView; - self.editorTextView = editorTextView; - self.scrollView = [[NSScrollView alloc] initWithFrame:self.bounds]; [self.scrollView setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; + [self.scrollView setDrawsBackground:NO]; [self.scrollView setHorizontalScrollElasticity:NSScrollElasticityNone]; [self.scrollView setVerticalScrollElasticity:NSScrollElasticityNone]; [self addSubview:self.scrollView]; self.textView = [[DVTSourceTextView alloc] initWithFrame:self.editorTextView.bounds]; + [self.textView setTextStorage:editor.textView.textStorage]; [self.textView setEditable:NO]; [self.textView setSelectable:NO]; - [self.textView setTextStorage:editorTextView.textStorage]; - [self.scrollView setDocumentView:self.textView]; + [self.scrollView setDocumentView:self.textView]; self.selectionView = [[SCXcodeMinimapSelectionView alloc] init]; [self.textView addSubview:_selectionView]; @@ -163,16 +165,12 @@ - (void)updateOffset NSRect selectionViewFrame = NSMakeRect(0, 0, self.bounds.size.width * (1 / self.scrollView.magnification), self.editorScrollView.visibleRect.size.height); if(editorContentHeight == 0.0f) { + NSLog(@"editorContentHeight IS %f", editorContentHeight); [self.selectionView setFrame:selectionViewFrame]; return; } - CGFloat ratio = (MAX(CGRectGetHeight(self.scrollView.bounds) , (CGRectGetHeight([self.scrollView.documentView frame]) - CGRectGetHeight(self.scrollView.bounds))) * (1 / self.scrollView.magnification)) / editorContentHeight * (1 / self.scrollView.magnification); - - if(ratio == 0.0f) { - [self.selectionView setFrame:selectionViewFrame]; - return; - } + CGFloat ratio = (CGRectGetHeight([self.scrollView.documentView frame]) - CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)) / editorContentHeight * (1 / self.scrollView.magnification); CGPoint offset = NSMakePoint(0, MAX(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification))); [self.scrollView.documentView scrollPoint:offset]; diff --git a/SCXcodeMinimap/Xcode Headers/DVTTextStorage.h b/SCXcodeMinimap/Xcode Headers/DVTTextStorage.h index 4189cff..669faea 100644 --- a/SCXcodeMinimap/Xcode Headers/DVTTextStorage.h +++ b/SCXcodeMinimap/Xcode Headers/DVTTextStorage.h @@ -12,13 +12,8 @@ @property DVTSourceModel* sourceModel; @property(readonly) id sourceModelService; // DVTSourceTextStorage -@property(readonly) unsigned long long currentChangeIndex; - -(NSColor*)colorAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; --(void)fixSyntaxColoringInRange:(NSRange)range; + -(short)nodeTypeAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; -// FIXME: Workaround for NSObject+YOLO buggyness --(NSColor*)yl_colorAtCharacterIndex:(unsigned long long)charIndex effectiveRange:(NSRangePointer)range context:(id)context; -- (id)sourceModelItemAtCharacterIndex:(unsigned long long)arg1; //DVTSourceTextStorage in Xcode 5, DVTSourceLanguageSourceModelService protocol in Xcode 5.1 @end diff --git a/SCXcodeMinimap/Xcode Headers/IDEEditorDocument.h b/SCXcodeMinimap/Xcode Headers/IDEEditorDocument.h new file mode 100644 index 0000000..e5ff83e --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEEditorDocument.h @@ -0,0 +1,187 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import + +@class DVTDispatchLock, DVTExtension, DVTFileDataType, DVTFilePath, DVTMapTable, DVTNotificationToken, DVTStackBacktrace, DVTUndoManager, NSDictionary, NSMutableArray, NSMutableSet, NSSet, NSString, NSURL; + +@interface IDEEditorDocument : NSDocument +{ + DVTDispatchLock *_editorDocumentLock; + DVTExtension *_extension; + DVTFileDataType *_ide_hintedFileDataType; + DVTFilePath *_filePath; + DVTFilePath *autosavedContentsFilePath; + DVTMapTable *_readOnlyClientsForRegistrationBacktrace; + DVTNotificationToken *_willRedoChangeNotificationToken; + DVTNotificationToken *_willUndoChangeNotificationToken; + DVTStackBacktrace *_addedToDocumentControllerBacktrace; + DVTStackBacktrace *_autosaveWithImplicitCancellabilityCallerBacktrace; + DVTStackBacktrace *_beginUnlockingBacktrace; + DVTStackBacktrace *_canCloseDocumentCallPriorToClosingDocumentStackBacktrace; + DVTStackBacktrace *_continueActivityCallerBacktrace; + DVTStackBacktrace *_continueAsynchronousWorkOnMainThreadCallerBacktrace; + DVTStackBacktrace *_continueFileAccessCallerBacktrace; + DVTStackBacktrace *_creationBacktrace; + DVTStackBacktrace *_firstPerformActivityMessageBacktrace; + DVTStackBacktrace *_invalidationBacktrace; + DVTStackBacktrace *_lastUndoChangeNotificationBacktrace; + DVTUndoManager *_dvtUndoManager; + int _readOnlyStatus; + NSDictionary *_willCloseNotificationUserInfo; + NSMutableArray *_pendingChanges; + NSMutableSet *_documentEditors; + NSURL *_ide_representedURL; + id _filePresenterWriter; + BOOL _cachedHasRecentChanges; + BOOL _didDisableAutomaticTermination; + BOOL _ide_isTemporaryDocument; + BOOL _inSetUndoManager; + BOOL _inWriteSafelyToURL; + BOOL _isAttemptingToRespondToSaveDocumentAction; + BOOL _isClosing; + BOOL _isClosingForRevert; + BOOL _isInvalidated; + BOOL _isRespondingToFSChanges; + BOOL _isSafeToCallClose; + BOOL _isUndoingAfterFailureToUnlockDocument; + BOOL _isWritingToDisk; + BOOL _shouldAssertIfNotInvalidatedBeforeDealloc; + BOOL _trackFileSystemChanges; + BOOL _wholeDocumentChanged; + NSSet *_readOnlyClients; + DVTFilePath *_autosavedContentsFilePath; +} + ++ (BOOL)_presentsVersionsUserInterface; ++ (BOOL)autosavesInPlace; ++ (id)editedFileContents; ++ (id)readableTypes; ++ (BOOL)_validateDocumentExtension:(id)arg1; ++ (BOOL)_shouldShowUtilititesAreaAtLoadForSimpleFilesFocusedWorkspace; ++ (BOOL)shouldTrackFileSystemChanges; ++ (BOOL)shouldUnlockFileURLBeforeMakingChanges; ++ (void)initialize; +@property(retain, nonatomic) DVTExtension *extension; // @synthesize extension=_extension; +@property(retain) DVTStackBacktrace *creationBacktrace; // @synthesize creationBacktrace=_creationBacktrace; +@property(retain) DVTFilePath *autosavedContentsFilePath; // @synthesize autosavedContentsFilePath=_autosavedContentsFilePath; +@property(retain) DVTFilePath *filePath; // @synthesize filePath=_filePath; +@property int readOnlyStatus; // @synthesize readOnlyStatus=_readOnlyStatus; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; // @synthesize invalidationBacktrace=_invalidationBacktrace; +@property BOOL trackFileSystemChanges; // @synthesize trackFileSystemChanges=_trackFileSystemChanges; +- (void)restoreStateWithCoder:(id)arg1; +- (void)encodeRestorableStateWithCoder:(id)arg1; +- (void)restoreDocumentWindowWithIdentifier:(id)arg1 state:(id)arg2 completionHandler:(id)arg3; +- (void)unregisterReadOnlyClient:(id)arg1; +- (void)registerReadOnlyClient:(id)arg1; +@property(readonly) NSSet *readOnlyClients; // @synthesize readOnlyClients=_readOnlyClients; +- (BOOL)makeWritableWithError:(id *)arg1; +@property(readonly) NSURL *readOnlyItemURL; +- (void)_updateReadOnlyStatus; +- (void)exportDocument:(id)arg1; +@property(readonly) BOOL canExportDocument; +- (void)duplicateDocument:(id)arg1; +- (void)revertDocumentToSaved:(id)arg1; +- (BOOL)_checkAutosavingPossibilityAndReturnError:(id *)arg1; +- (BOOL)checkAutosavingSafetyAndReturnError:(id *)arg1; +- (BOOL)editingShouldAutomaticallyDuplicate; +- (id)duplicateAndReturnError:(id *)arg1; +- (id)printOperationWithSettings:(id)arg1 error:(id *)arg2; +- (BOOL)readFromData:(id)arg1 ofType:(id)arg2 error:(id *)arg3; +- (id)dataOfType:(id)arg1 error:(id *)arg2; +- (void)presentedItemDidChange; +- (void)presentedItemDidMoveToURL:(id)arg1; +- (BOOL)canRevert; +- (id)editedContents; +- (id)diffDataSource; +- (id)updatedLocationFromLocation:(id)arg1 toTimestamp:(double)arg2; +- (id)emptyPrivateCopy; +- (id)privateCopy; +- (void)updateChangedLocation:(id)arg1; +- (void)_sendOutDocumentUpdateLocation; +- (void)updateChangeCountWithToken:(id)arg1 forSaveOperation:(unsigned long long)arg2; +- (void)updateChangeCount:(unsigned long long)arg1; +- (void)ide_didFixupChangeCountWithWasEdited:(BOOL)arg1 didHaveEditsSinceLastUserInitiatedSave:(BOOL)arg2 changeString:(id)arg3; +- (BOOL)hasBeenEditedSinceLastUserInitiatedSave; +- (void)ide_revertDocumentToSaved:(id)arg1; +- (void)ide_moveDocumentTo:(id)arg1; +- (void)ide_renameDocument:(id)arg1; +- (void)ide_saveDocumentAs:(id)arg1; +- (void)ide_duplicateDocument:(id)arg1; +- (void)ide_saveDocument:(id)arg1; +- (BOOL)validateUserInterfaceItem:(id)arg1; +@property(readonly) BOOL canSaveAs; +@property(readonly) BOOL canSave; +- (BOOL)isClosingForRevert; +- (void)didExternallyRelocateFileContent; +- (void)willExternallyRelocateFileContent; +- (void)closeToRevert; +@property(readonly, getter=isClosed) BOOL closed; +- (void)close; +- (BOOL)_isClosing; +- (void)closePrivateDocumentSynchronously; +- (void)tryCloseAsynchronouslyWithCompletionBlock:(id)arg1; +- (void)_tryCloseAsynchronouslyToRevert:(BOOL)arg1 withCompletionBlock:(id)arg2; +- (void)_tryCloseAsynchronouslyToRevert:(BOOL)arg1 promptForUnsavedChanges:(BOOL)arg2 withCompletionBlock:(id)arg3; +- (void)_canCloseAsynchronouslyToRevert:(BOOL)arg1 promptForUnsavedChanges:(BOOL)arg2 withCompletionBlock:(id)arg3; +- (void)performActivityWithSynchronousWaiting:(BOOL)arg1 usingBlock:(id)arg2; +- (void)_didAddToDocumentController; +- (void)canCloseDocumentWithDelegate:(id)arg1 shouldCloseSelector:(SEL)arg2 contextInfo:(void *)arg3; +- (void)ide_editorDocument:(id)arg1 shouldClose:(BOOL)arg2 contextInfo:(void *)arg3; +@property(readonly) NSString *messageForIsValidAssertion; +- (void)editorDocumentDidClose; +- (void)editorDocumentWillClose; +- (void)saveDocumentAs:(id)arg1; +- (void)saveDocument:(id)arg1; +- (id)initForURL:(id)arg1 withContentsOfURL:(id)arg2 ofType:(id)arg3 error:(id *)arg4; +- (id)initWithContentsOfURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3; +- (id)initWithType:(id)arg1 error:(id *)arg2; +- (void)_handleDocumentFileChanges:(id)arg1; +- (id)windowForSheet; +- (BOOL)_windowForSheet:(id *)arg1 workspaceForSheet:(id *)arg2 editor:(id *)arg3; +- (id)ide_displayName; +- (void)setAutosavedContentsFileURL:(id)arg1; +- (id)autosavedContentsFileURL; +- (void)setFileURL:(id)arg1; +- (id)fileURL; +- (void)relinquishPresentedItemToWriter:(id)arg1; +- (void)_respondToFileChangeOnDiskWithFilePath:(id)arg1; +- (void)saveForOperation:(unsigned long long)arg1 withCompletionHandler:(id)arg2; +- (void)saveToURL:(id)arg1 ofType:(id)arg2 forSaveOperation:(unsigned long long)arg3 completionHandler:(id)arg4; +- (void)ide_finishSaving:(BOOL)arg1 forSaveOperation:(unsigned long long)arg2 previousPath:(id)arg3; +- (BOOL)writeSafelyToURL:(id)arg1 ofType:(id)arg2 forSaveOperation:(unsigned long long)arg3 error:(id *)arg4; +- (id)fileNameExtensionForType:(id)arg1 saveOperation:(unsigned long long)arg2; +- (BOOL)revertToContentsOfURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3; +- (void)unregisterDocumentEditor:(id)arg1; +- (void)registerDocumentEditor:(id)arg1; +- (id)_documentEditors; +- (void)undoManagerWillModifyItself:(id)arg1; +- (void)setHasUndoManager:(BOOL)arg1; +- (void)setUndoManager:(id)arg1; +- (void)ide_setUndoManager:(id)arg1; +- (id)undoManager; +- (void)teardownUndoManager:(id)arg1; +- (void)setupUndoManager:(id)arg1; +- (id)newUndoManager; +- (void)_startUnlockIfNeededForWorkspace:(id)arg1 window:(id)arg2 completionBlock:(id)arg3; +- (void)_unlockIfNeededCompletionBlock:(id)arg1; +- (id)init; +- (void)_changeWasRedone:(id)arg1; +- (void)_changeWasUndone:(id)arg1; +- (void)_changeWasDone:(id)arg1; +- (void)autosaveWithImplicitCancellability:(BOOL)arg1 completionHandler:(id)arg2; +- (void)continueAsynchronousWorkOnMainThreadUsingBlock:(id)arg1; +- (void)continueActivityUsingBlock:(id)arg1; +- (void)continueFileAccessUsingBlock:(id)arg1; +- (void)setSdefSupport_displayName:(id)arg1; +- (id)sdefSupport_displayName; +@property(retain) DVTFileDataType *ide_hintedFileDataType; +@property(copy) NSURL *ide_representedURL; +@property(readonly) BOOL ide_isTextRepresentation; +- (void)convertToDocumentAtFilePath:(id)arg1 forFileDataType:(id)arg2 completionBlock:(id)arg3; +@property BOOL ide_isTemporaryDocument; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDEFileTextSettings.h b/SCXcodeMinimap/Xcode Headers/IDEFileTextSettings.h new file mode 100644 index 0000000..b05c1e1 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEFileTextSettings.h @@ -0,0 +1,49 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import + +@class DVTStackBacktrace, IDEFileReference; + +@interface IDEFileTextSettings : NSObject +{ + IDEFileReference *_fileReference; + unsigned long long _textEncoding; + long long _tabWidth; + long long _indentWidth; + unsigned long long _lineEndings; + BOOL _usesTabs; + BOOL _wrapsLines; +} + ++ (void)initialize; +@property BOOL wrapsLines; // @synthesize wrapsLines=_wrapsLines; +@property long long indentWidth; // @synthesize indentWidth=_indentWidth; +@property long long tabWidth; // @synthesize tabWidth=_tabWidth; +@property BOOL usesTabs; // @synthesize usesTabs=_usesTabs; +@property unsigned long long textEncoding; // @synthesize textEncoding=_textEncoding; +@property unsigned long long lineEndings; // @synthesize lineEndings=_lineEndings; +@property(retain, nonatomic) IDEFileReference *fileReference; // @synthesize fileReference=_fileReference; +- (id)description; +- (void)updateWrapLines; +- (void)updateIndentWidth; +- (void)updateTabWidth; +- (void)updateUsesTabs; +- (void)updateTextEncoding; +- (void)updateLineEndings; +- (id)_textPreferences; +- (void)primitiveInvalidate; +- (void)_clearFileReferenceObservations; +- (id)init; +- (void)unregisterObserversWithSourceTextView:(id)arg1 textStorage:(id)arg2; +- (void)registerObserversWithSourceTextView:(id)arg1 textStorage:(id)arg2; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDESourceCodeDocument.h b/SCXcodeMinimap/Xcode Headers/IDESourceCodeDocument.h new file mode 100644 index 0000000..f9c6902 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDESourceCodeDocument.h @@ -0,0 +1,164 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "IDEEditorDocument.h" + +@class DVTDelayedInvocation, DVTFileDataType, DVTGeneratedContentProvider, DVTNotificationToken, DVTObservingToken, DVTPerformanceMetric, DVTSourceCodeLanguage, DVTTextStorage, IDEDiagnosticController, IDEGeneratedContentStatusContext, IDESourceCodeAdjustNodeTypesRequest, NSArray, NSMutableSet; + +@interface IDESourceCodeDocument : IDEEditorDocument +{ + DVTTextStorage *_textStorage; + DVTSourceCodeLanguage *_language; + IDEDiagnosticController *_diagnosticController; + NSArray *_sourceLandmarks; + NSMutableSet *_pendingAdjustNodeTypeRequests; + IDESourceCodeAdjustNodeTypesRequest *_lastAdjustNodeTypesRequest; + struct _NSRange _prefetchedNodeTypesLineRange; + DVTGeneratedContentProvider *_generatedContentProvider; + IDEGeneratedContentStatusContext *_generatedContentStatusContext; + BOOL _generatesContent; + DVTObservingToken *_generatedContentProviderDisplayNameObserver; + DVTNotificationToken *_indexDidIndexWorkspaceObserver; + DVTNotificationToken *_indexDidChangeObserver; + unsigned long long _lineEndings; + unsigned long long _textEncoding; + BOOL _usesLanguageFromFileDataType; + BOOL _languageSupportsSymbolColoring; + BOOL _setUpPrintInfoDefaults; + BOOL _isUnicodeWithBOM; + BOOL _isUnicodeBE; + BOOL _droppedRecomputableState; + DVTDelayedInvocation *_dropRecomputableState; + BOOL _notifiesWhenClosing; +} + ++ (id)syntaxColoringPrefetchLogAspect; ++ (id)topLevelStructureLogAspect; ++ (void)initialize; +@property BOOL notifiesWhenClosing; // @synthesize notifiesWhenClosing=_notifiesWhenClosing; +@property(retain) IDEGeneratedContentStatusContext *generatedContentStatusContext; // @synthesize generatedContentStatusContext=_generatedContentStatusContext; +@property BOOL generatesContent; // @synthesize generatesContent=_generatesContent; +@property(readonly) struct _NSRange prefetchedNodeTypesLineRange; // @synthesize prefetchedNodeTypesLineRange=_prefetchedNodeTypesLineRange; +@property(nonatomic) unsigned long long lineEndings; // @synthesize lineEndings=_lineEndings; +@property unsigned long long textEncoding; // @synthesize textEncoding=_textEncoding; +@property(nonatomic) BOOL usesLanguageFromFileDataType; // @synthesize usesLanguageFromFileDataType=_usesLanguageFromFileDataType; +@property(retain, nonatomic) DVTSourceCodeLanguage *language; // @synthesize language=_language; +@property(readonly) DVTTextStorage *textStorage; // @synthesize textStorage=_textStorage; +- (void)_delayedDropRecomputableState:(id)arg1; +- (void)_restoreRecomputableState; +- (void)_dropRecomputableState; +- (void)_documentMovingToForeground; +- (void)_documentMovingToBackground:(BOOL)arg1; +- (void)registerDocumentEditor:(id)arg1; +- (void)unregisterDocumentEditor:(id)arg1; +- (id)sourceCodeGenerator:(id)arg1 commitInsertionOfSourceCodeForCompositeResult:(id)arg2 error:(id *)arg3; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCAtSynthesizeWithName:(id)arg2 inClassNamed:(id)arg3 options:(id)arg4 error:(id *)arg5; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCPropertyDeclarationWithName:(id)arg2 type:(id)arg3 inClassNamed:(id)arg4 options:(id)arg5 error:(id *)arg6; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCPropertyReleaseForTeardownWithName:(id)arg2 type:(id)arg3 inClassNamed:(id)arg4 options:(id)arg5 error:(id *)arg6; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCInstanceVariableReleaseForTeardownWithName:(id)arg2 inClassNamed:(id)arg3 options:(id)arg4 error:(id *)arg5; +- (id)_primitiveAddObjectiveCReleaseForTeardownMethodWithSourceCodeGenerator:(id)arg1 withReleaseCallCode:(id)arg2 inClassNamed:(id)arg3 options:(id)arg4 error:(id *)arg5; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCInstanceVariableDeclarationWithName:(id)arg2 type:(id)arg3 inClassNamed:(id)arg4 options:(id)arg5 error:(id *)arg6; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCClassMethodDefinitionWithName:(id)arg2 inClassNamed:(id)arg3 options:(id)arg4 error:(id *)arg5; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCClassMethodDeclarationWithName:(id)arg2 inClassNamed:(id)arg3 options:(id)arg4 error:(id *)arg5; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCInstanceMethodDefinitionWithName:(id)arg2 inClassNamed:(id)arg3 options:(id)arg4 error:(id *)arg5; +- (id)_primitiveAppendObjectiveCSourceCode:(id)arg1 afterItem:(id)arg2 prependNewLine:(BOOL)arg3; +- (id)sourceCodeGenerator:(id)arg1 prepareToAddObjectiveCInstanceMethodDeclarationWithName:(id)arg2 inClassNamed:(id)arg3 options:(id)arg4 error:(id *)arg5; +- (id)_primitiveAddObjectiveCMethodSourceCode:(id)arg1 toClassItem:(id)arg2 withOptions:(id)arg3 error:(id *)arg4; +- (id)_primitiveAddObjectiveCSourceCode:(id)arg1 toClassItem:(id)arg2 withOptions:(id)arg3 insertAdditionalNewlineWhenInsertingWithAfterBeforeHint:(BOOL)arg4 insertAtEndWhenInsertingWithoutHint:(BOOL)arg5 insertAfterObjCBlockWhenInsertingAtBeginning:(BOOL)arg6 ignoreHintItemsConformingToSpecifications:(id)arg7 onlyConsiderItemsConformingToSpecifications:(id)arg8 error:(id *)arg9; +- (id)_insertObjectiveCSourceCode:(id)arg1 inTeardownMethodForClassNamed:(id)arg2 options:(id)arg3 error:(id *)arg4; +- (id)_teardownMethodNameForSourceCodeGeneratorWithOptions:(id)arg1; +- (BOOL)_hasObjCMethodImplementationForName:(id)arg1 forClassNamed:(id)arg2; +- (id)_objCMethodImplementationItemForName:(id)arg1 inClassItem:(id)arg2; +- (id)_insertObjCSourceCode:(id)arg1 inTopLevelOfClassItem:(id)arg2 withInsertAfterHint:(id)arg3 andInsertBeforeHint:(id)arg4 ignoreHintItemsConformingToSpecifications:(id)arg5 onlyConsiderItemsConformingToSpecifications:(id)arg6 insertAdditionalNewline:(BOOL)arg7 insertAtEndWhenInsertingWithoutHint:(BOOL)arg8 insertAfterObjCBlockWhenInsertingAtBeginning:(BOOL)arg9; +- (id)_insertObjCSourceCode:(id)arg1 inContainingSourceModelItem:(id)arg2 withInsertAfterHint:(id)arg3 andInsertBeforeHint:(id)arg4 ignoreHintItemsConformingToSpecifications:(id)arg5 onlyConsiderItemsConformingToSpecifications:(id)arg6 insertAdditionalNewline:(BOOL)arg7 fallbackInsertionBlock:(id)arg8; +- (long long)_insertionHintMatchPriorityForObjCSourceModelItem:(id)arg1 givenInsertionHintItemName:(id)arg2 andLanguageSpecification:(id)arg3 ignoreItemsConformingToSpecifications:(id)arg4 onlyConsiderItemsConformingToSpecifications:(id)arg5; +- (id)_insertObjCSourceCode:(id)arg1 inTopLevelOfClassItem:(id)arg2 asCloseAsPossibleToLineNumber:(unsigned long long)arg3 error:(id *)arg4; +- (id)_insertObjCSourceCode:(id)arg1 inContainingSourceModelItem:(id)arg2 asCloseAsPossibleToLineNumber:(unsigned long long)arg3 firstPossibleItemToInsertBefore:(id)arg4 error:(id *)arg5; +- (id)_insertionHintForObjCSourceModelItem:(id)arg1; +- (id)_firstObjCSourceModelItemToInsertBeforeInInstanceVariableBlock:(id)arg1; +- (id)_firstTopLevelObjCInterfaceSourceModelItemToInsertBeforeInClassItem:(id)arg1; +- (id)_insertSourceCode:(id)arg1 atBeginningOfClassSourceModelItem:(id)arg2 insertOnNextLine:(BOOL)arg3 insertAfterObjCBlock:(BOOL)arg4; +- (id)_insertSourceCode:(id)arg1 atEndOfClassSourceModelItem:(id)arg2 insertOnNextLine:(BOOL)arg3; +- (id)_insertSourceCode:(id)arg1 atEndOfContainingSourceModelItem:(id)arg2 insertOnNextLine:(BOOL)arg3 beforeItemMatchingPredicateBlock:(id)arg4; +- (id)_insertSourceCode:(id)arg1 atBeginningOfContainingSourceModelItem:(id)arg2 insertOnNextLine:(BOOL)arg3 afterItemMatchingPredicateBlock:(id)arg4; +- (id)_primitiveInsertSourceCode:(id)arg1 atBeginning:(BOOL)arg2 ofContainingSourceModelItem:(id)arg3 insertOnNextLine:(BOOL)arg4 afterOrBeforeItemMatchingPredicateBlock:(id)arg5; +- (id)_textDocumentLocationForInsertingSourceCode:(id)arg1 atLocation:(unsigned long long)arg2; +- (id)_instanceVariableDeclarationBlockItemForClassItem:(id)arg1; +- (id)_objCCategoryImplementationClassModelItemForClassNamed:(id)arg1 categoryName:(id)arg2 error:(id *)arg3; +- (id)_objCCategoryInterfaceClassModelItemForClassNamed:(id)arg1 categoryName:(id)arg2 options:(id)arg3 error:(id *)arg4; +- (id)_objCImplementationClassModelItemForClassNamed:(id)arg1 error:(id *)arg2; +- (id)_objCInterfaceClassModelItemForClassNamed:(id)arg1 error:(id *)arg2; +- (id)_classModelItemForClassNamed:(id)arg1 withConditionBlock:(id)arg2; +- (id)_errorForNotFindingClassItemForClassNamed:(id)arg1 humanReadableClassItemType:(id)arg2; +- (id)supportedSourceCodeLanguagesForSourceCodeGeneration; +- (long long)defaultPropertyAccessControl; +- (id)emptyPrivateCopy; +- (id)privateCopy; +- (id)diffDataSource; +- (id)textViewWillReturnPrintJobTitle:(id)arg1; +- (id)printOperationWithSettings:(id)arg1 error:(id *)arg2; +- (BOOL)textStorageShouldAllowEditing:(id)arg1; +- (void)textStorageDidUpdateSourceLandmarks:(id)arg1; +- (void)textStorageDidProcessEditing:(id)arg1; +- (void)updateChangeCount:(unsigned long long)arg1; +- (BOOL)replaceTextWithContentsOfURL:(id)arg1 error:(id *)arg2; +- (BOOL)replaceFindResults:(id)arg1 inSelection:(struct _NSRange)arg2 withString:(id)arg3 withError:(id *)arg4; +- (BOOL)replaceFindResults:(id)arg1 withString:(id)arg2 withError:(id *)arg3; +- (BOOL)replaceFindResults:(id)arg1 withString:(id)arg2 inSelection:(struct _NSRange)arg3 withError:(id *)arg4; +- (id)findStringMatchingDescriptor:(id)arg1 backwards:(BOOL)arg2 from:(id)arg3 to:(id)arg4; +- (id)documentLocationFromCharacterRange:(struct _NSRange)arg1; +- (struct _NSRange)characterRangeFromDocumentLocation:(id)arg1; +- (id)updatedLocationFromLocation:(id)arg1 toTimestamp:(double)arg2; +- (void)prefetchNodeTypesExtraLines:(unsigned long long)arg1 upDirection:(BOOL)arg2 withContext:(id)arg3; +- (void)initialPrefetchNodeTypesForLineRange:(struct _NSRange)arg1 withContext:(id)arg2; +- (void)_prefetchNodeTypesForLineRange:(struct _NSRange)arg1 withContext:(id)arg2; +- (long long)nodeTypeForItem:(id)arg1 withContext:(id)arg2; +- (void)_adjustNodeTypeForIdentifierItem:(id)arg1 withContext:(id)arg2; +- (void)editorDocumentWillClose; +- (id)dataOfType:(id)arg1 error:(id *)arg2; +- (BOOL)writeToURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3; +- (BOOL)readFromData:(id)arg1 ofType:(id)arg2 error:(id *)arg3; +- (BOOL)readFromURL:(id)arg1 ofType:(id)arg2 error:(id *)arg3; +- (void)_configureDocumentReadFromURL:(id)arg1 orData:(id)arg2 ofType:(id)arg3 usedEncoding:(unsigned long long)arg4 preferredLineEndings:(unsigned long long)arg5 readOutAttributes:(id)arg6; +- (id)_readOptionsDictionaryForURL:(id)arg1 preferredEncoding:(unsigned long long)arg2 inOutData:(id *)arg3; +- (unsigned long long)_lineEndingUsedInString:(id)arg1; +- (BOOL)canSaveAs; +- (BOOL)canSave; +@property(readonly) DVTPerformanceMetric *openingPerformanceMetric; +- (id)editedContents; +- (id)description; +@property(readonly) NSArray *knownFileReferences; +- (struct _NSRange)lineRangeOfSourceLandmark:(id)arg1; +- (id)sourceLandmarkItemAtLineNumber:(unsigned long long)arg1; +- (id)sourceLandmarkItemAtCharacterIndex:(unsigned long long)arg1; +@property(readonly) NSArray *ideTopLevelStructureObjects; +- (void)invalidateAndDisableDiagnosticController; +- (void)invalidateDiagnosticController; +@property(retain) IDEDiagnosticController *diagnosticController; // @synthesize diagnosticController=_diagnosticController; +- (id)printInfo; +- (void)setTextEncoding:(unsigned long long)arg1 convertContents:(BOOL)arg2; +@property(readonly) DVTFileDataType *fileDataType; +- (id)init; +- (void)setSdefSupport_text:(id)arg1; +- (id)sdefSupport_text; +- (void)setSdefSupport_selection:(id)arg1; +- (id)sdefSupport_selection; +- (void)setSdefSupport_selectedParagraphRange:(id)arg1; +- (id)sdefSupport_selectedParagraphRange; +- (void)setSdefSupport_selectedCharacterRange:(id)arg1; +- (id)sdefSupport_selectedCharacterRange; +- (void)setSdefSupport_notifiesWhenClosing:(BOOL)arg1; +- (BOOL)sdefSupport_notifiesWhenClosing; +- (void)setSdefSupport_contents:(id)arg1; +- (id)sdefSupport_contents; +- (void)setSdefSupport_editorSettings:(id)arg1; +- (id)sdefSupport_editorSettings; +- (id)objectSpecifier; + +// Remaining properties +@property unsigned long long supportedMatchingOptions; + +@end From b3fe714def8c8395b327b181bf665024beedbe52 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 1 Feb 2015 21:03:48 +0000 Subject: [PATCH 32/96] Performance improvements + various other tweaks. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 10 +- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 5 +- SCXcodeMinimap/SCXcodeMinimap.m | 19 --- SCXcodeMinimap/SCXcodeMinimapView.m | 131 ++++++++++++++++-- .../Xcode Headers/DVTFoldingLayoutManager.h | 41 ++++++ .../Xcode Headers/DVTLayoutManager.h | 60 ++++++++ 6 files changed, 233 insertions(+), 33 deletions(-) create mode 100644 SCXcodeMinimap/Xcode Headers/DVTFoldingLayoutManager.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTLayoutManager.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 50be9c9..e48ed3b 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -47,6 +47,8 @@ 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDESourceEditor.ideplugin; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin; sourceTree = ""; }; 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; + 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFoldingLayoutManager.h; sourceTree = ""; }; + 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTLayoutManager.h; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 18FE09B51707639E00118FEB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 18FE09B81707639E00118FEB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -81,8 +83,10 @@ isa = PBXGroup; children = ( 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */, + 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */, 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */, 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */, + 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */, 184C11741A740F8A002A7C65 /* DVTPointerArray.h */, 184C11751A740F8A002A7C65 /* DVTPreferenceSet-Protocol.h */, 184C11761A740F8A002A7C65 /* DVTSourceLanguageSourceModelService.h */, @@ -93,12 +97,12 @@ 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */, 184C117C1A740F8A002A7C65 /* DVTViewController.h */, 184C117D1A740F8A002A7C65 /* IDEEditor.h */, + 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */, + 18FEFA8C1A782D8600DC98C5 /* IDEFileTextSettings.h */, + 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */, 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */, 184C11801A740F8A002A7C65 /* IDEViewController.h */, - 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */, - 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */, - 18FEFA8C1A782D8600DC98C5 /* IDEFileTextSettings.h */, ); path = "Xcode Headers"; sourceTree = ""; diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 676307b..530898e 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -24,12 +24,13 @@ 1 DVTPlugInCompatibilityUUIDs + FEC992CC-CA4A-4CFD-8881-77300FCB848A C4A681B0-4A26-480E-93EC-1218098B9AA0 A2E4D43F-41F4-4FB9-BB94-7177011C9AED + AD68E85B-441B-4301-B564-A45E4919A6AD 63FC1C47-140D-42B0-BB4D-A10B2D225574 37B30044-3B14-46BA-ABAA-F01000C27B63 - AD68E85B-441B-4301-B564-A45E4919A6AD - FEC992CC-CA4A-4CFD-8881-77300FCB848A + 640F884E-CE55-4B40-87C0-8869546CAB7A NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 38aa1a1..0cc20af 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -15,11 +15,7 @@ const CGFloat kDefaultZoomLevel = 0.15f; -static char kAssociatedObjectMinimapViewKey; - static NSString * const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; -static NSString * const IDEEditorDocumentDidChangeNotification = @"IDEEditorDocumentDidChangeNotification"; -static NSString * const IDESourceCodeEditorTextViewBoundsDidChangeNotification = @"IDESourceCodeEditorTextViewBoundsDidChangeNotification"; NSString * const SCXodeMinimapShowNotification = @"SCXodeMinimapShowNotification"; NSString * const SCXodeMinimapHideNotification = @"SCXodeMinimapHideNotification"; @@ -44,7 +40,6 @@ - (id)init [self createMenuItem]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDidFinishSetup:) name:IDESourceCodeEditorDidFinishSetupNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onCodeEditorBoundsChange:) name:IDESourceCodeEditorTextViewBoundsDidChangeNotification object:nil]; } return self; } @@ -101,18 +96,6 @@ - (void)showMiniMap:(NSMenuItem *)sender #pragma mark - Xcode Notification -- (void)onCodeEditorBoundsChange:(NSNotification*)sender -{ - if(![sender.object isKindOfClass:[IDESourceCodeEditor class]]) { - NSLog(@"Could not fetch source code editor container"); - return; - } - - IDESourceCodeEditor *editor = (IDESourceCodeEditor *)[sender object]; - SCXcodeMinimapView *miniMapView = objc_getAssociatedObject(editor.scrollView, &kAssociatedObjectMinimapViewKey); - [miniMapView updateOffset]; -} - - (void)onDidFinishSetup:(NSNotification*)sender { if(![sender.object isKindOfClass:[IDESourceCodeEditor class]]) { @@ -129,8 +112,6 @@ - (void)onDidFinishSetup:(NSNotification*)sender SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editor:editor]; [editor.containerView addSubview:miniMapView]; - objc_setAssociatedObject(editor.scrollView, &kAssociatedObjectMinimapViewKey, miniMapView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); - [miniMapView setVisible:![[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]]; } diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index a2e3cb0..3706f23 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -11,7 +11,10 @@ #import "SCXcodeMinimapSelectionView.h" #import "IDESourceCodeEditor.h" + #import "DVTTextStorage.h" +#import "DVTLayoutManager.h" + #import "DVTPointerArray.h" #import "DVTSourceTextView.h" #import "DVTSourceNodeTypes.h" @@ -25,16 +28,35 @@ static NSString * const kXcodeSyntaxCommentDocKeywordNodeName = @"xcode.syntax.comment.doc.keyword"; static NSString * const kXcodeSyntaxPreprocessorNodeName = @"xcode.syntax.preprocessor"; +static NSString * const IDEEditorDocumentDidChangeNotification = @"IDEEditorDocumentDidChangeNotification"; +static NSString * const IDESourceCodeEditorTextViewBoundsDidChangeNotification = @"IDESourceCodeEditorTextViewBoundsDidChangeNotification"; static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; + +@interface NSObject (SCXcodeMinimapDelayedLayoutManager) + +- (void)sc_performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay cancelPreviousRequest:(BOOL)cancel; + +@end + + +@interface SCXcodeMinimapDelayedLayoutManager : DVTLayoutManager + +@property (nonatomic, strong) NSValue *combinedRangeValue; + +@end + + @interface SCXcodeMinimapView () +@property (nonatomic, strong) IDESourceCodeEditor *editor; @property (nonatomic, strong) NSScrollView *editorScrollView; @property (nonatomic, strong) DVTSourceTextView *editorTextView; @property (nonatomic, strong) NSScrollView *scrollView; @property (nonatomic, strong) DVTSourceTextView *textView; @property (nonatomic, strong) SCXcodeMinimapSelectionView *selectionView; +@property (nonatomic, strong) IDESourceCodeDocument *document; @end @@ -49,12 +71,15 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor { if (self = [super initWithFrame:frame]) { + self.editor = editor; self.editorScrollView = editor.scrollView; self.editorTextView = editor.textView; + [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; + self.scrollView = [[NSScrollView alloc] initWithFrame:self.bounds]; [self.scrollView setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; [self.scrollView setDrawsBackground:NO]; @@ -64,32 +89,45 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor [self addSubview:self.scrollView]; self.textView = [[DVTSourceTextView alloc] initWithFrame:self.editorTextView.bounds]; - [self.textView setTextStorage:editor.textView.textStorage]; + SCXcodeMinimapDelayedLayoutManager *layoutManager = [[SCXcodeMinimapDelayedLayoutManager alloc] init]; + [self.textView.textContainer replaceLayoutManager:layoutManager]; [self.textView setEditable:NO]; [self.textView setSelectable:NO]; + [self.editorTextView.textStorage addLayoutManager:layoutManager]; + [self.scrollView setDocumentView:self.textView]; + [self.scrollView setAllowsMagnification:YES]; + [self.scrollView setMinMagnification:kDefaultZoomLevel]; + [self.scrollView setMagnification:kDefaultZoomLevel]; + + self.selectionView = [[SCXcodeMinimapSelectionView alloc] init]; [self.textView addSubview:_selectionView]; + [self updateTheme]; + + __weak typeof(self) weakSelf = self; [[NSNotificationCenter defaultCenter] addObserverForName:SCXodeMinimapShowNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [self setVisible:YES]; + [weakSelf setVisible:YES]; }]; [[NSNotificationCenter defaultCenter] addObserverForName:SCXodeMinimapHideNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [self setVisible:NO]; + [weakSelf setVisible:NO]; }]; [[NSNotificationCenter defaultCenter] addObserverForName:DVTFontAndColorSourceTextSettingsChangedNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [self updateTheme]; + [weakSelf updateTheme]; }]; - [self.scrollView setAllowsMagnification:YES]; - [self.scrollView setMinMagnification:kDefaultZoomLevel]; - [self.scrollView setMagnification:kDefaultZoomLevel]; + [[NSNotificationCenter defaultCenter] addObserverForName:IDESourceCodeEditorTextViewBoundsDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + if([note.object isEqual:weakSelf.editor]) { + [self updateOffset]; + } + }]; } return self; @@ -111,12 +149,17 @@ - (void)setVisible:(BOOL)visible // Ensure the layout manager's delegate is set to self. The DVTSourceTextView resets it if called to early. [self.textView.layoutManager setDelegate:self]; + [self.textView.layoutManager setAllowsNonContiguousLayout:NO]; } #pragma mark - NSLayoutManagerDelegate - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange { + if(!toScreen || self.hidden) { + return nil; + } + DVTTextStorage *storage = [self.editorTextView textStorage]; short currentNodeId = [storage nodeTypeAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; @@ -151,7 +194,6 @@ - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextC } } - #pragma mark - Navigation - (void)updateOffset @@ -165,7 +207,6 @@ - (void)updateOffset NSRect selectionViewFrame = NSMakeRect(0, 0, self.bounds.size.width * (1 / self.scrollView.magnification), self.editorScrollView.visibleRect.size.height); if(editorContentHeight == 0.0f) { - NSLog(@"editorContentHeight IS %f", editorContentHeight); [self.selectionView setFrame:selectionViewFrame]; return; } @@ -234,3 +275,75 @@ - (void)resizeWithOldSuperviewSize:(NSSize)oldSize } @end + + +@implementation SCXcodeMinimapDelayedLayoutManager + +- (void)delayedAddOperation:(NSOperation *)operation { + [[NSOperationQueue currentQueue] addOperation:operation]; +} + +- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay { + [self performSelector:@selector(delayedAddOperation:) + withObject:[NSBlockOperation blockOperationWithBlock:block] + afterDelay:delay]; +} + +- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay cancelPreviousRequest:(BOOL)cancel { + if (cancel) { + [NSObject cancelPreviousPerformRequestsWithTarget:self]; + } + [self performBlock:block afterDelay:delay]; +} + +- (void)invalidateDisplayForCharacterRange:(NSRange)charRange +{ + if(self.combinedRangeValue) { + self.combinedRangeValue = [NSValue valueWithRange:NSUnionRange(self.combinedRangeValue.rangeValue, charRange)]; + } else { + self.combinedRangeValue = [NSValue valueWithRange:charRange]; + } + + [self performBlock:^{ + + NSRange range = NSIntersectionRange(self.combinedRangeValue.rangeValue, NSMakeRange(0, self.textStorage.length)); + [super invalidateDisplayForCharacterRange:range]; + self.combinedRangeValue = nil; + } afterDelay:0.5f cancelPreviousRequest:YES]; +} + +- (void)_invalidateLayoutForExtendedCharacterRange:(NSRange)charRange isSoft:(BOOL)isSoft +{ + if(isSoft) { + [super _invalidateLayoutForExtendedCharacterRange:charRange isSoft:isSoft]; + } +} + +- (void)textStorage:(id)arg1 edited:(unsigned long long)arg2 range:(struct _NSRange)arg3 changeInLength:(long long)arg4 invalidatedRange:(struct _NSRange)arg5 +{ + +} + +@end + + +@implementation NSObject (SCXcodeMinimapDelayedLayoutManager) + +- (void)sc_performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay { + [self performSelector:@selector(delayedAddOperation:) + withObject:[NSBlockOperation blockOperationWithBlock:block] + afterDelay:delay]; +} + +- (void)sc_performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay cancelPreviousRequest:(BOOL)cancel { + if (cancel) { + [NSObject cancelPreviousPerformRequestsWithTarget:self]; + } + [self sc_performBlock:block afterDelay:delay]; +} + +- (void)sc_delayedAddOperation:(NSOperation *)operation { + [[NSOperationQueue currentQueue] addOperation:operation]; +} + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTFoldingLayoutManager.h b/SCXcodeMinimap/Xcode Headers/DVTFoldingLayoutManager.h new file mode 100644 index 0000000..ade67f7 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTFoldingLayoutManager.h @@ -0,0 +1,41 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import + +@class DVTFoldingManager, DVTTextFoldInlineTokenAttachmentCell, NSCell; + +@interface DVTFoldingLayoutManager : NSLayoutManager +{ + DVTFoldingManager *_foldingManager; + NSCell *_blockFoldCell; + DVTTextFoldInlineTokenAttachmentCell *_inlineFoldCell; +} + ++ (id)layoutLogAspect; +@property(copy) DVTTextFoldInlineTokenAttachmentCell *inlineFoldCell; // @synthesize inlineFoldCell=_inlineFoldCell; +@property(copy) NSCell *blockFoldCell; // @synthesize blockFoldCell=_blockFoldCell; +@property(readonly) DVTFoldingManager *foldingManager; // @synthesize foldingManager=_foldingManager; +- (unsigned long long)characterIndexForPoint:(struct CGPoint)arg1 inTextContainer:(id)arg2 fractionOfDistanceBetweenInsertionPoints:(double *)arg3; +- (id)foldCellAtCharacterIndex:(unsigned long long)arg1; +- (struct CGSize)attachmentSizeForGlyphAtIndex:(unsigned long long)arg1; +- (void)drawGlyphsForGlyphRange:(struct _NSRange)arg1 atPoint:(struct CGPoint)arg2; +- (void)foldingManager:(id)arg1 didUnfoldRange:(struct _NSRange)arg2; +- (void)foldingManager:(id)arg1 didFoldRange:(struct _NSRange)arg2; +- (void)_invalidateGlyphsInCharacterRange:(struct _NSRange)arg1; +- (struct _NSRange)_paragraphExtendedCharacterRange:(struct _NSRange)arg1; +- (void)textStorage:(id)arg1 edited:(unsigned long long)arg2 range:(struct _NSRange)arg3 changeInLength:(long long)arg4 invalidatedRange:(struct _NSRange)arg5; +- (void)_invalidateGlyphsForExtendedCharacterRange:(struct _NSRange)arg1 changeInLength:(long long)arg2 includeBlocks:(BOOL)arg3; +- (struct _NSRange)_extendedCharRangeForInvalidation:(struct _NSRange)arg1 editedCharRange:(struct _NSRange)arg2; +- (void)generateInlineFoldsForCharacterRange:(struct _NSRange)arg1; +- (struct _NSRange)paragraphRangeForLineRange:(struct _NSRange)arg1; +- (struct CGSize)layoutSizeForFoldAtCharacterIndex:(unsigned long long)arg1; +- (BOOL)foldsAreValid:(id)arg1; +- (void)setTextStorage:(id)arg1; +- (void)enableTextFolding:(BOOL)arg1; +- (id)textStorage; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTLayoutManager.h b/SCXcodeMinimap/Xcode Headers/DVTLayoutManager.h new file mode 100644 index 0000000..2af94a7 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTLayoutManager.h @@ -0,0 +1,60 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTFoldingLayoutManager.h" + +@class DVTMapTable, DVTPointerArray, NSArray, NSMutableArray, NSMutableSet, NSSet; + +@interface DVTLayoutManager : DVTFoldingLayoutManager +{ + NSMutableArray *_annotations; + DVTPointerArray *_lastDeletedAnnotations; + DVTMapTable *_messageBubblesForAnnotations; + NSMutableSet *_accessoryAnnotations; + NSArray *_sortedAccessoryAnnotations; +} + ++ (void)initialize; +@property(readonly) NSSet *accessoryAnnotations; // @synthesize accessoryAnnotations=_accessoryAnnotations; +@property(readonly) NSArray *annotations; // @synthesize annotations=_annotations; +- (struct _NSRange)rangeForCharacterRange:(struct _NSRange)arg1 withContextLines:(long long)arg2 proposedHeight:(double *)arg3 contentLines:(unsigned long long *)arg4 totalLines:(unsigned long long *)arg5; +- (void)drawUnderlineForGlyphRange:(struct _NSRange)arg1 underlineType:(long long)arg2 baselineOffset:(double)arg3 lineFragmentRect:(struct CGRect)arg4 lineFragmentGlyphRange:(struct _NSRange)arg5 containerOrigin:(struct CGPoint)arg6; +- (void)drawBackgroundForGlyphRange:(struct _NSRange)arg1 atPoint:(struct CGPoint)arg2; +- (void)fillBackgroundRectArray:(struct CGRect *)arg1 count:(unsigned long long)arg2 forCharacterRange:(struct _NSRange)arg3 color:(id)arg4; +- (void)textStorage:(id)arg1 didUpdateLineRange:(struct _NSRange)arg2 changeInLength:(long long)arg3 replacedCharacterRangeEndsOnLineTerminator:(BOOL)arg4 entireFirstLineReplaced:(BOOL)arg5; +- (void)textStorageDidEndEditing:(id)arg1; +- (void)textStorage:(id)arg1 willReplaceCharactersInRange:(struct _NSRange)arg2 withString:(id)arg3 changeInLength:(long long)arg4; +- (void)foldingManager:(id)arg1 didUnfoldRange:(struct _NSRange)arg2; +- (void)foldingManager:(id)arg1 didFoldRange:(struct _NSRange)arg2; +- (void)didRemoveAnnotations:(id)arg1; +- (void)didInsertAnnotations:(id)arg1; +- (void)hideMessageBubblesInRange:(struct _NSRange)arg1; +- (void)showMessageBubblesInRange:(struct _NSRange)arg1; +@property(getter=isAnnotationAdjustmentEnabled) BOOL annotationAdjustmentEnabled; +@property(nonatomic) BOOL severeBubbleAnnotationsMiniaturized; +- (id)messageBubbleViewForAnnotation:(id)arg1; +- (id)accessoryAnnotationsInRange:(struct _NSRange)arg1; +- (void)messageBubbleAnnotation:(id)arg1 needsBubble:(BOOL)arg2; +- (void)removeAnnotationsInRange:(struct _NSRange)arg1; +- (void)removeAnnotation:(id)arg1; +- (void)_removeAnnotationsAtIndexes:(id)arg1; +- (void)addAnnotation:(id)arg1; +- (id)annotationsInRange:(struct _NSRange)arg1; +- (void)_mergeBubbleViewsAtParagraphIndex:(unsigned long long)arg1; +- (id)_annotationIndexesInParagraphRange:(struct _NSRange)arg1 suggestedIndex:(unsigned long long *)arg2; +- (void)_removeBubbleViewFromAnnotation:(id)arg1; +- (void)_addBubbleViewToAnnotation:(id)arg1 annotationsInRange:(id)arg2; +- (void)_assertAnnotationIntegrity; +- (void)_updateMessageBubbleVisibilityForAnnotation:(id)arg1; +- (void)invalidateDisplayForCharacterRange:(struct _NSRange)arg1; +- (void)_invalidateLayoutForMessageBubblesInCharacterRange:(struct _NSRange)arg1; +- (void)_invalidateLayoutForExtendedCharacterRange:(NSRange)charRange isSoft:(BOOL)isSoft; +- (unsigned long long)layoutOptions; +- (id)initWithCoder:(id)arg1; +- (id)init; +- (void)_layoutManagerCommonInit; + +@end From d73259c23ee5e1bcec75cce7f94328934c18b764 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 8 Feb 2015 21:14:43 +0000 Subject: [PATCH 33/96] Trying out new approach - allow the layout manager to only invalidate the visible editor range - force an invalidation on the visible minimap range afterwards --- SCXcodeMinimap/SCXcodeMinimap.m | 2 +- SCXcodeMinimap/SCXcodeMinimapView.m | 190 ++++++++++++---------------- 2 files changed, 79 insertions(+), 113 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 0cc20af..a0b6f22 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -13,7 +13,7 @@ #import "IDESourceCodeEditor.h" #import "DVTSourceTextView.h" -const CGFloat kDefaultZoomLevel = 0.15f; +const CGFloat kDefaultZoomLevel = 0.1f; static NSString * const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 3706f23..80d1817 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -32,21 +32,6 @@ static NSString * const IDESourceCodeEditorTextViewBoundsDidChangeNotification = @"IDESourceCodeEditorTextViewBoundsDidChangeNotification"; static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; - -@interface NSObject (SCXcodeMinimapDelayedLayoutManager) - -- (void)sc_performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay cancelPreviousRequest:(BOOL)cancel; - -@end - - -@interface SCXcodeMinimapDelayedLayoutManager : DVTLayoutManager - -@property (nonatomic, strong) NSValue *combinedRangeValue; - -@end - - @interface SCXcodeMinimapView () @property (nonatomic, strong) IDESourceCodeEditor *editor; @@ -58,6 +43,11 @@ @interface SCXcodeMinimapView () @property (nonatomic, strong) SCXcodeMinimapSelectionView *selectionView; @property (nonatomic, strong) IDESourceCodeDocument *document; +@property (nonatomic, assign) BOOL shouldAllowFullSyntaxHighlight; + +@property (nonatomic, strong) NSColor *commentColor; +@property (nonatomic, strong) NSColor *preprocessorColor; + @end @implementation SCXcodeMinimapView @@ -89,17 +79,15 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor [self addSubview:self.scrollView]; self.textView = [[DVTSourceTextView alloc] initWithFrame:self.editorTextView.bounds]; - SCXcodeMinimapDelayedLayoutManager *layoutManager = [[SCXcodeMinimapDelayedLayoutManager alloc] init]; - [self.textView.textContainer replaceLayoutManager:layoutManager]; + [self.editorTextView.textStorage addLayoutManager:self.textView.layoutManager]; [self.textView setEditable:NO]; [self.textView setSelectable:NO]; - [self.editorTextView.textStorage addLayoutManager:layoutManager]; - [self.scrollView setDocumentView:self.textView]; [self.scrollView setAllowsMagnification:YES]; [self.scrollView setMinMagnification:kDefaultZoomLevel]; + [self.scrollView setMaxMagnification:kDefaultZoomLevel]; [self.scrollView setMagnification:kDefaultZoomLevel]; @@ -125,7 +113,7 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor [[NSNotificationCenter defaultCenter] addObserverForName:IDESourceCodeEditorTextViewBoundsDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { if([note.object isEqual:weakSelf.editor]) { - [self updateOffset]; + [weakSelf updateOffset]; } }]; } @@ -145,79 +133,99 @@ - (void)setVisible:(BOOL)visible if(visible) { [self updateOffset]; + + [self.textView.layoutManager setDelegate:self]; + } else { + [self.textView.layoutManager setDelegate:nil]; } - - // Ensure the layout manager's delegate is set to self. The DVTSourceTextView resets it if called to early. - [self.textView.layoutManager setDelegate:self]; - [self.textView.layoutManager setAllowsNonContiguousLayout:NO]; } #pragma mark - NSLayoutManagerDelegate -- (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange +- (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager + shouldUseTemporaryAttributes:(NSDictionary *)attrs + forDrawingToScreen:(BOOL)toScreen + atCharacterIndex:(NSUInteger)charIndex + effectiveRange:(NSRangePointer)effectiveCharRange { if(!toScreen || self.hidden) { return nil; } - DVTTextStorage *storage = [self.editorTextView textStorage]; + // Prevent full range invalidation for performance reasons. + if(!self.shouldAllowFullSyntaxHighlight) { + NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; + if(charIndex > visibleEditorRange.location + visibleEditorRange.length ) { + *effectiveCharRange = NSMakeRange(visibleEditorRange.location + visibleEditorRange.length, + layoutManager.textStorage.length - visibleEditorRange.location - visibleEditorRange.length); + + return @{NSForegroundColorAttributeName : [[DVTFontAndColorTheme currentTheme] sourcePlainTextColor]}; + } + + if(charIndex < visibleEditorRange.location) { + *effectiveCharRange = NSMakeRange(0, visibleEditorRange.location); + return @{NSForegroundColorAttributeName : [[DVTFontAndColorTheme currentTheme] sourcePlainTextColor]}; + } + } - short currentNodeId = [storage nodeTypeAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; + // Attempt a full range invalidation after all temporary attributes are set + __weak typeof(self) weakSelf = self; + [self performBlock:^{ + weakSelf.shouldAllowFullSyntaxHighlight = YES; + NSRange visibleMinimapRange = [weakSelf.textView visibleCharacterRange]; + [weakSelf.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; + } afterDelay:0.5f cancelPreviousRequest:YES]; + // Rely on the colorAtCharacterIndex: method to update the effective range + DVTTextStorage *storage = [self.editorTextView textStorage]; NSColor *color = [storage colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; - NSColor *backgroundColor = nil; + // Background color for comments and preprocessor directives + short currentNodeId = [storage nodeTypeAtCharacterIndex:charIndex effectiveRange:NULL context:nil]; if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || - currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) - { - NSColor *color = [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; - backgroundColor = [NSColor colorWithCalibratedRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:kHighlightColorAlphaLevel]; - } else if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) - { - NSColor *color = [[[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType] pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]; - backgroundColor = [NSColor colorWithCalibratedRed:color.redComponent green:color.greenComponent blue:color.blueComponent alpha:kHighlightColorAlphaLevel]; + currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) { + return @{NSForegroundColorAttributeName : [[DVTFontAndColorTheme currentTheme] sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.commentColor}; + } else if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { + return @{NSForegroundColorAttributeName : [[DVTFontAndColorTheme currentTheme] sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.preprocessorColor}; } - if(backgroundColor) { - NSColor *foregroundColor = [[DVTFontAndColorTheme currentTheme] sourceTextBackgroundColor]; - return @{NSForegroundColorAttributeName : foregroundColor, NSBackgroundColorAttributeName : backgroundColor}; - } else { - return @{NSForegroundColorAttributeName : color}; - } + return @{NSForegroundColorAttributeName : color}; } -- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinished +- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag { - if(layoutFinished) { - [self updateOffset]; - } + self.shouldAllowFullSyntaxHighlight = NO; } #pragma mark - Navigation - (void)updateOffset { - if ([self isHidden]) { + if (self.isHidden) { return; } - CGFloat editorContentHeight = [self.editorScrollView.documentView frame].size.height - self.editorScrollView.bounds.size.height; + CGFloat editorTextHeight = CGRectGetHeight([self.editorTextView.layoutManager usedRectForTextContainer:self.editorTextView.textContainer]); + CGFloat minimapTextHeight = CGRectGetHeight([self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer]); + + CGFloat adjustedEditorContentHeight = editorTextHeight - CGRectGetHeight(self.editorScrollView.bounds); + CGFloat adjustedMinimapContentHeight = minimapTextHeight - (CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)); NSRect selectionViewFrame = NSMakeRect(0, 0, self.bounds.size.width * (1 / self.scrollView.magnification), self.editorScrollView.visibleRect.size.height); - if(editorContentHeight == 0.0f) { + if(adjustedEditorContentHeight == 0.0f) { [self.selectionView setFrame:selectionViewFrame]; return; } - CGFloat ratio = (CGRectGetHeight([self.scrollView.documentView frame]) - CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)) / editorContentHeight * (1 / self.scrollView.magnification); - + CGFloat ratio = (adjustedMinimapContentHeight / adjustedEditorContentHeight) * (1 / self.scrollView.magnification); CGPoint offset = NSMakePoint(0, MAX(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification))); + [self.scrollView.documentView scrollPoint:offset]; - CGFloat textHeight = [self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer].size.height; - ratio = (textHeight - self.selectionView.bounds.size.height) / editorContentHeight; + + ratio = (minimapTextHeight - self.selectionView.bounds.size.height) / adjustedEditorContentHeight; selectionViewFrame.origin.y = self.editorScrollView.contentView.bounds.origin.y * ratio; [self.selectionView setFrame:selectionViewFrame]; @@ -245,7 +253,7 @@ - (void)handleMouseEvent:(NSEvent *)theEvent { NSPoint point = [self.textView convertPoint:theEvent.locationInWindow fromView:nil]; NSUInteger characterIndex = [self.textView characterIndexForInsertionAtPoint:point]; - [self.editorTextView scrollRangeToVisible:NSMakeRange(characterIndex, 0)]; + [self.editorTextView scrollRangeToVisible:NSMakeRange(characterIndex, 0) animate:YES]; } #pragma mark - Theme @@ -263,6 +271,20 @@ - (void)updateTheme blue:(1.0f - [backgroundColor blueComponent]) alpha:kHighlightColorAlphaLevel]; + DVTPointerArray *colors = [[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType]; + self.commentColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; + self.commentColor = [NSColor colorWithCalibratedRed:self.commentColor.redComponent + green:self.commentColor.greenComponent + blue:self.commentColor.blueComponent + alpha:kHighlightColorAlphaLevel]; + + + self.preprocessorColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]; + self.preprocessorColor = [NSColor colorWithCalibratedRed:self.commentColor.redComponent + green:self.commentColor.greenComponent + blue:self.commentColor.blueComponent + alpha:kHighlightColorAlphaLevel]; + [self.selectionView setSelectionColor:selectionColor]; } @@ -274,75 +296,19 @@ - (void)resizeWithOldSuperviewSize:(NSSize)oldSize [self updateOffset]; } -@end - - -@implementation SCXcodeMinimapDelayedLayoutManager - -- (void)delayedAddOperation:(NSOperation *)operation { - [[NSOperationQueue currentQueue] addOperation:operation]; -} - -- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay { - [self performSelector:@selector(delayedAddOperation:) - withObject:[NSBlockOperation blockOperationWithBlock:block] - afterDelay:delay]; -} +#pragma mark - Helpers - (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay cancelPreviousRequest:(BOOL)cancel { if (cancel) { [NSObject cancelPreviousPerformRequestsWithTarget:self]; } - [self performBlock:block afterDelay:delay]; -} - -- (void)invalidateDisplayForCharacterRange:(NSRange)charRange -{ - if(self.combinedRangeValue) { - self.combinedRangeValue = [NSValue valueWithRange:NSUnionRange(self.combinedRangeValue.rangeValue, charRange)]; - } else { - self.combinedRangeValue = [NSValue valueWithRange:charRange]; - } - - [self performBlock:^{ - - NSRange range = NSIntersectionRange(self.combinedRangeValue.rangeValue, NSMakeRange(0, self.textStorage.length)); - [super invalidateDisplayForCharacterRange:range]; - self.combinedRangeValue = nil; - } afterDelay:0.5f cancelPreviousRequest:YES]; -} - -- (void)_invalidateLayoutForExtendedCharacterRange:(NSRange)charRange isSoft:(BOOL)isSoft -{ - if(isSoft) { - [super _invalidateLayoutForExtendedCharacterRange:charRange isSoft:isSoft]; - } -} - -- (void)textStorage:(id)arg1 edited:(unsigned long long)arg2 range:(struct _NSRange)arg3 changeInLength:(long long)arg4 invalidatedRange:(struct _NSRange)arg5 -{ -} - -@end - - -@implementation NSObject (SCXcodeMinimapDelayedLayoutManager) - -- (void)sc_performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay { [self performSelector:@selector(delayedAddOperation:) withObject:[NSBlockOperation blockOperationWithBlock:block] afterDelay:delay]; } -- (void)sc_performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay cancelPreviousRequest:(BOOL)cancel { - if (cancel) { - [NSObject cancelPreviousPerformRequestsWithTarget:self]; - } - [self sc_performBlock:block afterDelay:delay]; -} - -- (void)sc_delayedAddOperation:(NSOperation *)operation { +- (void)delayedAddOperation:(NSOperation *)operation { [[NSOperationQueue currentQueue] addOperation:operation]; } From a136f85934a6003611e01f15a0e20836ebba9b8f Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 10 Feb 2015 20:54:57 +0000 Subject: [PATCH 34/96] - performance tweaking - fixed crash on theme change - custom theme support --- SCXcodeMinimap.xcodeproj/project.pbxproj | 20 +++--- SCXcodeMinimap/SCXcodeMinimapView.m | 65 ++++++++++++------- .../Xcode Headers/DVTPreferenceSetManager.h | 50 ++++++++++++++ 3 files changed, 98 insertions(+), 37 deletions(-) create mode 100644 SCXcodeMinimap/Xcode Headers/DVTPreferenceSetManager.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index e48ed3b..83a263b 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -47,6 +47,7 @@ 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDESourceEditor.ideplugin; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin; sourceTree = ""; }; 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; + 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTPreferenceSetManager.h; sourceTree = ""; }; 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFoldingLayoutManager.h; sourceTree = ""; }; 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTLayoutManager.h; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -103,6 +104,7 @@ 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */, 184C11801A740F8A002A7C65 /* IDEViewController.h */, + 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */, ); path = "Xcode Headers"; sourceTree = ""; @@ -127,26 +129,18 @@ 18FE09B41707639E00118FEB /* Frameworks */ = { isa = PBXGroup; children = ( + 18FE09B81707639E00118FEB /* AppKit.framework */, 18FE09B51707639E00118FEB /* Cocoa.framework */, + 18FE09B91707639E00118FEB /* CoreData.framework */, 184C118E1A741136002A7C65 /* DVTFoundation.framework */, 188308091A7411830005DF40 /* DVTKit.framework */, + 18FE09BA1707639E00118FEB /* Foundation.framework */, 1876135E1A77A74300974BE1 /* IDEKit.framework */, 1883080F1A7411A70005DF40 /* IDESourceEditor */, 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */, - 18FE09B71707639E00118FEB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - 18FE09B71707639E00118FEB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( 8742532217307161001C947C /* QuartzCore.framework */, - 18FE09B81707639E00118FEB /* AppKit.framework */, - 18FE09B91707639E00118FEB /* CoreData.framework */, - 18FE09BA1707639E00118FEB /* Foundation.framework */, ); - name = "Other Frameworks"; + name = Frameworks; sourceTree = ""; }; 18FE09BB1707639E00118FEB /* SCXcodeMinimap */ = { @@ -311,6 +305,7 @@ "$(PROJECT_DIR)", "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/OtherFrameworks", ); GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -338,6 +333,7 @@ "$(PROJECT_DIR)", "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/OtherFrameworks", ); GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 80d1817..1dc8a0f 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -18,7 +18,9 @@ #import "DVTPointerArray.h" #import "DVTSourceTextView.h" #import "DVTSourceNodeTypes.h" + #import "DVTFontAndColorTheme.h" +#import "DVTPreferenceSetManager.h" const CGFloat kBackgroundColorShadowLevel = 0.1f; const CGFloat kHighlightColorAlphaLevel = 0.3f; @@ -48,6 +50,8 @@ @interface SCXcodeMinimapView () @property (nonatomic, strong) NSColor *commentColor; @property (nonatomic, strong) NSColor *preprocessorColor; +@property (nonatomic, strong) DVTFontAndColorTheme *theme; + @end @implementation SCXcodeMinimapView @@ -79,7 +83,7 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor [self addSubview:self.scrollView]; self.textView = [[DVTSourceTextView alloc] initWithFrame:self.editorTextView.bounds]; - [self.editorTextView.textStorage addLayoutManager:self.textView.layoutManager]; + [self.textView setTextStorage:self.editorTextView.textStorage]; [self.textView setEditable:NO]; [self.textView setSelectable:NO]; @@ -154,40 +158,47 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager // Prevent full range invalidation for performance reasons. if(!self.shouldAllowFullSyntaxHighlight) { + + // Attempt a full range invalidation after all temporary attributes are set + __weak typeof(self) weakSelf = self; + void(^invalidationBlock)() = ^{ + weakSelf.shouldAllowFullSyntaxHighlight = YES; + NSRange visibleMinimapRange = [weakSelf.textView visibleCharacterRange]; + [weakSelf.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; + }; + NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; if(charIndex > visibleEditorRange.location + visibleEditorRange.length ) { *effectiveCharRange = NSMakeRange(visibleEditorRange.location + visibleEditorRange.length, layoutManager.textStorage.length - visibleEditorRange.location - visibleEditorRange.length); + + [self performBlock:invalidationBlock afterDelay:0.5f cancelPreviousRequest:YES]; - return @{NSForegroundColorAttributeName : [[DVTFontAndColorTheme currentTheme] sourcePlainTextColor]}; + return @{NSForegroundColorAttributeName : [self.theme sourcePlainTextColor]}; } if(charIndex < visibleEditorRange.location) { *effectiveCharRange = NSMakeRange(0, visibleEditorRange.location); - return @{NSForegroundColorAttributeName : [[DVTFontAndColorTheme currentTheme] sourcePlainTextColor]}; + + [self performBlock:invalidationBlock afterDelay:0.5f cancelPreviousRequest:YES]; + + return @{NSForegroundColorAttributeName : [self.theme sourcePlainTextColor]}; } } - // Attempt a full range invalidation after all temporary attributes are set - __weak typeof(self) weakSelf = self; - [self performBlock:^{ - weakSelf.shouldAllowFullSyntaxHighlight = YES; - NSRange visibleMinimapRange = [weakSelf.textView visibleCharacterRange]; - [weakSelf.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; - } afterDelay:0.5f cancelPreviousRequest:YES]; - // Rely on the colorAtCharacterIndex: method to update the effective range DVTTextStorage *storage = [self.editorTextView textStorage]; NSColor *color = [storage colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; - // Background color for comments and preprocessor directives - short currentNodeId = [storage nodeTypeAtCharacterIndex:charIndex effectiveRange:NULL context:nil]; - if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || - currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || - currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) { - return @{NSForegroundColorAttributeName : [[DVTFontAndColorTheme currentTheme] sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.commentColor}; - } else if(currentNodeId == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { - return @{NSForegroundColorAttributeName : [[DVTFontAndColorTheme currentTheme] sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.preprocessorColor}; + // Background color for comments and preprocessor directives. Could query for nodeTypeAtCharacterIndex: but it's too slow. + DVTPointerArray *colors = [[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType]; + if([color isEqual:[colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]] || + [color isEqual:[colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName]]] || + [color isEqual:[colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]]]) + { + return @{NSForegroundColorAttributeName : [self.theme sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.commentColor}; + } else if([color isEqual:[colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]]) { + return @{NSForegroundColorAttributeName : [self.theme sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.preprocessorColor}; } return @{NSForegroundColorAttributeName : color}; @@ -260,8 +271,12 @@ - (void)handleMouseEvent:(NSEvent *)theEvent - (void)updateTheme { - DVTFontAndColorTheme *theme = [DVTFontAndColorTheme currentTheme]; - NSColor *backgroundColor = [theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel]; + //DVTPreferenceSetManager *preferenceSetManager = [DVTFontAndColorTheme preferenceSetsManager]; + //NSArray *preferenceSet = [preferenceSetManager availablePreferenceSets]; + //self.theme = [preferenceSet lastObject]; + self.theme = [DVTFontAndColorTheme currentTheme]; + + NSColor *backgroundColor = [self.theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel]; [self.scrollView setBackgroundColor:backgroundColor]; [self.textView setBackgroundColor:backgroundColor]; @@ -271,7 +286,7 @@ - (void)updateTheme blue:(1.0f - [backgroundColor blueComponent]) alpha:kHighlightColorAlphaLevel]; - DVTPointerArray *colors = [[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType]; + DVTPointerArray *colors = [self.theme syntaxColorsByNodeType]; self.commentColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; self.commentColor = [NSColor colorWithCalibratedRed:self.commentColor.redComponent green:self.commentColor.greenComponent @@ -280,9 +295,9 @@ - (void)updateTheme self.preprocessorColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]; - self.preprocessorColor = [NSColor colorWithCalibratedRed:self.commentColor.redComponent - green:self.commentColor.greenComponent - blue:self.commentColor.blueComponent + self.preprocessorColor = [NSColor colorWithCalibratedRed:self.preprocessorColor.redComponent + green:self.preprocessorColor.greenComponent + blue:self.preprocessorColor.blueComponent alpha:kHighlightColorAlphaLevel]; [self.selectionView setSelectionColor:selectionColor]; diff --git a/SCXcodeMinimap/Xcode Headers/DVTPreferenceSetManager.h b/SCXcodeMinimap/Xcode Headers/DVTPreferenceSetManager.h new file mode 100644 index 0000000..f4fcd48 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTPreferenceSetManager.h @@ -0,0 +1,50 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + + +@class DVTDelayedInvocation, DVTMapTable, NSArray, NSMutableArray, NSMutableSet; + +@interface DVTPreferenceSetManager : NSObject +{ + Class _preferenceSetClass; + NSArray *_builtInPreferenceSets; + NSMutableSet *_specifierNamesInDataStore; + NSMutableArray *_userPreferenceSets; + NSMutableArray *_availablePreferenceSets; + id _currentPreferenceSet; + DVTMapTable *_preferenceSetObserverTokens; + DVTDelayedInvocation *_autosavePreferenceSetsInvocation; +} + ++ (void)initialize; +@property(readonly) Class preferenceSetClass; // @synthesize preferenceSetClass=_preferenceSetClass; +- (id)description; +- (void)_writePreferenceSetsIfNeeded; +- (void)_applicationWillTerminate:(id)arg1; +- (void)_scheduleAutoSavePreferenceSets; +- (void)_removeObserversForPreferenceSet:(id)arg1; +- (void)_addObserversForPreferenceSet:(id)arg1; +- (void)deletePreferenceSet:(id)arg1 completionQueue:(id)arg2 completionBlock:(id)arg3; +- (id)duplicatePreferenceSet:(id)arg1 error:(id *)arg2; +- (void)renamePreferenceSet:(id)arg1 toName:(id)arg2 completionQueue:(id)arg3 completionBlock:(id)arg4; +- (id)editableUserPreferenceSetForPreferenceSet:(id)arg1; +- (id)_createUserPreferenceSetWithBaseName:(id)arg1 basedOn:(id)arg2; +- (id)_nameForDuplicateOfPreferenceSet:(id)arg1; +- (id)_availablePreferenceSetWithLocalizedName:(id)arg1; +- (id)preferenceSetForName:(id)arg1; +@property(readonly) NSArray *builtInPreferenceSets; +@property(retain) id currentPreferenceSet; +- (void)_rebuildAvailableandUserSetsList; +- (void)dealloc; +- (id)initWithPreferenceSetClass:(Class)arg1; + +// Remaining properties +@property(copy) NSArray *availablePreferenceSets; // @dynamic availablePreferenceSets; +@property(readonly) NSMutableArray *mutableAvailablePreferenceSets; // @dynamic mutableAvailablePreferenceSets; +@property(readonly) NSMutableArray *mutableUserPreferenceSets; // @dynamic mutableUserPreferenceSets; +@property(copy) NSArray *userPreferenceSets; // @dynamic userPreferenceSets; + +@end From 31b0d02b0d3b35cf630876613d4b828daa38f794 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 11 Feb 2015 09:49:53 +0000 Subject: [PATCH 35/96] Proper custom theme support . --- SCXcodeMinimap/SCXcodeMinimap.h | 3 + SCXcodeMinimap/SCXcodeMinimap.m | 91 +++++++++++++++---- SCXcodeMinimap/SCXcodeMinimapView.m | 41 ++++++--- .../Xcode Headers/DVTPreferenceSetManager.h | 2 - 4 files changed, 105 insertions(+), 32 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index 99705c1..be641cf 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -13,6 +13,9 @@ const CGFloat kDefaultZoomLevel; extern NSString *const SCXodeMinimapShowNotification; extern NSString *const SCXodeMinimapHideNotification; +extern NSString *const SCXodeMinimapThemeChangeNotification; +extern NSString *const SCXodeMinimapTheme; + @interface SCXcodeMinimap : NSObject @end diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index a0b6f22..511f4c1 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -13,14 +13,20 @@ #import "IDESourceCodeEditor.h" #import "DVTSourceTextView.h" +#import "DVTPreferenceSetManager.h" +#import "DVTFontAndColorTheme.h" + const CGFloat kDefaultZoomLevel = 0.1f; -static NSString * const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; +NSString *const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; + +NSString *const SCXodeMinimapShowNotification = @"SCXodeMinimapShowNotification"; +NSString *const SCXodeMinimapHideNotification = @"SCXodeMinimapHideNotification"; -NSString * const SCXodeMinimapShowNotification = @"SCXodeMinimapShowNotification"; -NSString * const SCXodeMinimapHideNotification = @"SCXodeMinimapHideNotification"; +NSString *const SCXodeMinimapThemeChangeNotification = @"SCXodeMinimapThemeChangeNotification"; -NSString * const SCXodeMinimapIsInitiallyHidden = @"SCXodeMinimapIsInitiallyHidden"; +NSString *const SCXodeMinimapIsInitiallyHidden = @"SCXodeMinimapIsInitiallyHidden"; +NSString *const SCXodeMinimapTheme = @"SCXodeMinimapTheme"; @implementation SCXcodeMinimap @@ -54,24 +60,62 @@ - (void)createMenuItem return; } - NSMenuItem *miniMapItem = [[NSMenuItem alloc] initWithTitle:@"" - action:NULL - keyEquivalent:@"M"]; - [miniMapItem setKeyEquivalentModifierMask:NSControlKeyMask | NSShiftKeyMask]; + [editMenuItem.submenu addItem:[NSMenuItem separatorItem]]; - miniMapItem.target = self; + NSMenuItem *minimapMenuItem = [[NSMenuItem alloc] initWithTitle:@"Minimap" action:nil keyEquivalent:@""]; + [editMenuItem.submenu addItem:minimapMenuItem]; - [editMenuItem.submenu insertItem:[NSMenuItem separatorItem] - atIndex:[editMenuItem.submenu numberOfItems]]; - [editMenuItem.submenu insertItem:miniMapItem - atIndex:[editMenuItem.submenu numberOfItems]]; - - if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { - [self hideMiniMap:miniMapItem]; + NSMenu *minimapMenu = [[NSMenu alloc] init]; + { + NSMenuItem *showHideMinimapItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@"M"]; + [showHideMinimapItem setKeyEquivalentModifierMask:NSControlKeyMask | NSShiftKeyMask]; + [showHideMinimapItem setTarget:self]; + [minimapMenu addItem:showHideMinimapItem]; + + if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { + [self hideMiniMap:showHideMinimapItem]; + } + else { + [self showMiniMap:showHideMinimapItem]; + } + + [minimapMenu addItem:[NSMenuItem separatorItem]]; } - else { - [self showMiniMap:miniMapItem]; + + { + NSMenuItem *themesMenuItem = [[NSMenuItem alloc] initWithTitle:@"Theme" action:nil keyEquivalent:@""]; + [minimapMenu addItem:themesMenuItem]; + + NSMenu *themesMenu = [[NSMenu alloc] init]; + { + NSMenuItem *editorThemeMenuItem = [[NSMenuItem alloc] initWithTitle:@"Editor Theme" action:@selector(setMinimapTheme:) keyEquivalent:@""]; + [editorThemeMenuItem setTarget:self]; + [themesMenu addItem:editorThemeMenuItem]; + + [themesMenu addItem:[NSMenuItem separatorItem]]; + + NSArray *themes = [[DVTFontAndColorTheme preferenceSetsManager] availablePreferenceSets]; + NSArray *builtInThemes = [themes filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF.isBuiltIn == YES"]]; + NSArray *userThemes = [themes filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF.isBuiltIn == NO"]]; + + for(DVTFontAndColorTheme *theme in builtInThemes) { + NSMenuItem *themeMenuItem = [[NSMenuItem alloc] initWithTitle:theme.localizedName action:@selector(setMinimapTheme:) keyEquivalent:@""]; + [themeMenuItem setTarget:self]; + [themesMenu addItem:themeMenuItem]; + } + + [themesMenu addItem:[NSMenuItem separatorItem]]; + + for(DVTFontAndColorTheme *theme in userThemes) { + NSMenuItem *themeMenuItem = [[NSMenuItem alloc] initWithTitle:theme.localizedName action:@selector(setMinimapTheme:) keyEquivalent:@""]; + [themeMenuItem setTarget:self]; + [themesMenu addItem:themeMenuItem]; + } + } + [themesMenuItem setSubmenu:themesMenu]; + } + [minimapMenuItem setSubmenu:minimapMenu]; } - (void)hideMiniMap:(NSMenuItem *)sender @@ -94,6 +138,17 @@ - (void)showMiniMap:(NSMenuItem *)sender [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapShowNotification object:nil]; } +- (void)setMinimapTheme:(NSMenuItem *)sender +{ + if([sender.menu indexOfItem:sender] == 0) { + [[NSUserDefaults standardUserDefaults] removeObjectForKey:SCXodeMinimapTheme]; + } else { + [[NSUserDefaults standardUserDefaults] setObject:sender.title forKey:SCXodeMinimapTheme]; + } + + [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapThemeChangeNotification object:nil]; +} + #pragma mark - Xcode Notification - (void)onDidFinishSetup:(NSNotification*)sender diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 1dc8a0f..7ffd3e1 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -24,6 +24,7 @@ const CGFloat kBackgroundColorShadowLevel = 0.1f; const CGFloat kHighlightColorAlphaLevel = 0.3f; +const CGFloat kDurationBetweenInvalidations = 0.5f; static NSString * const kXcodeSyntaxCommentNodeName = @"xcode.syntax.comment"; static NSString * const kXcodeSyntaxCommentDocNodeName = @"xcode.syntax.comment.doc"; @@ -115,6 +116,10 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor [weakSelf updateTheme]; }]; + [[NSNotificationCenter defaultCenter] addObserverForName:SCXodeMinimapThemeChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf updateTheme]; + }]; + [[NSNotificationCenter defaultCenter] addObserverForName:IDESourceCodeEditorTextViewBoundsDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { if([note.object isEqual:weakSelf.editor]) { [weakSelf updateOffset]; @@ -171,8 +176,8 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager if(charIndex > visibleEditorRange.location + visibleEditorRange.length ) { *effectiveCharRange = NSMakeRange(visibleEditorRange.location + visibleEditorRange.length, layoutManager.textStorage.length - visibleEditorRange.location - visibleEditorRange.length); - - [self performBlock:invalidationBlock afterDelay:0.5f cancelPreviousRequest:YES]; + + [self performBlock:invalidationBlock afterDelay:kDurationBetweenInvalidations cancelPreviousRequest:YES]; return @{NSForegroundColorAttributeName : [self.theme sourcePlainTextColor]}; } @@ -180,7 +185,7 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager if(charIndex < visibleEditorRange.location) { *effectiveCharRange = NSMakeRange(0, visibleEditorRange.location); - [self performBlock:invalidationBlock afterDelay:0.5f cancelPreviousRequest:YES]; + [self performBlock:invalidationBlock afterDelay:kDurationBetweenInvalidations cancelPreviousRequest:YES]; return @{NSForegroundColorAttributeName : [self.theme sourcePlainTextColor]}; } @@ -191,16 +196,19 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager NSColor *color = [storage colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; // Background color for comments and preprocessor directives. Could query for nodeTypeAtCharacterIndex: but it's too slow. - DVTPointerArray *colors = [[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType]; - if([color isEqual:[colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]] || - [color isEqual:[colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName]]] || - [color isEqual:[colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]]]) + DVTPointerArray *editorColors = [[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType]; + if([color isEqual:[editorColors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]] || + [color isEqual:[editorColors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName]]] || + [color isEqual:[editorColors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]]]) { return @{NSForegroundColorAttributeName : [self.theme sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.commentColor}; - } else if([color isEqual:[colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]]) { + } else if([color isEqual:[editorColors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]]) { return @{NSForegroundColorAttributeName : [self.theme sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.preprocessorColor}; } + DVTPointerArray *minimapColors = [self.theme syntaxColorsByNodeType]; + color = [minimapColors pointerAtIndex:[editorColors indexOfPointerIdenticalTo:color]]; + return @{NSForegroundColorAttributeName : color}; } @@ -271,10 +279,19 @@ - (void)handleMouseEvent:(NSEvent *)theEvent - (void)updateTheme { - //DVTPreferenceSetManager *preferenceSetManager = [DVTFontAndColorTheme preferenceSetsManager]; - //NSArray *preferenceSet = [preferenceSetManager availablePreferenceSets]; - //self.theme = [preferenceSet lastObject]; - self.theme = [DVTFontAndColorTheme currentTheme]; + DVTPreferenceSetManager *preferenceSetManager = [DVTFontAndColorTheme preferenceSetsManager]; + NSArray *preferenceSet = [preferenceSetManager availablePreferenceSets]; + + NSString *themeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXodeMinimapTheme]; + NSUInteger themeIndex = [preferenceSet indexesOfObjectsPassingTest:^BOOL(DVTFontAndColorTheme *theme, NSUInteger idx, BOOL *stop) { + return [theme.localizedName isEqualTo:themeName]; + }].lastIndex; + + if(themeIndex == NSNotFound) { + self.theme = [DVTFontAndColorTheme currentTheme]; + } else { + self.theme = preferenceSet[themeIndex]; + } NSColor *backgroundColor = [self.theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel]; diff --git a/SCXcodeMinimap/Xcode Headers/DVTPreferenceSetManager.h b/SCXcodeMinimap/Xcode Headers/DVTPreferenceSetManager.h index f4fcd48..9a89020 100644 --- a/SCXcodeMinimap/Xcode Headers/DVTPreferenceSetManager.h +++ b/SCXcodeMinimap/Xcode Headers/DVTPreferenceSetManager.h @@ -14,7 +14,6 @@ NSMutableSet *_specifierNamesInDataStore; NSMutableArray *_userPreferenceSets; NSMutableArray *_availablePreferenceSets; - id _currentPreferenceSet; DVTMapTable *_preferenceSetObserverTokens; DVTDelayedInvocation *_autosavePreferenceSetsInvocation; } @@ -36,7 +35,6 @@ - (id)_availablePreferenceSetWithLocalizedName:(id)arg1; - (id)preferenceSetForName:(id)arg1; @property(readonly) NSArray *builtInPreferenceSets; -@property(retain) id currentPreferenceSet; - (void)_rebuildAvailableandUserSetsList; - (void)dealloc; - (id)initWithPreferenceSetClass:(Class)arg1; From 973cb10e7ae2711d33677539aef3d1697c1df2a3 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 11 Feb 2015 19:31:29 +0000 Subject: [PATCH 36/96] More performance tweaking. --- SCXcodeMinimap/SCXcodeMinimapView.m | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 7ffd3e1..2dfeb16 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -161,10 +161,10 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager return nil; } - // Prevent full range invalidation for performance reasons. + // Delay invalidation for performance reasons. if(!self.shouldAllowFullSyntaxHighlight) { - // Attempt a full range invalidation after all temporary attributes are set + // Attempt a full range invalidation after __weak typeof(self) weakSelf = self; void(^invalidationBlock)() = ^{ weakSelf.shouldAllowFullSyntaxHighlight = YES; @@ -172,28 +172,13 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager [weakSelf.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; }; - NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; - if(charIndex > visibleEditorRange.location + visibleEditorRange.length ) { - *effectiveCharRange = NSMakeRange(visibleEditorRange.location + visibleEditorRange.length, - layoutManager.textStorage.length - visibleEditorRange.location - visibleEditorRange.length); - - [self performBlock:invalidationBlock afterDelay:kDurationBetweenInvalidations cancelPreviousRequest:YES]; - - return @{NSForegroundColorAttributeName : [self.theme sourcePlainTextColor]}; - } + [self performBlock:invalidationBlock afterDelay:kDurationBetweenInvalidations cancelPreviousRequest:YES]; - if(charIndex < visibleEditorRange.location) { - *effectiveCharRange = NSMakeRange(0, visibleEditorRange.location); - - [self performBlock:invalidationBlock afterDelay:kDurationBetweenInvalidations cancelPreviousRequest:YES]; - - return @{NSForegroundColorAttributeName : [self.theme sourcePlainTextColor]}; - } + return @{NSForegroundColorAttributeName : [self.theme sourcePlainTextColor]}; } // Rely on the colorAtCharacterIndex: method to update the effective range - DVTTextStorage *storage = [self.editorTextView textStorage]; - NSColor *color = [storage colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; + NSColor *color = [(DVTTextStorage *)[self.editorTextView textStorage] colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; // Background color for comments and preprocessor directives. Could query for nodeTypeAtCharacterIndex: but it's too slow. DVTPointerArray *editorColors = [[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType]; From 5faa322f6960282239099b2903e240b88c1c8f39 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 14 Feb 2015 08:59:19 +0000 Subject: [PATCH 37/96] Improved syntax coloring, fixed theme support. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 8 ++- .../xcschemes/SCXcodeMinimap.xcscheme | 72 +++++++++++++++++++ SCXcodeMinimap/SCXcodeMinimapView.m | 54 +++++++------- .../Xcode Headers/DVTFoldingManager.h | 48 +++++++++++++ 4 files changed, 151 insertions(+), 31 deletions(-) create mode 100644 SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme create mode 100644 SCXcodeMinimap/Xcode Headers/DVTFoldingManager.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 83a263b..a2828f4 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ /* Begin PBXFileReference section */ 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTFoldingManager.h; sourceTree = ""; }; 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = DVTCompletingTextView.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFontAndColorTheme.h; sourceTree = ""; }; 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTInvalidation-Protocol.h"; sourceTree = ""; }; @@ -85,11 +86,13 @@ children = ( 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */, 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */, + 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */, 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */, 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */, 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */, 184C11741A740F8A002A7C65 /* DVTPointerArray.h */, 184C11751A740F8A002A7C65 /* DVTPreferenceSet-Protocol.h */, + 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */, 184C11761A740F8A002A7C65 /* DVTSourceLanguageSourceModelService.h */, 184C11771A740F8A002A7C65 /* DVTSourceModel.h */, 184C11781A740F8A002A7C65 /* DVTSourceModelItem.h */, @@ -104,7 +107,6 @@ 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */, 184C11801A740F8A002A7C65 /* IDEViewController.h */, - 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */, ); path = "Xcode Headers"; sourceTree = ""; @@ -148,10 +150,10 @@ children = ( 18FE09C7170764E400118FEB /* SCXcodeMinimap.h */, 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */, - 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, - 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */, 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */, + 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, + 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, 184C11701A740F8A002A7C65 /* Xcode Headers */, ); diff --git a/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme b/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme new file mode 100644 index 0000000..8dde247 --- /dev/null +++ b/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 2dfeb16..494dc8a 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -142,10 +142,7 @@ - (void)setVisible:(BOOL)visible if(visible) { [self updateOffset]; - [self.textView.layoutManager setDelegate:self]; - } else { - [self.textView.layoutManager setDelegate:nil]; } } @@ -161,42 +158,43 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager return nil; } - // Delay invalidation for performance reasons. + // Delay invalidation for performance reasons and attempt a full range invalidation later if(!self.shouldAllowFullSyntaxHighlight) { + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateVisibleMinimapRange) object:nil]; + [self performSelector:@selector(invalidateVisibleMinimapRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; - // Attempt a full range invalidation after - __weak typeof(self) weakSelf = self; - void(^invalidationBlock)() = ^{ - weakSelf.shouldAllowFullSyntaxHighlight = YES; - NSRange visibleMinimapRange = [weakSelf.textView visibleCharacterRange]; - [weakSelf.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; - }; - - [self performBlock:invalidationBlock afterDelay:kDurationBetweenInvalidations cancelPreviousRequest:YES]; - - return @{NSForegroundColorAttributeName : [self.theme sourcePlainTextColor]}; + return @{NSForegroundColorAttributeName : self.theme.sourcePlainTextColor}; } + + // Set background colors for comments and preprocessor directives + short nodeType = [(DVTTextStorage *)[self.textView textStorage] nodeTypeAtCharacterIndex:charIndex + effectiveRange:effectiveCharRange + context:self.editorTextView.syntaxColoringContext]; - // Rely on the colorAtCharacterIndex: method to update the effective range - NSColor *color = [(DVTTextStorage *)[self.editorTextView textStorage] colorAtCharacterIndex:charIndex effectiveRange:effectiveCharRange context:nil]; - - // Background color for comments and preprocessor directives. Could query for nodeTypeAtCharacterIndex: but it's too slow. - DVTPointerArray *editorColors = [[DVTFontAndColorTheme currentTheme] syntaxColorsByNodeType]; - if([color isEqual:[editorColors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]] || - [color isEqual:[editorColors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName]]] || - [color isEqual:[editorColors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]]]) + if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || + nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || + nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) { - return @{NSForegroundColorAttributeName : [self.theme sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.commentColor}; - } else if([color isEqual:[editorColors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]]) { - return @{NSForegroundColorAttributeName : [self.theme sourceTextBackgroundColor], NSBackgroundColorAttributeName : self.preprocessorColor}; + return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : self.commentColor}; + } else if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { + return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : self.preprocessorColor}; } - DVTPointerArray *minimapColors = [self.theme syntaxColorsByNodeType]; - color = [minimapColors pointerAtIndex:[editorColors indexOfPointerIdenticalTo:color]]; + NSColor *color = [self.theme.syntaxColorsByNodeType pointerAtIndex:nodeType]; + if(color == nil) { + color = self.theme.sourcePlainTextColor; + } return @{NSForegroundColorAttributeName : color}; } +- (void)invalidateVisibleMinimapRange +{ + self.shouldAllowFullSyntaxHighlight = YES; + NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; + [self.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; +} + - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag { self.shouldAllowFullSyntaxHighlight = NO; diff --git a/SCXcodeMinimap/Xcode Headers/DVTFoldingManager.h b/SCXcodeMinimap/Xcode Headers/DVTFoldingManager.h new file mode 100644 index 0000000..91e987a --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTFoldingManager.h @@ -0,0 +1,48 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +@class DVTTextFold; +@protocol DVTFoldingManagerDelegate; + +@interface DVTFoldingManager : NSObject +{ + DVTTextFold *_topLevelFold; + id delegate; +} + +@property(retain, nonatomic) DVTTextFold *topLevelFold; // @synthesize topLevelFold=_topLevelFold; +@property __weak id delegate; // @synthesize delegate; +- (id)adjustFoldsForRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; +- (id)foldsEnclosingRange:(struct _NSRange)arg1; +- (id)lastFoldTouchingCharacterIndex:(unsigned long long)arg1; +- (id)firstFoldTouchingCharacterIndex:(unsigned long long)arg1; +- (id)blockFoldsTouchingRange:(struct _NSRange)arg1; +- (id)allFoldsTouchingRange:(struct _NSRange)arg1; +- (BOOL)isRangeInsideAFold:(struct _NSRange)arg1; +- (BOOL)isCharacterRangeFolded:(struct _NSRange)arg1; +- (BOOL)containsFoldWithRange:(struct _NSRange)arg1; +- (BOOL)isCharacterFoldedAtIndex:(unsigned long long)arg1; +- (void)foldRecursiveItem:(id)arg1; +- (void)unfoldItems:(id)arg1; +- (void)foldItems:(id)arg1; +- (void)unfoldRecursiveRange:(struct _NSRange)arg1; +- (void)unfoldEnclosingRange:(struct _NSRange)arg1; +- (void)unfoldRange:(struct _NSRange)arg1; +- (void)unfoldAtCharacterIndex:(unsigned long long)arg1; +- (void)unfoldAll; +- (void)unfoldPlaceholdersInRange:(struct _NSRange)arg1; +- (void)foldPlaceholderInRange:(struct _NSRange)arg1 withLabel:(id)arg2; +- (void)foldRange:(struct _NSRange)arg1; +- (void)_applyFoldsRecursively:(id)arg1; +- (id)initWithRange:(struct _NSRange)arg1; +- (id)init; + +@end + +@protocol DVTFoldingManagerDelegate +- (void)foldingManager:(id)arg1 didUnfoldRange:(struct _NSRange)arg2; +- (void)foldingManager:(id)arg1 didFoldRange:(struct _NSRange)arg2; +@end From 82f8cb26ef01527fcaa5c0e1b52b756dfbc252ff Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 14 Feb 2015 10:39:43 +0000 Subject: [PATCH 38/96] Cleaned up notifications, menu items and user defaults, and exposed more configuration options: - enable/disable comments highlighting - enable/disable preprocessor directives highlighting - enabled/disable main editor vertical scroller (#37) --- SCXcodeMinimap/SCXcodeMinimap.h | 17 ++- SCXcodeMinimap/SCXcodeMinimap.m | 160 ++++++++++++++++++++++------ SCXcodeMinimap/SCXcodeMinimapView.h | 2 - SCXcodeMinimap/SCXcodeMinimapView.m | 51 +++++---- 4 files changed, 175 insertions(+), 55 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index be641cf..edc3caa 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -10,11 +10,20 @@ const CGFloat kDefaultZoomLevel; -extern NSString *const SCXodeMinimapShowNotification; -extern NSString *const SCXodeMinimapHideNotification; +extern NSString *const SCXcodeMinimapShouldDisplayChangeNotification; +extern NSString *const SCXcodeMinimapShouldDisplay; -extern NSString *const SCXodeMinimapThemeChangeNotification; -extern NSString *const SCXodeMinimapTheme; +extern NSString *const SCXcodeMinimapThemeChangeNotification; +extern NSString *const SCXcodeMinimapTheme; + +extern NSString *const SCXcodeMinimapHighlightCommentsChangeNotification; +extern NSString *const SCXcodeMinimapShouldHighlightComments; + +extern NSString *const SCXcodeMinimapHighlightPreprocessorChangeNotification; +extern NSString *const SCXcodeMinimapShouldHighlightPreprocessor; + +extern NSString *const SCXcodeMinimapHideEditorScrollerChangeNotification; +extern NSString *const SCXcodeMinimapShouldHideEditorScroller; @interface SCXcodeMinimap : NSObject diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 511f4c1..6d9077a 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -20,13 +20,33 @@ NSString *const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; -NSString *const SCXodeMinimapShowNotification = @"SCXodeMinimapShowNotification"; -NSString *const SCXodeMinimapHideNotification = @"SCXodeMinimapHideNotification"; +NSString *const SCXcodeMinimapShouldDisplayChangeNotification = @"SCXcodeMinimapShouldDisplayChangeNotification"; +NSString *const SCXcodeMinimapShouldDisplay = @"SCXcodeMinimapShouldDisplay"; -NSString *const SCXodeMinimapThemeChangeNotification = @"SCXodeMinimapThemeChangeNotification"; +NSString *const SCXcodeMinimapThemeChangeNotification = @"SCXcodeMinimapThemeChangeNotification"; +NSString *const SCXcodeMinimapTheme = @"SCXcodeMinimapTheme"; -NSString *const SCXodeMinimapIsInitiallyHidden = @"SCXodeMinimapIsInitiallyHidden"; -NSString *const SCXodeMinimapTheme = @"SCXodeMinimapTheme"; +NSString *const SCXcodeMinimapHighlightCommentsChangeNotification = @"SCXcodeMinimapHighlightCommentsChangeNotification"; +NSString *const SCXcodeMinimapShouldHighlightComments = @"SCXcodeMinimapShouldHighlightComments"; + +NSString *const SCXcodeMinimapHighlightPreprocessorChangeNotification = @"SCXcodeMinimapHighlightPreprocessorChangeNotification"; +NSString *const SCXcodeMinimapShouldHighlightPreprocessor = @"SCXcodeMinimapShouldHighlightPreprocessor"; + +NSString *const SCXcodeMinimapHideEditorScrollerChangeNotification = @"SCXcodeMinimapHideEditorScrollerChangeNotification"; +NSString *const SCXcodeMinimapShouldHideEditorScroller = @"SCXcodeMinimapShouldHideEditorScroller"; + +NSString *const kViewMenuItemTitle = @"View"; + +NSString *const kMinimapMenuItemTitle = @"Minimap"; +NSString *const kShowMinimapMenuItemTitle = @"Show Minimap"; +NSString *const kHideMinimapMenuItemTitle = @"Hide Minimap"; + +NSString *const kHighlightCommentsMenuItemTitle = @"Highlight comments"; +NSString *const kHighlightPreprocessorMenuItemTitle = @"Highlight preprocessor"; +NSString *const kHideEditorScrollerMenuItemTitle = @"Hide editor scroller"; + +NSString *const kThemeMenuItemTitle = @"Theme"; +NSString *const kEditorThemeMenuItemTitle = @"Editor Theme"; @implementation SCXcodeMinimap @@ -43,6 +63,7 @@ - (id)init { if (self = [super init]) { + [self registerUserDefaults]; [self createMenuItem]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDidFinishSetup:) name:IDESourceCodeEditorDidFinishSetupNotification object:nil]; @@ -50,11 +71,20 @@ - (id)init return self; } +- (void)registerUserDefaults +{ + NSDictionary *userDefaults = @{SCXcodeMinimapShouldDisplay : @(YES), + SCXcodeMinimapShouldHighlightComments : @(YES), + SCXcodeMinimapShouldHighlightPreprocessor :@(YES)}; + + [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaults]; +} + #pragma mark - Menu Items and Actions - (void)createMenuItem { - NSMenuItem *editMenuItem = [[NSApp mainMenu] itemWithTitle:@"View"]; + NSMenuItem *editMenuItem = [[NSApp mainMenu] itemWithTitle:kViewMenuItemTitle]; if(editMenuItem == nil) { return; @@ -62,36 +92,69 @@ - (void)createMenuItem [editMenuItem.submenu addItem:[NSMenuItem separatorItem]]; - NSMenuItem *minimapMenuItem = [[NSMenuItem alloc] initWithTitle:@"Minimap" action:nil keyEquivalent:@""]; + NSMenuItem *minimapMenuItem = [[NSMenuItem alloc] initWithTitle:kMinimapMenuItemTitle action:nil keyEquivalent:@""]; [editMenuItem.submenu addItem:minimapMenuItem]; NSMenu *minimapMenu = [[NSMenu alloc] init]; { - NSMenuItem *showHideMinimapItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@"M"]; + NSMenuItem *showHideMinimapItem = [[NSMenuItem alloc] initWithTitle:@"" action:@selector(toggleMinimap:) keyEquivalent:@"M"]; [showHideMinimapItem setKeyEquivalentModifierMask:NSControlKeyMask | NSShiftKeyMask]; [showHideMinimapItem setTarget:self]; [minimapMenu addItem:showHideMinimapItem]; - if ([[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]) { - [self hideMiniMap:showHideMinimapItem]; - } - else { - [self showMiniMap:showHideMinimapItem]; - } + BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplay] boolValue]; + [showHideMinimapItem setTitle:(shouldDisplayMinimap ? kHideMinimapMenuItemTitle : kShowMinimapMenuItemTitle)]; [minimapMenu addItem:[NSMenuItem separatorItem]]; } { - NSMenuItem *themesMenuItem = [[NSMenuItem alloc] initWithTitle:@"Theme" action:nil keyEquivalent:@""]; + NSMenuItem *highlightCommentsMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightCommentsMenuItemTitle + action:@selector(toggleCommentsHighlighting:) keyEquivalent:@""]; + [highlightCommentsMenuItem setTarget:self]; + [minimapMenu addItem:highlightCommentsMenuItem]; + + BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightComments] boolValue]; + [highlightCommentsMenuItem setState:(commentsHighlightingEnabled ? NSOnState : NSOffState)]; + + + NSMenuItem *highlightPreprocessorMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightPreprocessorMenuItemTitle + action:@selector(togglePreprocessorHighlighting:) keyEquivalent:@""]; + [highlightPreprocessorMenuItem setTarget:self]; + [minimapMenu addItem:highlightPreprocessorMenuItem]; + + BOOL preprocessorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessor] boolValue]; + [highlightPreprocessorMenuItem setState:(preprocessorHighlightingEnabled ? NSOnState : NSOffState)]; + + + NSMenuItem *hideEditorScrollerMenuItem = [[NSMenuItem alloc] initWithTitle:kHideEditorScrollerMenuItemTitle + action:@selector(toggleEditorScrollerHiding:) keyEquivalent:@""]; + [hideEditorScrollerMenuItem setTarget:self]; + [minimapMenu addItem:hideEditorScrollerMenuItem]; + + BOOL shouldHideEditorScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScroller] boolValue]; + [hideEditorScrollerMenuItem setState:(shouldHideEditorScroller ? NSOnState : NSOffState)]; + + + [minimapMenu addItem:[NSMenuItem separatorItem]]; + } + + { + NSMenuItem *themesMenuItem = [[NSMenuItem alloc] initWithTitle:kThemeMenuItemTitle action:nil keyEquivalent:@""]; [minimapMenu addItem:themesMenuItem]; NSMenu *themesMenu = [[NSMenu alloc] init]; { - NSMenuItem *editorThemeMenuItem = [[NSMenuItem alloc] initWithTitle:@"Editor Theme" action:@selector(setMinimapTheme:) keyEquivalent:@""]; + NSString *currentThemeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapTheme]; + + NSMenuItem *editorThemeMenuItem = [[NSMenuItem alloc] initWithTitle:kEditorThemeMenuItemTitle action:@selector(setMinimapTheme:) keyEquivalent:@""]; [editorThemeMenuItem setTarget:self]; [themesMenu addItem:editorThemeMenuItem]; + if(currentThemeName == nil) { + [editorThemeMenuItem setState:NSOnState]; + } + [themesMenu addItem:[NSMenuItem separatorItem]]; NSArray *themes = [[DVTFontAndColorTheme preferenceSetsManager] availablePreferenceSets]; @@ -102,6 +165,10 @@ - (void)createMenuItem NSMenuItem *themeMenuItem = [[NSMenuItem alloc] initWithTitle:theme.localizedName action:@selector(setMinimapTheme:) keyEquivalent:@""]; [themeMenuItem setTarget:self]; [themesMenu addItem:themeMenuItem]; + + if([theme.localizedName isEqualToString:currentThemeName]) { + [themeMenuItem setState:NSOnState]; + } } [themesMenu addItem:[NSMenuItem separatorItem]]; @@ -110,6 +177,10 @@ - (void)createMenuItem NSMenuItem *themeMenuItem = [[NSMenuItem alloc] initWithTitle:theme.localizedName action:@selector(setMinimapTheme:) keyEquivalent:@""]; [themeMenuItem setTarget:self]; [themesMenu addItem:themeMenuItem]; + + if([theme.localizedName isEqualToString:currentThemeName]) { + [themeMenuItem setState:NSOnState]; + } } } [themesMenuItem setSubmenu:themesMenu]; @@ -118,35 +189,64 @@ - (void)createMenuItem [minimapMenuItem setSubmenu:minimapMenu]; } -- (void)hideMiniMap:(NSMenuItem *)sender +- (void)toggleMinimap:(NSMenuItem *)sender { - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:SCXodeMinimapIsInitiallyHidden]; + BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplay] boolValue]; - [sender setTitle:@"Show Minimap"]; - [sender setAction:@selector(showMiniMap:)]; + [sender setTitle:(shouldDisplayMinimap ? kHideMinimapMenuItemTitle : kShowMinimapMenuItemTitle)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!shouldDisplayMinimap) forKey:SCXcodeMinimapShouldDisplay]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapShouldDisplayChangeNotification object:nil]; +} + +- (void)toggleCommentsHighlighting:(NSMenuItem *)sender +{ + BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightComments] boolValue]; - [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapHideNotification object:nil]; + [sender setState:(commentsHighlightingEnabled ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!commentsHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightComments]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightCommentsChangeNotification object:nil]; } -- (void)showMiniMap:(NSMenuItem *)sender +- (void)togglePreprocessorHighlighting:(NSMenuItem *)sender { - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:SCXodeMinimapIsInitiallyHidden]; + BOOL preprocessorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessor] boolValue]; - [sender setTitle:@"Hide Minimap"]; - [sender setAction:@selector(hideMiniMap:)]; + [sender setState:(preprocessorHighlightingEnabled ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!preprocessorHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightPreprocessor]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightPreprocessorChangeNotification object:nil]; +} + +- (void)toggleEditorScrollerHiding:(NSMenuItem *)sender +{ + BOOL shouldHideEditorScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScroller] boolValue]; - [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapShowNotification object:nil]; + [sender setState:(shouldHideEditorScroller ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!shouldHideEditorScroller) forKey:SCXcodeMinimapShouldHideEditorScroller]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil]; } - (void)setMinimapTheme:(NSMenuItem *)sender { + NSString *currentThemeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapTheme]; + + if(currentThemeName == sender.title || [currentThemeName isEqualToString:sender.title]) { + return; + } + + NSMenu *themesSubmenu = [[[[NSApp mainMenu] itemWithTitle:kViewMenuItemTitle].submenu itemWithTitle:kMinimapMenuItemTitle].submenu itemWithTitle:kThemeMenuItemTitle].submenu; + for(NSMenuItem *item in themesSubmenu.itemArray) { + [item setState:NSOffState]; + } + + [sender setState:NSOnState]; + if([sender.menu indexOfItem:sender] == 0) { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:SCXodeMinimapTheme]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:SCXcodeMinimapTheme]; } else { - [[NSUserDefaults standardUserDefaults] setObject:sender.title forKey:SCXodeMinimapTheme]; + [[NSUserDefaults standardUserDefaults] setObject:sender.title forKey:SCXcodeMinimapTheme]; } - [[NSNotificationCenter defaultCenter] postNotificationName:SCXodeMinimapThemeChangeNotification object:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapThemeChangeNotification object:nil]; } #pragma mark - Xcode Notification @@ -167,7 +267,7 @@ - (void)onDidFinishSetup:(NSNotification*)sender SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editor:editor]; [editor.containerView addSubview:miniMapView]; - [miniMapView setVisible:![[NSUserDefaults standardUserDefaults] boolForKey:SCXodeMinimapIsInitiallyHidden]]; + [miniMapView setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplay] boolValue]]; } @end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.h b/SCXcodeMinimap/SCXcodeMinimapView.h index eaba1b6..d0cbbe5 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.h +++ b/SCXcodeMinimap/SCXcodeMinimapView.h @@ -14,8 +14,6 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor; -- (void)updateOffset; - - (void)setVisible:(BOOL)visible; @end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 494dc8a..c8b44b6 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -70,11 +70,9 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor self.editorScrollView = editor.scrollView; self.editorTextView = editor.textView; - [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; - self.scrollView = [[NSScrollView alloc] initWithFrame:self.bounds]; [self.scrollView setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; [self.scrollView setDrawsBackground:NO]; @@ -95,28 +93,35 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor [self.scrollView setMaxMagnification:kDefaultZoomLevel]; [self.scrollView setMagnification:kDefaultZoomLevel]; - self.selectionView = [[SCXcodeMinimapSelectionView alloc] init]; [self.textView addSubview:_selectionView]; - [self updateTheme]; + [self.editorScrollView setHasVerticalScroller:![[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScroller] boolValue]]; __weak typeof(self) weakSelf = self; - [[NSNotificationCenter defaultCenter] addObserverForName:SCXodeMinimapShowNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf setVisible:YES]; + [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapShouldDisplayChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplay] boolValue]]; }]; - [[NSNotificationCenter defaultCenter] addObserverForName:SCXodeMinimapHideNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf setVisible:NO]; + [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightCommentsChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf invalidateVisibleMinimapRange]; }]; - [[NSNotificationCenter defaultCenter] addObserverForName:DVTFontAndColorSourceTextSettingsChangedNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf updateTheme]; + [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightPreprocessorChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf invalidateVisibleMinimapRange]; + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf.editorScrollView setHasVerticalScroller:![[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScroller] boolValue]]; }]; - [[NSNotificationCenter defaultCenter] addObserverForName:SCXodeMinimapThemeChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapThemeChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf updateTheme]; + }]; + + [[NSNotificationCenter defaultCenter] addObserverForName:DVTFontAndColorSourceTextSettingsChangedNotification object:nil queue:nil usingBlock:^(NSNotification *note) { [weakSelf updateTheme]; }]; @@ -171,13 +176,21 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager effectiveRange:effectiveCharRange context:self.editorTextView.syntaxColoringContext]; - if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || - nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || - nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) - { - return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : self.commentColor}; - } else if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { - return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : self.preprocessorColor}; + BOOL shouldHighlightComments = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightComments] boolValue]; + if(shouldHighlightComments) { + if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || + nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || + nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) + { + return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : self.commentColor}; + } + } + + BOOL shouldHighlightPreprocessor = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessor] boolValue]; + if(shouldHighlightPreprocessor) { + if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { + return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : self.preprocessorColor}; + } } NSColor *color = [self.theme.syntaxColorsByNodeType pointerAtIndex:nodeType]; @@ -265,7 +278,7 @@ - (void)updateTheme DVTPreferenceSetManager *preferenceSetManager = [DVTFontAndColorTheme preferenceSetsManager]; NSArray *preferenceSet = [preferenceSetManager availablePreferenceSets]; - NSString *themeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXodeMinimapTheme]; + NSString *themeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapTheme]; NSUInteger themeIndex = [preferenceSet indexesOfObjectsPassingTest:^BOOL(DVTFontAndColorTheme *theme, NSUInteger idx, BOOL *stop) { return [theme.localizedName isEqualTo:themeName]; }].lastIndex; From 6e399870133e5ee521ae7750028f643071df540b Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 14 Feb 2015 11:50:46 +0000 Subject: [PATCH 39/96] Added code folding support (#19 #28) --- SCXcodeMinimap/SCXcodeMinimapView.m | 59 +++++++++++++++++++---------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index c8b44b6..51370ad 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -22,6 +22,8 @@ #import "DVTFontAndColorTheme.h" #import "DVTPreferenceSetManager.h" +#import "DVTFoldingManager.h" + const CGFloat kBackgroundColorShadowLevel = 0.1f; const CGFloat kHighlightColorAlphaLevel = 0.3f; const CGFloat kDurationBetweenInvalidations = 0.5f; @@ -35,7 +37,7 @@ static NSString * const IDESourceCodeEditorTextViewBoundsDidChangeNotification = @"IDESourceCodeEditorTextViewBoundsDidChangeNotification"; static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; -@interface SCXcodeMinimapView () +@interface SCXcodeMinimapView () @property (nonatomic, strong) IDESourceCodeEditor *editor; @property (nonatomic, strong) NSScrollView *editorScrollView; @@ -67,8 +69,11 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor if (self = [super initWithFrame:frame]) { self.editor = editor; + self.editorScrollView = editor.scrollView; + self.editorTextView = editor.textView; + [self.editorTextView.foldingManager setDelegate:self]; [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; @@ -106,11 +111,11 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor }]; [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightCommentsChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf invalidateVisibleMinimapRange]; + [weakSelf invalidateDisplayForVisibleMinimapRange]; }]; [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightPreprocessorChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf invalidateVisibleMinimapRange]; + [weakSelf invalidateDisplayForVisibleMinimapRange]; }]; [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -165,8 +170,8 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager // Delay invalidation for performance reasons and attempt a full range invalidation later if(!self.shouldAllowFullSyntaxHighlight) { - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateVisibleMinimapRange) object:nil]; - [self performSelector:@selector(invalidateVisibleMinimapRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleMinimapRange) object:nil]; + [self performSelector:@selector(invalidateDisplayForVisibleMinimapRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; return @{NSForegroundColorAttributeName : self.theme.sourcePlainTextColor}; } @@ -201,16 +206,29 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager return @{NSForegroundColorAttributeName : color}; } -- (void)invalidateVisibleMinimapRange +- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag { - self.shouldAllowFullSyntaxHighlight = YES; - NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; - [self.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; + self.shouldAllowFullSyntaxHighlight = NO; } -- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag +#pragma mark - DVTFoldingManagerDelegate + +- (void)foldingManager:(DVTFoldingManager *)foldingManager didFoldRange:(NSRange)range { - self.shouldAllowFullSyntaxHighlight = NO; + [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didFoldRange:range]; + + [self.textView.foldingManager foldRange:range]; + + [self invalidateLayoutForVisibleMinimapRange]; +} + +- (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRange)range +{ + [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didUnfoldRange:range]; + + [self.textView.foldingManager unfoldRange:range]; + + [self invalidateLayoutForVisibleMinimapRange]; } #pragma mark - Navigation @@ -326,18 +344,17 @@ - (void)resizeWithOldSuperviewSize:(NSSize)oldSize #pragma mark - Helpers -- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay cancelPreviousRequest:(BOOL)cancel { - if (cancel) { - [NSObject cancelPreviousPerformRequestsWithTarget:self]; - } - - [self performSelector:@selector(delayedAddOperation:) - withObject:[NSBlockOperation blockOperationWithBlock:block] - afterDelay:delay]; +- (void)invalidateDisplayForVisibleMinimapRange +{ + self.shouldAllowFullSyntaxHighlight = YES; + NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; + [self.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; } -- (void)delayedAddOperation:(NSOperation *)operation { - [[NSOperationQueue currentQueue] addOperation:operation]; +- (void)invalidateLayoutForVisibleMinimapRange +{ + NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; + [self.textView.layoutManager invalidateLayoutForCharacterRange:visibleMinimapRange actualCharacterRange:nil]; } @end From facb3ad25b4a52b1b4ec648868cb3e75b2e13c05 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 14 Feb 2015 15:25:50 +0000 Subject: [PATCH 40/96] Added breakpoints support. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 20 ++++ .../IDEBreakpointManager+SCXcodeMinimap.h | 25 ++++ .../IDEBreakpointManager+SCXcodeMinimap.m | 80 +++++++++++++ SCXcodeMinimap/SCXcodeMinimap.h | 7 +- SCXcodeMinimap/SCXcodeMinimap.m | 33 +++++- SCXcodeMinimap/SCXcodeMinimapView.m | 108 ++++++++++++++++-- .../Xcode Headers/DVTDocumentLocation.h | 33 ++++++ .../Xcode Headers/DVTTextDocumentLocation.h | 38 ++++++ SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h | 80 +++++++++++++ .../Xcode Headers/IDEBreakpointManager.h | 74 ++++++++++++ .../Xcode Headers/IDEFileBreakpoint.h | 52 +++++++++ 11 files changed, 533 insertions(+), 17 deletions(-) create mode 100644 SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m create mode 100644 SCXcodeMinimap/Xcode Headers/DVTDocumentLocation.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTTextDocumentLocation.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEBreakpointManager.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEFileBreakpoint.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index a2828f4..34c9114 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -14,6 +14,8 @@ 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 188308091A7411830005DF40 /* DVTKit.framework */; }; 1883080C1A7411930005DF40 /* IDESourceEditor.ideplugin in Resources */ = {isa = PBXBuildFile; fileRef = 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */; }; 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 1883080F1A7411A70005DF40 /* IDESourceEditor */; }; + 18D6AD0E1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18D6AD0D1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m */; }; + 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */; }; 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18FE09B51707639E00118FEB /* Cocoa.framework */; }; 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */; }; 8742532317307161001C947C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8742532217307161001C947C /* QuartzCore.framework */; }; @@ -22,6 +24,8 @@ /* Begin PBXFileReference section */ 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTFoldingManager.h; sourceTree = ""; }; + 184407641A8F7B1900C530CF /* DVTTextDocumentLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextDocumentLocation.h; sourceTree = ""; }; + 184407651A8F7B3E00C530CF /* DVTDocumentLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTDocumentLocation.h; sourceTree = ""; }; 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = DVTCompletingTextView.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFontAndColorTheme.h; sourceTree = ""; }; 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTInvalidation-Protocol.h"; sourceTree = ""; }; @@ -45,12 +49,18 @@ 184C118E1A741136002A7C65 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDEEditorDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 1876135E1A77A74300974BE1 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = ../../../../../Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; + 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEFileBreakpoint.h; sourceTree = ""; }; + 187EEF6B1A8F78EC00E4EF39 /* IDEBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpoint.h; sourceTree = ""; }; 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDESourceEditor.ideplugin; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin; sourceTree = ""; }; 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTPreferenceSetManager.h; sourceTree = ""; }; 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFoldingLayoutManager.h; sourceTree = ""; }; 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTLayoutManager.h; sourceTree = ""; }; + 18D6AD0C1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEBreakpointManager+SCXcodeMinimap.h"; sourceTree = ""; }; + 18D6AD0D1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEBreakpointManager+SCXcodeMinimap.m"; sourceTree = ""; }; + 18D6AD0F1A8F72250082CB3F /* IDEBreakpointManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpointManager.h; sourceTree = ""; }; + 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 18FE09B51707639E00118FEB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 18FE09B81707639E00118FEB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -75,6 +85,7 @@ 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */, 1876135F1A77A74300974BE1 /* IDEKit.framework in Frameworks */, 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */, + 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -85,6 +96,7 @@ isa = PBXGroup; children = ( 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */, + 184407651A8F7B3E00C530CF /* DVTDocumentLocation.h */, 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */, 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */, 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */, @@ -98,10 +110,14 @@ 184C11781A740F8A002A7C65 /* DVTSourceModelItem.h */, 184C11791A740F8A002A7C65 /* DVTSourceNodeTypes.h */, 184C117A1A740F8A002A7C65 /* DVTSourceTextView.h */, + 184407641A8F7B1900C530CF /* DVTTextDocumentLocation.h */, 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */, 184C117C1A740F8A002A7C65 /* DVTViewController.h */, + 187EEF6B1A8F78EC00E4EF39 /* IDEBreakpoint.h */, + 18D6AD0F1A8F72250082CB3F /* IDEBreakpointManager.h */, 184C117D1A740F8A002A7C65 /* IDEEditor.h */, 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */, + 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */, 18FEFA8C1A782D8600DC98C5 /* IDEFileTextSettings.h */, 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */, 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, @@ -137,6 +153,7 @@ 184C118E1A741136002A7C65 /* DVTFoundation.framework */, 188308091A7411830005DF40 /* DVTKit.framework */, 18FE09BA1707639E00118FEB /* Foundation.framework */, + 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */, 1876135E1A77A74300974BE1 /* IDEKit.framework */, 1883080F1A7411A70005DF40 /* IDESourceEditor */, 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */, @@ -154,6 +171,8 @@ 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */, 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, + 18D6AD0C1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.h */, + 18D6AD0D1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, 184C11701A740F8A002A7C65 /* Xcode Headers */, ); @@ -233,6 +252,7 @@ files = ( 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */, 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, + 18D6AD0E1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m in Sources */, 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h new file mode 100644 index 0000000..65c8879 --- /dev/null +++ b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h @@ -0,0 +1,25 @@ +// +// IDEBreakpointManager+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 14/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "IDEBreakpointManager.h" + +@protocol IDEBreakpointManagerDelegate; + +@interface IDEBreakpointManager (SCXcodeMinimap) + +@property (nonatomic, weak) id delegate; + +@end + +@protocol IDEBreakpointManagerDelegate + +- (void)breakpointManagerDidAddBreakpoint:(IDEBreakpointManager *)breakpointManager; +- (void)breakpointManagerDidRemoveBreakpoint:(IDEBreakpointManager *)breakpointManager; +- (void)breakpointManagerDidChangeBreakpoint:(IDEBreakpointManager *)breakpointManager; + +@end \ No newline at end of file diff --git a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m new file mode 100644 index 0000000..1034774 --- /dev/null +++ b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m @@ -0,0 +1,80 @@ +// +// IDEBreakpointManager+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 14/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "IDEBreakpointManager+SCXcodeMinimap.h" +#import "IDEFileBreakpoint.h" +#import + +static void *SCXcodeMinimapBreakpointObserverContext = &SCXcodeMinimapBreakpointObserverContext; + +@implementation IDEBreakpointManager (SCXcodeMinimap) + +static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { + Method originalMethod = class_getInstanceMethod(class, originalSelector); + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); + if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { + class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} + ++ (void)load +{ + sc_swizzleInstanceMethod(self, @selector(addBreakpoint:), @selector(sc_addBreakpoint:)); + sc_swizzleInstanceMethod(self, @selector(removeBreakpoint:), @selector(sc_removeBreakpoint:)); +} + +- (void)setDelegate:(id)delegate +{ + objc_setAssociatedObject(self, @selector(delegate), delegate, OBJC_ASSOCIATION_ASSIGN); +} + +- (id)delegate +{ + return objc_getAssociatedObject(self, @selector(delegate)); +} + +- (void)sc_addBreakpoint:(IDEBreakpoint *)breakpoint +{ + [self sc_addBreakpoint:breakpoint]; + + if([breakpoint isKindOfClass:[IDEFileBreakpoint class]]) { + [breakpoint addObserver:self forKeyPath:@"location" options:NSKeyValueObservingOptionNew context:SCXcodeMinimapBreakpointObserverContext]; + [breakpoint addObserver:self forKeyPath:@"shouldBeEnabled" options:NSKeyValueObservingOptionNew context:SCXcodeMinimapBreakpointObserverContext]; + } + + if([self.delegate respondsToSelector:@selector(breakpointManagerDidAddBreakpoint:)]) { + [self.delegate breakpointManagerDidAddBreakpoint:self]; + } +} + +- (void)sc_removeBreakpoint:(IDEBreakpoint *)breakpoint +{ + if([breakpoint isKindOfClass:[IDEFileBreakpoint class]]) { + [breakpoint removeObserver:self forKeyPath:@"location" context:SCXcodeMinimapBreakpointObserverContext]; + [breakpoint removeObserver:self forKeyPath:@"shouldBeEnabled" context:SCXcodeMinimapBreakpointObserverContext]; + } + + [self sc_removeBreakpoint:breakpoint]; + + if([self.delegate respondsToSelector:@selector(breakpointManagerDidRemoveBreakpoint:)]) { + [self.delegate breakpointManagerDidRemoveBreakpoint:self]; + } +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if(context == SCXcodeMinimapBreakpointObserverContext) { + if([self.delegate respondsToSelector:@selector(breakpointManagerDidChangeBreakpoint:)]) { + [self.delegate breakpointManagerDidChangeBreakpoint:self]; + } + } +} + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index edc3caa..71fbd84 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -13,8 +13,8 @@ const CGFloat kDefaultZoomLevel; extern NSString *const SCXcodeMinimapShouldDisplayChangeNotification; extern NSString *const SCXcodeMinimapShouldDisplay; -extern NSString *const SCXcodeMinimapThemeChangeNotification; -extern NSString *const SCXcodeMinimapTheme; +extern NSString *const SCXcodeMinimapHighlightBreakpointsChangeNotification; +extern NSString *const SCXcodeMinimapShouldHighlightBreakpoints; extern NSString *const SCXcodeMinimapHighlightCommentsChangeNotification; extern NSString *const SCXcodeMinimapShouldHighlightComments; @@ -25,6 +25,9 @@ extern NSString *const SCXcodeMinimapShouldHighlightPreprocessor; extern NSString *const SCXcodeMinimapHideEditorScrollerChangeNotification; extern NSString *const SCXcodeMinimapShouldHideEditorScroller; +extern NSString *const SCXcodeMinimapThemeChangeNotification; +extern NSString *const SCXcodeMinimapTheme; + @interface SCXcodeMinimap : NSObject @end diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 6d9077a..ebc213f 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -23,8 +23,8 @@ NSString *const SCXcodeMinimapShouldDisplayChangeNotification = @"SCXcodeMinimapShouldDisplayChangeNotification"; NSString *const SCXcodeMinimapShouldDisplay = @"SCXcodeMinimapShouldDisplay"; -NSString *const SCXcodeMinimapThemeChangeNotification = @"SCXcodeMinimapThemeChangeNotification"; -NSString *const SCXcodeMinimapTheme = @"SCXcodeMinimapTheme"; +NSString *const SCXcodeMinimapHighlightBreakpointsChangeNotification = @"SCXcodeMinimapHighlightBreakpointsChangeNotification"; +NSString *const SCXcodeMinimapShouldHighlightBreakpoints = @"SCXcodeMinimapShouldHighlightBreakpoints"; NSString *const SCXcodeMinimapHighlightCommentsChangeNotification = @"SCXcodeMinimapHighlightCommentsChangeNotification"; NSString *const SCXcodeMinimapShouldHighlightComments = @"SCXcodeMinimapShouldHighlightComments"; @@ -35,12 +35,16 @@ NSString *const SCXcodeMinimapHideEditorScrollerChangeNotification = @"SCXcodeMinimapHideEditorScrollerChangeNotification"; NSString *const SCXcodeMinimapShouldHideEditorScroller = @"SCXcodeMinimapShouldHideEditorScroller"; +NSString *const SCXcodeMinimapThemeChangeNotification = @"SCXcodeMinimapThemeChangeNotification"; +NSString *const SCXcodeMinimapTheme = @"SCXcodeMinimapTheme"; + NSString *const kViewMenuItemTitle = @"View"; NSString *const kMinimapMenuItemTitle = @"Minimap"; NSString *const kShowMinimapMenuItemTitle = @"Show Minimap"; NSString *const kHideMinimapMenuItemTitle = @"Hide Minimap"; +NSString *const kHighlightBreakpointsMenuItemTitle = @"Highlight breakpoints"; NSString *const kHighlightCommentsMenuItemTitle = @"Highlight comments"; NSString *const kHighlightPreprocessorMenuItemTitle = @"Highlight preprocessor"; NSString *const kHideEditorScrollerMenuItemTitle = @"Hide editor scroller"; @@ -73,9 +77,10 @@ - (id)init - (void)registerUserDefaults { - NSDictionary *userDefaults = @{SCXcodeMinimapShouldDisplay : @(YES), - SCXcodeMinimapShouldHighlightComments : @(YES), - SCXcodeMinimapShouldHighlightPreprocessor :@(YES)}; + NSDictionary *userDefaults = @{SCXcodeMinimapShouldDisplay : @(YES), + SCXcodeMinimapShouldHighlightBreakpoints : @(YES), + SCXcodeMinimapShouldHighlightComments : @(YES), + SCXcodeMinimapShouldHighlightPreprocessor : @(YES)}; [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaults]; } @@ -109,6 +114,15 @@ - (void)createMenuItem } { + NSMenuItem *highlightBreakpointsMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightBreakpointsMenuItemTitle + action:@selector(toggleBreakpointHighlighting:) keyEquivalent:@""]; + [highlightBreakpointsMenuItem setTarget:self]; + [minimapMenu addItem:highlightBreakpointsMenuItem]; + + BOOL breakpointHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpoints] boolValue]; + [highlightBreakpointsMenuItem setState:(breakpointHighlightingEnabled ? NSOnState : NSOffState)]; + + NSMenuItem *highlightCommentsMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightCommentsMenuItemTitle action:@selector(toggleCommentsHighlighting:) keyEquivalent:@""]; [highlightCommentsMenuItem setTarget:self]; @@ -198,6 +212,15 @@ - (void)toggleMinimap:(NSMenuItem *)sender [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapShouldDisplayChangeNotification object:nil]; } +- (void)toggleBreakpointHighlighting:(NSMenuItem *)sender +{ + BOOL breakpointHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpoints] boolValue]; + + [sender setState:(breakpointHighlightingEnabled ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!breakpointHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightBreakpoints]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightBreakpointsChangeNotification object:nil]; +} + - (void)toggleCommentsHighlighting:(NSMenuItem *)sender { BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightComments] boolValue]; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 51370ad..b780599 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -11,6 +11,7 @@ #import "SCXcodeMinimapSelectionView.h" #import "IDESourceCodeEditor.h" +#import "IDEEditorDocument.h" #import "DVTTextStorage.h" #import "DVTLayoutManager.h" @@ -23,9 +24,11 @@ #import "DVTPreferenceSetManager.h" #import "DVTFoldingManager.h" +#import "IDEBreakpointManager+SCXcodeMinimap.h" +#import "IDEFileBreakpoint.h" +#import "DVTTextDocumentLocation.h" const CGFloat kBackgroundColorShadowLevel = 0.1f; -const CGFloat kHighlightColorAlphaLevel = 0.3f; const CGFloat kDurationBetweenInvalidations = 0.5f; static NSString * const kXcodeSyntaxCommentNodeName = @"xcode.syntax.comment"; @@ -37,7 +40,10 @@ static NSString * const IDESourceCodeEditorTextViewBoundsDidChangeNotification = @"IDESourceCodeEditorTextViewBoundsDidChangeNotification"; static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; -@interface SCXcodeMinimapView () +static NSString * const kBreakpointRangeKey = @"kBreakpointRangeKey"; +static NSString * const kBreakpointEnabledKey = @"kBreakpointEnabledKey"; + +@interface SCXcodeMinimapView () @property (nonatomic, strong) IDESourceCodeEditor *editor; @property (nonatomic, strong) NSScrollView *editorScrollView; @@ -52,9 +58,13 @@ @interface SCXcodeMinimapView () +{ + NSString *_displayName; + IDEBreakpointBucket *_bucket; + NSMutableSet *_matchedModuleNames; + BOOL _shouldBeEnabled; + int _debuggerState; + unsigned long long _ignoreCount; + unsigned long long _hitCount; + NSString *_condition; + BOOL _continueAfterRunningActions; + NSMutableArray *_actions; + NSMutableArray *_locations; + DVTMapTable *_actionsToSetsOfObservers; + int _breakpointStackSelectionBehavior; + NSString *_customStopReasonString; +} + ++ (id)propertiesAffectingPersistenceState; ++ (void)initialize; +@property(retain) NSString *customStopReasonString; // @synthesize customStopReasonString=_customStopReasonString; +@property int breakpointStackSelectionBehavior; // @synthesize breakpointStackSelectionBehavior=_breakpointStackSelectionBehavior; +@property unsigned long long hitCount; // @synthesize hitCount=_hitCount; +@property BOOL continueAfterRunningActions; // @synthesize continueAfterRunningActions=_continueAfterRunningActions; +@property(copy) NSString *condition; // @synthesize condition=_condition; +@property unsigned long long ignoreCount; // @synthesize ignoreCount=_ignoreCount; +@property int debuggerState; // @synthesize debuggerState=_debuggerState; +@property(nonatomic) BOOL shouldBeEnabled; // @synthesize shouldBeEnabled=_shouldBeEnabled; +@property(retain) IDEBreakpointBucket *bucket; // @synthesize bucket=_bucket; +@property(copy) NSString *displayName; // @synthesize displayName=_displayName; +- (void)primitiveInvalidate; +- (void)addLocations:(id)arg1 fromXMLUnarchiver:(id)arg2; +- (void)addActions:(id)arg1 fromXMLUnarchiver:(id)arg2; +- (id)_actionArchivingProxiesArray; +- (void)dvt_encodeRelationshipsWithXMLArchiver:(id)arg1 version:(id)arg2; +- (void)setBreakpointStackSelectionBehaviorFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2; +- (void)setContinueAfterRunningActionsFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2; +- (void)setShouldBeEnabledFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2; +- (BOOL)_booleanValueFromUTF8String:(char *)arg1; +- (void)dvt_encodeAttributesWithXMLArchiver:(id)arg1 version:(id)arg2; +- (id)initFromXMLUnarchiver:(id)arg1 archiveVersion:(float)arg2; +- (void)_handleActionsChanged:(id)arg1; +- (void)resetActionExpressionResults; +- (void)locationWasRemoved:(id)arg1; +- (void)_updateLocation:(id)arg1 fromLocation:(id)arg2; +- (void)_locationWasResolved:(id)arg1 currentLocations:(id)arg2; +- (unsigned long long)_indexOfSimilarBreakpointLocationMatching:(id)arg1 inLocations:(id)arg2; +- (void)locationWasResolved:(id)arg1; +- (void)setInitialResolvedLocations:(id)arg1; +@property(readonly) BOOL locationsProvideAdditionalInformation; +- (void)toggleShouldBeEnabled; +- (void)_notifyPersistencyStateChanged; +- (void)primitiveSetBucket:(id)arg1; +- (id)description; +- (id)copyWithZone:(struct _NSZone *)arg1; +- (id)init; +- (void)_dvt_commonInit; + +// Remaining properties +@property(copy) NSArray *actions; // @dynamic actions; +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly) NSArray *locations; // @dynamic locations; +@property(copy) NSSet *matchedModuleNames; // @dynamic matchedModuleNames; +@property(readonly) NSMutableArray *mutableActions; // @dynamic mutableActions; +@property(readonly) NSMutableArray *mutableLocations; // @dynamic mutableLocations; +@property(readonly) NSMutableSet *mutableMatchedModuleNames; // @dynamic mutableMatchedModuleNames; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDEBreakpointManager.h b/SCXcodeMinimap/Xcode Headers/IDEBreakpointManager.h new file mode 100644 index 0000000..210c9fc --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEBreakpointManager.h @@ -0,0 +1,74 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTInvalidation-Protocol.h" + +@class DVTMapTable, DVTObservingToken, DVTStackBacktrace, IDEBreakpointBucket, IDEWorkspace, NSArray, NSMutableArray; + +@interface IDEBreakpointManager : NSObject +{ + IDEWorkspace *_workspace; + DVTObservingToken *_workspaceReferencedContainersToken; + DVTObservingToken *_currentDebugSessionStateObserverToken; + DVTMapTable *_bucketsToObserverTokens; + IDEBreakpointBucket *_defaultBucket; + IDEBreakpointBucket *_userWorkspaceBucket; + NSMutableArray *_userProjectBuckets; + IDEBreakpointBucket *_userGlobalBucket; + IDEBreakpointBucket *_watchpointBucket; + IDEBreakpointBucket *_sharedWorkspaceBucket; + NSMutableArray *_sharedProjectBuckets; + DVTMapTable *_userToSharedBuckets; + DVTMapTable *_sharedToUserBuckets; + NSMutableArray *_breakpoints; + BOOL _breakpointsActivated; +} + ++ (BOOL)_isBreakpointAtLocation:(id)arg1 location:(id)arg2; ++ (void)initialize; +@property BOOL breakpointsActivated; // @synthesize breakpointsActivated=_breakpointsActivated; +@property(readonly) IDEBreakpointBucket *sharedWorkspaceBucket; // @synthesize sharedWorkspaceBucket=_sharedWorkspaceBucket; +@property(readonly) IDEBreakpointBucket *userGlobalBucket; // @synthesize userGlobalBucket=_userGlobalBucket; +@property(readonly) IDEBreakpointBucket *userWorkspaceBucket; // @synthesize userWorkspaceBucket=_userWorkspaceBucket; +@property(retain, nonatomic) IDEBreakpointBucket *defaultBucket; // @synthesize defaultBucket=_defaultBucket; +@property(readonly) IDEWorkspace *workspace; // @synthesize workspace=_workspace; +- (void)primitiveInvalidate; +- (void)_handleBreakpointsChanged:(id)arg1; +- (void)_addListenerToBucketsBreakpointList:(id)arg1; +- (void)_removeListenerFromBucketsBreakpointList:(id)arg1; +- (BOOL)_canSetBreakpointAtURL:(id)arg1; +- (void)setBreakpointShared:(id)arg1 shared:(BOOL)arg2; +- (id)fileBreakpointAtDocumentLocation:(id)arg1; +- (id)pathOfModulesMatchingFileBreakpoint:(id)arg1; +- (void)removeWatchpoint:(id)arg1; +- (void)removeBreakpoint:(id)arg1; +- (BOOL)_managesBucket:(id)arg1; +- (void)_addBreakpoint:(id)arg1 toBucket:(id)arg2; +- (void)addWatchpoint:(id)arg1; +- (void)addBreakpoint:(id)arg1; +- (id)createWatchpoint:(id)arg1 variableName:(id)arg2; +- (id)_createAddressBreakpointFrom:(id)arg1 usingLineOfDisassembly:(id)arg2; +- (id)createAddressBreakpoint:(id)arg1; +- (id)createFileBreakpointAtDocumentLocation:(id)arg1; +- (id)createBreakpointAtDocumentLocation:(id)arg1 usingStringAtLine:(id)arg2; +- (void)_handleWorkspaceContainerRemoved:(id)arg1; +- (void)_handleWorkspaceContainerInserted:(id)arg1; +- (void)_handleWorkspaceContainersChanges:(id)arg1; +- (void)_handleCurrentDebugSessionStateChanged:(id)arg1; +- (id)initWithWorkspace:(id)arg1 error:(id *)arg2; + +// Remaining properties +@property(copy) NSArray *breakpoints; // @dynamic breakpoints; +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly) NSMutableArray *mutableBreakpoints; // @dynamic mutableBreakpoints; +@property(readonly) NSMutableArray *mutableSharedProjectBuckets; // @dynamic mutableSharedProjectBuckets; +@property(readonly) NSMutableArray *mutableUserProjectBuckets; // @dynamic mutableUserProjectBuckets; +@property(retain) NSArray *sharedProjectBuckets; // @dynamic sharedProjectBuckets; +@property(retain) NSArray *userProjectBuckets; // @dynamic userProjectBuckets; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDEFileBreakpoint.h b/SCXcodeMinimap/Xcode Headers/IDEFileBreakpoint.h new file mode 100644 index 0000000..d7b73f6 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEFileBreakpoint.h @@ -0,0 +1,52 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "IDEBreakpoint.h" + +@class DVTObservingToken, DVTTextDocumentLocation, NSString, NSURL; + +@interface IDEFileBreakpoint : IDEBreakpoint +{ + NSURL *_documentURL; + DVTTextDocumentLocation *_location; + NSString *_filePath; + NSString *_timestampString; + long long _startingColumnNumber; + long long _endingColumnNumber; + long long _startingLineNumber; + long long _endingLineNumber; + NSString *_characterRangeString; + NSString *_landmarkName; + unsigned long long _landmarkType; + DVTObservingToken *_fileReferenceToken; + DVTObservingToken *_workspaceToken; +} + ++(id)keyPathsForValuesAffectingDisplayName; ++ (BOOL)automaticallyNotifiesObserversOfLocation; ++ (id)propertiesAffectingPersistenceState; +@property unsigned long long landmarkType; // @synthesize landmarkType=_landmarkType; +@property(copy) NSString *landmarkName; // @synthesize landmarkName=_landmarkName; +@property(copy, nonatomic) DVTTextDocumentLocation *location; // @synthesize location=_location; +@property(readonly) NSURL *documentURL; // @synthesize documentURL=_documentURL; +- (id)ideModelObjectTypeIdentifier; +- (id)zeroBasedLocation; +- (void)dvt_encodeRelationshipsWithXMLArchiver:(id)arg1 version:(id)arg2; +- (void)dvt_encodeAttributesWithXMLArchiver:(id)arg1 version:(id)arg2; +- (void)_updateFilePath; +- (id)initFromXMLUnarchiver:(id)arg1 archiveVersion:(float)arg2; +- (void)dvt_awakeFromXMLUnarchiver:(id)arg1; +- (id)description; +- (void)setLocationFromZeroBasedLocation:(id)arg1; +- (id)copyWithZone:(struct _NSZone *)arg1; +- (id)displayName; +- (void)baseSetLocation:(id)arg1; +- (void)_watchNewURL:(id)arg1; +- (void)_watchFileRefs:(id)arg1; +- (void)primitiveInvalidate; +- (id)initWithDocumentTextLocation:(id)arg1; + +@end From 1606fcc85af5ce3cb7f31f23507d4d7d828ec28d Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 15 Feb 2015 10:59:32 +0000 Subject: [PATCH 41/96] Renamed user defaults keys and added support for main editor highlighting. --- SCXcodeMinimap/SCXcodeMinimap.h | 15 +-- SCXcodeMinimap/SCXcodeMinimap.m | 82 +++++++++------ SCXcodeMinimap/SCXcodeMinimapView.m | 156 +++++++++++++++++++--------- 3 files changed, 168 insertions(+), 85 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index 71fbd84..3e4c817 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -11,22 +11,25 @@ const CGFloat kDefaultZoomLevel; extern NSString *const SCXcodeMinimapShouldDisplayChangeNotification; -extern NSString *const SCXcodeMinimapShouldDisplay; +extern NSString *const SCXcodeMinimapShouldDisplayKey; extern NSString *const SCXcodeMinimapHighlightBreakpointsChangeNotification; -extern NSString *const SCXcodeMinimapShouldHighlightBreakpoints; +extern NSString *const SCXcodeMinimapShouldHighlightBreakpointsKey; extern NSString *const SCXcodeMinimapHighlightCommentsChangeNotification; -extern NSString *const SCXcodeMinimapShouldHighlightComments; +extern NSString *const SCXcodeMinimapShouldHighlightCommentsKey; extern NSString *const SCXcodeMinimapHighlightPreprocessorChangeNotification; -extern NSString *const SCXcodeMinimapShouldHighlightPreprocessor; +extern NSString *const SCXcodeMinimapShouldHighlightPreprocessorKey; + +extern NSString *const SCXcodeMinimapHighlightEditorChangeNotification; +extern NSString *const SCXcodeMinimapShouldHighlightEditorKey; extern NSString *const SCXcodeMinimapHideEditorScrollerChangeNotification; -extern NSString *const SCXcodeMinimapShouldHideEditorScroller; +extern NSString *const SCXcodeMinimapShouldHideEditorScrollerKey; extern NSString *const SCXcodeMinimapThemeChangeNotification; -extern NSString *const SCXcodeMinimapTheme; +extern NSString *const SCXcodeMinimapThemeKey; @interface SCXcodeMinimap : NSObject diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index ebc213f..358ad5b 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -21,22 +21,25 @@ NSString *const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; NSString *const SCXcodeMinimapShouldDisplayChangeNotification = @"SCXcodeMinimapShouldDisplayChangeNotification"; -NSString *const SCXcodeMinimapShouldDisplay = @"SCXcodeMinimapShouldDisplay"; +NSString *const SCXcodeMinimapShouldDisplayKey = @"SCXcodeMinimapShouldDisplayKey"; NSString *const SCXcodeMinimapHighlightBreakpointsChangeNotification = @"SCXcodeMinimapHighlightBreakpointsChangeNotification"; -NSString *const SCXcodeMinimapShouldHighlightBreakpoints = @"SCXcodeMinimapShouldHighlightBreakpoints"; +NSString *const SCXcodeMinimapShouldHighlightBreakpointsKey = @"SCXcodeMinimapShouldHighlightBreakpointsKey"; NSString *const SCXcodeMinimapHighlightCommentsChangeNotification = @"SCXcodeMinimapHighlightCommentsChangeNotification"; -NSString *const SCXcodeMinimapShouldHighlightComments = @"SCXcodeMinimapShouldHighlightComments"; +NSString *const SCXcodeMinimapShouldHighlightCommentsKey = @"SCXcodeMinimapShouldHighlightCommentsKey"; NSString *const SCXcodeMinimapHighlightPreprocessorChangeNotification = @"SCXcodeMinimapHighlightPreprocessorChangeNotification"; -NSString *const SCXcodeMinimapShouldHighlightPreprocessor = @"SCXcodeMinimapShouldHighlightPreprocessor"; +NSString *const SCXcodeMinimapShouldHighlightPreprocessorKey = @"SCXcodeMinimapShouldHighlightPreprocessorKey"; + +NSString *const SCXcodeMinimapHighlightEditorChangeNotification = @"SCXcodeMinimapHighlightEditorChangeNotification"; +NSString *const SCXcodeMinimapShouldHighlightEditorKey = @"SCXcodeMinimapShouldHighlightEditorKey"; NSString *const SCXcodeMinimapHideEditorScrollerChangeNotification = @"SCXcodeMinimapHideEditorScrollerChangeNotification"; -NSString *const SCXcodeMinimapShouldHideEditorScroller = @"SCXcodeMinimapShouldHideEditorScroller"; +NSString *const SCXcodeMinimapShouldHideEditorScrollerKey = @"SCXcodeMinimapShouldHideEditorScrollerKey"; NSString *const SCXcodeMinimapThemeChangeNotification = @"SCXcodeMinimapThemeChangeNotification"; -NSString *const SCXcodeMinimapTheme = @"SCXcodeMinimapTheme"; +NSString *const SCXcodeMinimapThemeKey = @"SCXcodeMinimapThemeKey"; NSString *const kViewMenuItemTitle = @"View"; @@ -47,6 +50,7 @@ NSString *const kHighlightBreakpointsMenuItemTitle = @"Highlight breakpoints"; NSString *const kHighlightCommentsMenuItemTitle = @"Highlight comments"; NSString *const kHighlightPreprocessorMenuItemTitle = @"Highlight preprocessor"; +NSString *const kHighlightEditorMenuItemTitle = @"Highlight main editor"; NSString *const kHideEditorScrollerMenuItemTitle = @"Hide editor scroller"; NSString *const kThemeMenuItemTitle = @"Theme"; @@ -77,10 +81,10 @@ - (id)init - (void)registerUserDefaults { - NSDictionary *userDefaults = @{SCXcodeMinimapShouldDisplay : @(YES), - SCXcodeMinimapShouldHighlightBreakpoints : @(YES), - SCXcodeMinimapShouldHighlightComments : @(YES), - SCXcodeMinimapShouldHighlightPreprocessor : @(YES)}; + NSDictionary *userDefaults = @{SCXcodeMinimapShouldDisplayKey : @(YES), + SCXcodeMinimapShouldHighlightBreakpointsKey : @(YES), + SCXcodeMinimapShouldHighlightCommentsKey : @(YES), + SCXcodeMinimapShouldHighlightPreprocessorKey : @(YES)}; [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaults]; } @@ -107,7 +111,7 @@ - (void)createMenuItem [showHideMinimapItem setTarget:self]; [minimapMenu addItem:showHideMinimapItem]; - BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplay] boolValue]; + BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]; [showHideMinimapItem setTitle:(shouldDisplayMinimap ? kHideMinimapMenuItemTitle : kShowMinimapMenuItemTitle)]; [minimapMenu addItem:[NSMenuItem separatorItem]]; @@ -119,7 +123,7 @@ - (void)createMenuItem [highlightBreakpointsMenuItem setTarget:self]; [minimapMenu addItem:highlightBreakpointsMenuItem]; - BOOL breakpointHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpoints] boolValue]; + BOOL breakpointHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpointsKey] boolValue]; [highlightBreakpointsMenuItem setState:(breakpointHighlightingEnabled ? NSOnState : NSOffState)]; @@ -128,7 +132,7 @@ - (void)createMenuItem [highlightCommentsMenuItem setTarget:self]; [minimapMenu addItem:highlightCommentsMenuItem]; - BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightComments] boolValue]; + BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightCommentsKey] boolValue]; [highlightCommentsMenuItem setState:(commentsHighlightingEnabled ? NSOnState : NSOffState)]; @@ -137,16 +141,25 @@ - (void)createMenuItem [highlightPreprocessorMenuItem setTarget:self]; [minimapMenu addItem:highlightPreprocessorMenuItem]; - BOOL preprocessorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessor] boolValue]; + BOOL preprocessorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessorKey] boolValue]; [highlightPreprocessorMenuItem setState:(preprocessorHighlightingEnabled ? NSOnState : NSOffState)]; + NSMenuItem *highlightEditorMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightEditorMenuItemTitle + action:@selector(toggleEditorHighlighting:) keyEquivalent:@""]; + [highlightEditorMenuItem setTarget:self]; + [minimapMenu addItem:highlightEditorMenuItem]; + + BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; + [highlightEditorMenuItem setState:(editorHighlightingEnabled ? NSOnState : NSOffState)]; + + NSMenuItem *hideEditorScrollerMenuItem = [[NSMenuItem alloc] initWithTitle:kHideEditorScrollerMenuItemTitle action:@selector(toggleEditorScrollerHiding:) keyEquivalent:@""]; [hideEditorScrollerMenuItem setTarget:self]; [minimapMenu addItem:hideEditorScrollerMenuItem]; - BOOL shouldHideEditorScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScroller] boolValue]; + BOOL shouldHideEditorScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]; [hideEditorScrollerMenuItem setState:(shouldHideEditorScroller ? NSOnState : NSOffState)]; @@ -159,7 +172,7 @@ - (void)createMenuItem NSMenu *themesMenu = [[NSMenu alloc] init]; { - NSString *currentThemeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapTheme]; + NSString *currentThemeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapThemeKey]; NSMenuItem *editorThemeMenuItem = [[NSMenuItem alloc] initWithTitle:kEditorThemeMenuItemTitle action:@selector(setMinimapTheme:) keyEquivalent:@""]; [editorThemeMenuItem setTarget:self]; @@ -205,52 +218,61 @@ - (void)createMenuItem - (void)toggleMinimap:(NSMenuItem *)sender { - BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplay] boolValue]; + BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]; [sender setTitle:(shouldDisplayMinimap ? kHideMinimapMenuItemTitle : kShowMinimapMenuItemTitle)]; - [[NSUserDefaults standardUserDefaults] setObject:@(!shouldDisplayMinimap) forKey:SCXcodeMinimapShouldDisplay]; + [[NSUserDefaults standardUserDefaults] setObject:@(!shouldDisplayMinimap) forKey:SCXcodeMinimapShouldDisplayKey]; [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapShouldDisplayChangeNotification object:nil]; } - (void)toggleBreakpointHighlighting:(NSMenuItem *)sender { - BOOL breakpointHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpoints] boolValue]; + BOOL breakpointHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpointsKey] boolValue]; [sender setState:(breakpointHighlightingEnabled ? NSOffState : NSOnState)]; - [[NSUserDefaults standardUserDefaults] setObject:@(!breakpointHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightBreakpoints]; + [[NSUserDefaults standardUserDefaults] setObject:@(!breakpointHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightBreakpointsKey]; [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightBreakpointsChangeNotification object:nil]; } - (void)toggleCommentsHighlighting:(NSMenuItem *)sender { - BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightComments] boolValue]; + BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightCommentsKey] boolValue]; [sender setState:(commentsHighlightingEnabled ? NSOffState : NSOnState)]; - [[NSUserDefaults standardUserDefaults] setObject:@(!commentsHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightComments]; + [[NSUserDefaults standardUserDefaults] setObject:@(!commentsHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightCommentsKey]; [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightCommentsChangeNotification object:nil]; } - (void)togglePreprocessorHighlighting:(NSMenuItem *)sender { - BOOL preprocessorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessor] boolValue]; + BOOL preprocessorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessorKey] boolValue]; [sender setState:(preprocessorHighlightingEnabled ? NSOffState : NSOnState)]; - [[NSUserDefaults standardUserDefaults] setObject:@(!preprocessorHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightPreprocessor]; + [[NSUserDefaults standardUserDefaults] setObject:@(!preprocessorHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightPreprocessorKey]; [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightPreprocessorChangeNotification object:nil]; } +- (void)toggleEditorHighlighting:(NSMenuItem *)sender +{ + BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; + + [sender setState:(editorHighlightingEnabled ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!editorHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightEditorKey]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightEditorChangeNotification object:nil]; +} + - (void)toggleEditorScrollerHiding:(NSMenuItem *)sender { - BOOL shouldHideEditorScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScroller] boolValue]; + BOOL shouldHideEditorScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]; [sender setState:(shouldHideEditorScroller ? NSOffState : NSOnState)]; - [[NSUserDefaults standardUserDefaults] setObject:@(!shouldHideEditorScroller) forKey:SCXcodeMinimapShouldHideEditorScroller]; + [[NSUserDefaults standardUserDefaults] setObject:@(!shouldHideEditorScroller) forKey:SCXcodeMinimapShouldHideEditorScrollerKey]; [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil]; } - (void)setMinimapTheme:(NSMenuItem *)sender { - NSString *currentThemeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapTheme]; + NSString *currentThemeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapThemeKey]; if(currentThemeName == sender.title || [currentThemeName isEqualToString:sender.title]) { return; @@ -264,9 +286,9 @@ - (void)setMinimapTheme:(NSMenuItem *)sender [sender setState:NSOnState]; if([sender.menu indexOfItem:sender] == 0) { - [[NSUserDefaults standardUserDefaults] removeObjectForKey:SCXcodeMinimapTheme]; + [[NSUserDefaults standardUserDefaults] removeObjectForKey:SCXcodeMinimapThemeKey]; } else { - [[NSUserDefaults standardUserDefaults] setObject:sender.title forKey:SCXcodeMinimapTheme]; + [[NSUserDefaults standardUserDefaults] setObject:sender.title forKey:SCXcodeMinimapThemeKey]; } [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapThemeChangeNotification object:nil]; @@ -290,7 +312,7 @@ - (void)onDidFinishSetup:(NSNotification*)sender SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editor:editor]; [editor.containerView addSubview:miniMapView]; - [miniMapView setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplay] boolValue]]; + [miniMapView setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; } @end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index b780599..562550a 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -43,6 +43,28 @@ static NSString * const kBreakpointRangeKey = @"kBreakpointRangeKey"; static NSString * const kBreakpointEnabledKey = @"kBreakpointEnabledKey"; + +@interface SCXcodeMinimapTheme : NSObject + +@property (nonatomic, strong) NSColor *backgroundColor; +@property (nonatomic, strong) NSColor *selectionColor; + +@property (nonatomic, strong) NSColor *sourcePlainTextColor; +@property (nonatomic, strong) NSColor *sourceTextBackgroundColor; +@property (nonatomic, strong) NSColor *commentBackgroundColor; +@property (nonatomic, strong) NSColor *preprocessorBackgroundColor; +@property (nonatomic, strong) NSColor *enabledBreakpointColor; +@property (nonatomic, strong) NSColor *disabledBreakpointColor; + +@property (nonatomic, strong) DVTFontAndColorTheme *dvtTheme; + +@end + +@implementation SCXcodeMinimapTheme + +@end + + @interface SCXcodeMinimapView () @property (nonatomic, strong) IDESourceCodeEditor *editor; @@ -54,15 +76,10 @@ @interface SCXcodeMinimapView () )weakSelf.editorTextView]; + } + + [weakSelf invalidateDisplayForVisibleEditorRange]; + }]; + [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf.editorScrollView setHasVerticalScroller:![[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScroller] boolValue]]; + [weakSelf.editorScrollView setHasVerticalScroller:![[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]]; }]; [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapThemeChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -175,6 +204,11 @@ - (void)setVisible:(BOOL)visible if(visible) { [self updateOffset]; [self.textView.layoutManager setDelegate:self]; + + BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; + if(editorHighlightingEnabled) { + [self.editorTextView.layoutManager setDelegate:self]; + } } } @@ -190,12 +224,14 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager return nil; } + SCXcodeMinimapTheme *theme = ([layoutManager isEqualTo:self.textView.layoutManager] ? self.minimapTheme : self.editorTheme); + // Delay invalidation for performance reasons and attempt a full range invalidation later - if(!self.shouldAllowFullSyntaxHighlight) { + if(!self.shouldAllowFullSyntaxHighlight && ![layoutManager isEqual:self.editorTextView.layoutManager]) { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleMinimapRange) object:nil]; [self performSelector:@selector(invalidateDisplayForVisibleMinimapRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; - return @{NSForegroundColorAttributeName : self.theme.sourcePlainTextColor}; + return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor}; } // Set background colors for breakpoints @@ -206,8 +242,8 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager if(NSIntersectionRange(range, NSMakeRange(charIndex, 1)).length) { *effectiveCharRange = range; - return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, - NSBackgroundColorAttributeName : (enabled ? self.enabledBreakpointColor : self.disabledBreakpointColor)}; + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, + NSBackgroundColorAttributeName : (enabled ? theme.enabledBreakpointColor : theme.disabledBreakpointColor)}; } } } @@ -217,29 +253,29 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager effectiveRange:effectiveCharRange context:self.editorTextView.syntaxColoringContext]; - BOOL shouldHighlightComments = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightComments] boolValue]; + BOOL shouldHighlightComments = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightCommentsKey] boolValue]; if(shouldHighlightComments) { if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) { - return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : self.commentColor}; + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : theme.commentBackgroundColor}; } } - BOOL shouldHighlightPreprocessor = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessor] boolValue]; + BOOL shouldHighlightPreprocessor = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessorKey] boolValue]; if(shouldHighlightPreprocessor) { if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { - return @{NSForegroundColorAttributeName : self.theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : self.preprocessorColor}; + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : theme.preprocessorBackgroundColor}; } } - NSColor *color = [self.theme.syntaxColorsByNodeType pointerAtIndex:nodeType]; - if(color == nil) { - color = self.theme.sourcePlainTextColor; + NSColor *foregroundColor = [[((DVTFontAndColorTheme *)theme.dvtTheme) syntaxColorsByNodeType] pointerAtIndex:nodeType]; + if(foregroundColor == nil) { + foregroundColor = theme.sourcePlainTextColor; } - return @{NSForegroundColorAttributeName : color}; + return @{NSForegroundColorAttributeName : foregroundColor}; } - (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag @@ -286,7 +322,7 @@ - (void)breakpointManagerDidChangeBreakpoint:(IDEBreakpointManager *)breakpointM - (void)updateBreakpoints { - BOOL shouldHighlightBreakpoints = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpoints] boolValue]; + BOOL shouldHighlightBreakpoints = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpointsKey] boolValue]; if(!shouldHighlightBreakpoints) { self.breakpointDictionaries = nil; return; @@ -379,47 +415,63 @@ - (void)handleMouseEvent:(NSEvent *)theEvent - (void)updateTheme { + self.editorTheme = [self minimapThemeWithTheme:[DVTFontAndColorTheme currentTheme]]; + + DVTPreferenceSetManager *preferenceSetManager = [DVTFontAndColorTheme preferenceSetsManager]; NSArray *preferenceSet = [preferenceSetManager availablePreferenceSets]; - NSString *themeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapTheme]; + NSString *themeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapThemeKey]; NSUInteger themeIndex = [preferenceSet indexesOfObjectsPassingTest:^BOOL(DVTFontAndColorTheme *theme, NSUInteger idx, BOOL *stop) { return [theme.localizedName isEqualTo:themeName]; }].lastIndex; if(themeIndex == NSNotFound) { - self.theme = [DVTFontAndColorTheme currentTheme]; + self.minimapTheme = self.editorTheme; } else { - self.theme = preferenceSet[themeIndex]; + self.minimapTheme = [self minimapThemeWithTheme:preferenceSet[themeIndex]]; } - NSColor *backgroundColor = [self.theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel]; + [self.scrollView setBackgroundColor:self.minimapTheme.backgroundColor]; + [self.textView setBackgroundColor:self.minimapTheme.backgroundColor]; + + [self.selectionView setSelectionColor:self.minimapTheme.selectionColor]; +} + +- (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme +{ + SCXcodeMinimapTheme *minimapTheme = [[SCXcodeMinimapTheme alloc] init]; + + minimapTheme.backgroundColor = [theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel]; + + minimapTheme.selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [minimapTheme.backgroundColor redComponent]) + green:(1.0f - [minimapTheme.backgroundColor greenComponent]) + blue:(1.0f - [minimapTheme.backgroundColor blueComponent]) + alpha:0.2f]; - [self.scrollView setBackgroundColor:backgroundColor]; - [self.textView setBackgroundColor:backgroundColor]; - NSColor *selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [backgroundColor redComponent]) - green:(1.0f - [backgroundColor greenComponent]) - blue:(1.0f - [backgroundColor blueComponent]) - alpha:0.2f]; - [self.selectionView setSelectionColor:selectionColor]; + DVTPointerArray *colors = [theme syntaxColorsByNodeType]; + minimapTheme.commentBackgroundColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; + minimapTheme.commentBackgroundColor = [NSColor colorWithCalibratedRed:minimapTheme.commentBackgroundColor.redComponent + green:minimapTheme.commentBackgroundColor.greenComponent + blue:minimapTheme.commentBackgroundColor.blueComponent + alpha:0.3f]; - DVTPointerArray *colors = [self.theme syntaxColorsByNodeType]; - self.commentColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; - self.commentColor = [NSColor colorWithCalibratedRed:self.commentColor.redComponent - green:self.commentColor.greenComponent - blue:self.commentColor.blueComponent - alpha:0.3f]; + minimapTheme.preprocessorBackgroundColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]; + minimapTheme.preprocessorBackgroundColor = [NSColor colorWithCalibratedRed:minimapTheme.preprocessorBackgroundColor.redComponent + green:minimapTheme.preprocessorBackgroundColor.greenComponent + blue:minimapTheme.preprocessorBackgroundColor.blueComponent + alpha:0.3f]; - self.preprocessorColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]; - self.preprocessorColor = [NSColor colorWithCalibratedRed:self.preprocessorColor.redComponent - green:self.preprocessorColor.greenComponent - blue:self.preprocessorColor.blueComponent - alpha:0.3f]; + minimapTheme.enabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:200.0f/255.0f alpha:1.0f]; + minimapTheme.disabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:200.0f/255.0f alpha:0.5f]; - self.enabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:177.0f/255.0f alpha:1.0f]; - self.disabledBreakpointColor = [NSColor colorWithRed:181.0f/255.0f green:201.0f/255.0f blue:224.0f/255.0f alpha:1.0f]; + minimapTheme.sourcePlainTextColor = theme.sourcePlainTextColor; + minimapTheme.sourceTextBackgroundColor = theme.sourceTextBackgroundColor; + minimapTheme.dvtTheme = theme; + + return minimapTheme; } #pragma mark - Autoresizing @@ -445,4 +497,10 @@ - (void)invalidateLayoutForVisibleMinimapRange [self.textView.layoutManager invalidateLayoutForCharacterRange:visibleMinimapRange actualCharacterRange:nil]; } +- (void)invalidateDisplayForVisibleEditorRange +{ + NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; + [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:visibleEditorRange]; +} + @end From a5b21db8aa36728de6fe7d46c2a31fa7ac95c621 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 17 Feb 2015 10:44:06 +0000 Subject: [PATCH 42/96] Breakpoint KVO fixes. --- .../IDEBreakpointManager+SCXcodeMinimap.h | 12 + .../IDEBreakpointManager+SCXcodeMinimap.m | 210 +++++++++++++++++- SCXcodeMinimap/SCXcodeMinimapView.m | 12 +- 3 files changed, 219 insertions(+), 15 deletions(-) diff --git a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h index 65c8879..5e70147 100644 --- a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h +++ b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h @@ -8,11 +8,23 @@ #import "IDEBreakpointManager.h" +typedef void (^SCKVONotificationBlock)(id object, NSDictionary *change); + +@interface SCKVOController : NSObject + +- (void)observeObject:(id)object forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options block:(SCKVONotificationBlock)block; +- (void)unobserveObject:(id)object forKeyPath:(NSString *)keyPath; +- (void)unobserveObject:(id)object; +- (void)unobserveAll; + +@end + @protocol IDEBreakpointManagerDelegate; @interface IDEBreakpointManager (SCXcodeMinimap) @property (nonatomic, weak) id delegate; +@property (nonatomic, strong) SCKVOController *kvoController; @end diff --git a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m index 1034774..7530254 100644 --- a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m +++ b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m @@ -10,8 +10,6 @@ #import "IDEFileBreakpoint.h" #import -static void *SCXcodeMinimapBreakpointObserverContext = &SCXcodeMinimapBreakpointObserverContext; - @implementation IDEBreakpointManager (SCXcodeMinimap) static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { @@ -26,6 +24,7 @@ static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swiz + (void)load { + sc_swizzleInstanceMethod(self, @selector(_handleWorkspaceContainerRemoved:), @selector(sc_handleWorkspaceContainerRemoved:)); sc_swizzleInstanceMethod(self, @selector(addBreakpoint:), @selector(sc_addBreakpoint:)); sc_swizzleInstanceMethod(self, @selector(removeBreakpoint:), @selector(sc_removeBreakpoint:)); } @@ -40,14 +39,39 @@ - (void)setDelegate:(id)delegate return objc_getAssociatedObject(self, @selector(delegate)); } +- (void)setKvoController:(SCKVOController *)kvoController +{ + objc_setAssociatedObject(self, @selector(kvoController), kvoController, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (SCKVOController *)kvoController +{ + SCKVOController *kvoController = objc_getAssociatedObject(self, @selector(kvoController)); + + if(kvoController == nil) { + kvoController = [[SCKVOController alloc] init]; + [self setKvoController:kvoController]; + + for(IDEBreakpoint *breakpoint in self.breakpoints) { + if([breakpoint isKindOfClass:[IDEFileBreakpoint class]]) { + [self _observeBreakpoint:breakpoint]; + } + } + } + + return kvoController; +} + +- (void)sc_handleWorkspaceContainerRemoved:(id)arg1 +{ + [self.kvoController unobserveAll]; +} + - (void)sc_addBreakpoint:(IDEBreakpoint *)breakpoint { [self sc_addBreakpoint:breakpoint]; - if([breakpoint isKindOfClass:[IDEFileBreakpoint class]]) { - [breakpoint addObserver:self forKeyPath:@"location" options:NSKeyValueObservingOptionNew context:SCXcodeMinimapBreakpointObserverContext]; - [breakpoint addObserver:self forKeyPath:@"shouldBeEnabled" options:NSKeyValueObservingOptionNew context:SCXcodeMinimapBreakpointObserverContext]; - } + [self _observeBreakpoint:breakpoint]; if([self.delegate respondsToSelector:@selector(breakpointManagerDidAddBreakpoint:)]) { [self.delegate breakpointManagerDidAddBreakpoint:self]; @@ -56,10 +80,7 @@ - (void)sc_addBreakpoint:(IDEBreakpoint *)breakpoint - (void)sc_removeBreakpoint:(IDEBreakpoint *)breakpoint { - if([breakpoint isKindOfClass:[IDEFileBreakpoint class]]) { - [breakpoint removeObserver:self forKeyPath:@"location" context:SCXcodeMinimapBreakpointObserverContext]; - [breakpoint removeObserver:self forKeyPath:@"shouldBeEnabled" context:SCXcodeMinimapBreakpointObserverContext]; - } + [self.kvoController unobserveObject:breakpoint]; [self sc_removeBreakpoint:breakpoint]; @@ -68,13 +89,178 @@ - (void)sc_removeBreakpoint:(IDEBreakpoint *)breakpoint } } -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +- (void)_observeBreakpoint:(IDEBreakpoint *)breakpoint { - if(context == SCXcodeMinimapBreakpointObserverContext) { + [self.kvoController observeObject:breakpoint forKeyPath:@"location" options:NSKeyValueObservingOptionNew block:^(id object, NSDictionary *change) { + if([self.delegate respondsToSelector:@selector(breakpointManagerDidChangeBreakpoint:)]) { + [self.delegate breakpointManagerDidChangeBreakpoint:self]; + } + }]; + + [self.kvoController observeObject:breakpoint forKeyPath:@"shouldBeEnabled" options:NSKeyValueObservingOptionNew block:^(id object, NSDictionary *change) { if([self.delegate respondsToSelector:@selector(breakpointManagerDidChangeBreakpoint:)]) { [self.delegate breakpointManagerDidChangeBreakpoint:self]; } + }]; +} + +@end + + +@interface SCKVOKeyPathInfo : NSObject + +@property (nonatomic, strong) NSMutableSet *blocks; + +@end + + +@interface SCKVOInfo : NSObject + +@property (nonatomic, weak) id observer; +@property (nonatomic, strong) NSMutableDictionary *keyPathInfos; + +- (instancetype)initWithObserver:(id)observer; + +@end + + +@interface SCKVOController() + +@property (nonatomic, strong) NSMapTable *mapTable; + +@end + + +@implementation SCKVOController + +- (void)dealloc +{ + [self unobserveAll]; +} + +- (void)observeObject:(id)object forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options block:(SCKVONotificationBlock)block +{ + NSParameterAssert(object); + NSParameterAssert(keyPath); + NSParameterAssert(block); + + SCKVOInfo *info = [self.mapTable objectForKey:object]; + + if (!info) { + info = [[SCKVOInfo alloc] initWithObserver:object]; + [self.mapTable setObject:info forKey:object]; + } + + SCKVOKeyPathInfo *kvoKeyPathInfo = [info.keyPathInfos objectForKey:keyPath]; + + BOOL registerObserver = NO; + + if (!kvoKeyPathInfo) { + kvoKeyPathInfo = [[SCKVOKeyPathInfo alloc] init]; + [info.keyPathInfos setValue:kvoKeyPathInfo forKey:keyPath]; + registerObserver = YES; + } + + [kvoKeyPathInfo.blocks addObject:[block copy]]; + + if (registerObserver) { + [object addObserver:self forKeyPath:keyPath options:options context:NULL]; + } +} + +- (void)unobserveObject:(id)object forKeyPath:(NSString *)keyPath +{ + NSParameterAssert(object); + NSParameterAssert(keyPath); + + SCKVOInfo *info = [self.mapTable objectForKey:object]; + + if (info) { + if (info.keyPathInfos[keyPath]) { + [info.keyPathInfos removeObjectForKey:keyPath]; + [object removeObserver:self forKeyPath:keyPath context:NULL]; + + if (info.keyPathInfos.count == 0) { + [self.mapTable removeObjectForKey:object]; + } + } + } +} + +- (void)unobserveObject:(id)object +{ + NSParameterAssert(object); + + SCKVOInfo *info = [self.mapTable objectForKey:object]; + if (info) { + for (NSString *keyPath in [info.keyPathInfos allKeys]) { + [self unobserveObject:object forKeyPath:keyPath]; + } + } +} + +- (void)unobserveAll +{ + NSMapTable *mapTable = [self.mapTable copy]; + + for (id object in mapTable) { + [self unobserveObject:object]; + } +} + +- (NSMapTable *)mapTable +{ + if (!_mapTable) { + _mapTable = [NSMapTable mapTableWithKeyOptions:NSPointerFunctionsWeakMemory|NSPointerFunctionsObjectPointerPersonality valueOptions:NSPointerFunctionsStrongMemory|NSPointerFunctionsObjectPersonality]; + } + + return _mapTable; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(NSDictionary *)change + context:(void *)context +{ + SCKVOInfo *info = [self.mapTable objectForKey:object]; + + if (info) { + SCKVOKeyPathInfo *kvoKeyPathInfo = [info.keyPathInfos objectForKey:keyPath]; + + if (kvoKeyPathInfo) { + for (SCKVONotificationBlock block in kvoKeyPathInfo.blocks) { + block(object, change); + } + } + } +} + +@end + + +@implementation SCKVOKeyPathInfo + +- (instancetype)init +{ + if (self = [super init]) { + self.blocks = [NSMutableSet set]; + } + + return self; +} + +@end + + +@implementation SCKVOInfo + +- (instancetype)initWithObserver:(id)observer +{ + if (self = [super init]) { + self.observer = observer; + self.keyPathInfos = [NSMutableDictionary dictionary]; } + return self; } @end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 562550a..707b494 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -228,6 +228,7 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager // Delay invalidation for performance reasons and attempt a full range invalidation later if(!self.shouldAllowFullSyntaxHighlight && ![layoutManager isEqual:self.editorTextView.layoutManager]) { + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleMinimapRange) object:nil]; [self performSelector:@selector(invalidateDisplayForVisibleMinimapRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; @@ -303,7 +304,7 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRan [self invalidateLayoutForVisibleMinimapRange]; } -#pragma makr - IDEBreakpointManagerDelegate +#pragma mark - IDEBreakpointManagerDelegate - (void)breakpointManagerDidAddBreakpoint:(IDEBreakpointManager *)breakpointManager { @@ -342,7 +343,7 @@ - (void)updateBreakpoints if([fileBreakpoint.documentURL isEqualTo:self.editor.document.fileURL] && fileBreakpoint.location.startingLineNumber == lineNumber) { [self.breakpointDictionaries addObject:@{kBreakpointRangeKey : [NSValue valueWithRange:lineRange], - kBreakpointEnabledKey : @(fileBreakpoint.shouldBeEnabled)}]; + kBreakpointEnabledKey : @(fileBreakpoint.shouldBeEnabled && breakpointManager.breakpointsActivated)}]; } } } @@ -351,6 +352,11 @@ - (void)updateBreakpoints } [self invalidateDisplayForVisibleMinimapRange]; + + BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; + if(editorHighlightingEnabled) { + [self invalidateDisplayForVisibleEditorRange]; + } } #pragma mark - Navigation @@ -417,7 +423,6 @@ - (void)updateTheme { self.editorTheme = [self minimapThemeWithTheme:[DVTFontAndColorTheme currentTheme]]; - DVTPreferenceSetManager *preferenceSetManager = [DVTFontAndColorTheme preferenceSetsManager]; NSArray *preferenceSet = [preferenceSetManager availablePreferenceSets]; @@ -487,6 +492,7 @@ - (void)resizeWithOldSuperviewSize:(NSSize)oldSize - (void)invalidateDisplayForVisibleMinimapRange { self.shouldAllowFullSyntaxHighlight = YES; + NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; [self.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; } From 9d8106b17c7f91b9b3fd5fe8200d32b78949a68b Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 21 Feb 2015 13:58:13 +0000 Subject: [PATCH 43/96] Fixes breakpoint highlighting - switched from IDEBreakpointManager to DBGBreakpointAnnotationProvider. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 40 +++++-- ...akpointAnnotationProvider+SCXcodeMinimap.h | 23 ++++ ...akpointAnnotationProvider+SCXcodeMinimap.m | 61 ++++++++++ .../DVTTextDocumentLocation+SCXcodeMinimap.h | 13 +++ .../DVTTextDocumentLocation+SCXcodeMinimap.m | 61 ++++++++++ .../IDEBreakpointManager+SCXcodeMinimap.m | 1 + SCXcodeMinimap/SCXcodeMinimapView.m | 110 ++++++++---------- .../Xcode Headers/DBGBreakpointAnnotation.h | 37 ++++++ .../DBGBreakpointAnnotationProvider.h | 46 ++++++++ SCXcodeMinimap/Xcode Headers/DVTAnnotation.h | 24 ++++ .../Xcode Headers/DVTAnnotationManager.h | 22 ++++ .../Xcode Headers/DVTAnnotationProvider.h | 24 ++++ .../Xcode Headers/DVTTextAnnotation.h | 109 +++++++++++++++++ SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h | 80 ------------- .../Xcode Headers/IDEBreakpointManager.h | 74 ------------ 15 files changed, 499 insertions(+), 226 deletions(-) create mode 100644 SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m create mode 100644 SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.m create mode 100644 SCXcodeMinimap/Xcode Headers/DBGBreakpointAnnotation.h create mode 100644 SCXcodeMinimap/Xcode Headers/DBGBreakpointAnnotationProvider.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTAnnotation.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTAnnotationManager.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTAnnotationProvider.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTTextAnnotation.h delete mode 100644 SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h delete mode 100644 SCXcodeMinimap/Xcode Headers/IDEBreakpointManager.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 34c9114..8a80103 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 18143CC41A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18143CC31A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m */; }; 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */; }; 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */; }; 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 184C118E1A741136002A7C65 /* DVTFoundation.framework */; }; @@ -14,7 +15,8 @@ 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 188308091A7411830005DF40 /* DVTKit.framework */; }; 1883080C1A7411930005DF40 /* IDESourceEditor.ideplugin in Resources */ = {isa = PBXBuildFile; fileRef = 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */; }; 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 1883080F1A7411A70005DF40 /* IDESourceEditor */; }; - 18D6AD0E1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18D6AD0D1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m */; }; + 188FCC8A1A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */; }; + 18C999FF1A98B04C0008AF54 /* DebuggerUI in Frameworks */ = {isa = PBXBuildFile; fileRef = 18C999FE1A98B04C0008AF54 /* DebuggerUI */; }; 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */; }; 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18FE09B51707639E00118FEB /* Cocoa.framework */; }; 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */; }; @@ -22,7 +24,10 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 180F0C651A98AE1500E97254 /* DVTAnnotationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationManager.h; sourceTree = ""; }; 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 18143CC21A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTTextDocumentLocation+SCXcodeMinimap.h"; sourceTree = ""; }; + 18143CC31A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTTextDocumentLocation+SCXcodeMinimap.m"; sourceTree = ""; }; 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTFoldingManager.h; sourceTree = ""; }; 184407641A8F7B1900C530CF /* DVTTextDocumentLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextDocumentLocation.h; sourceTree = ""; }; 184407651A8F7B3E00C530CF /* DVTDocumentLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTDocumentLocation.h; sourceTree = ""; }; @@ -50,16 +55,20 @@ 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDEEditorDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 1876135E1A77A74300974BE1 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = ../../../../../Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEFileBreakpoint.h; sourceTree = ""; }; - 187EEF6B1A8F78EC00E4EF39 /* IDEBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpoint.h; sourceTree = ""; }; 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDESourceEditor.ideplugin; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin; sourceTree = ""; }; 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; + 188D38761A98B26E005C7F85 /* DBGBreakpointAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotation.h; sourceTree = ""; }; + 188D38771A98B3AC005C7F85 /* DVTTextAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextAnnotation.h; sourceTree = ""; }; + 188D38781A98B3D8005C7F85 /* DVTAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotation.h; sourceTree = ""; }; + 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h"; sourceTree = ""; }; + 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DBGBreakpointAnnotationProvider+SCXcodeMinimap.m"; sourceTree = ""; }; 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTPreferenceSetManager.h; sourceTree = ""; }; 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFoldingLayoutManager.h; sourceTree = ""; }; 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTLayoutManager.h; sourceTree = ""; }; - 18D6AD0C1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEBreakpointManager+SCXcodeMinimap.h"; sourceTree = ""; }; - 18D6AD0D1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEBreakpointManager+SCXcodeMinimap.m"; sourceTree = ""; }; - 18D6AD0F1A8F72250082CB3F /* IDEBreakpointManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpointManager.h; sourceTree = ""; }; + 18C999FC1A98AF370008AF54 /* DBGBreakpointAnnotationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotationProvider.h; sourceTree = ""; }; + 18C999FD1A98AF580008AF54 /* DVTAnnotationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationProvider.h; sourceTree = ""; }; + 18C999FE1A98B04C0008AF54 /* DebuggerUI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = DebuggerUI; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS/DebuggerUI; sourceTree = ""; }; 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 18FE09B51707639E00118FEB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; @@ -84,6 +93,7 @@ 8742532317307161001C947C /* QuartzCore.framework in Frameworks */, 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */, 1876135F1A77A74300974BE1 /* IDEKit.framework in Frameworks */, + 18C999FF1A98B04C0008AF54 /* DebuggerUI in Frameworks */, 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */, 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */, ); @@ -95,6 +105,11 @@ 184C11701A740F8A002A7C65 /* Xcode Headers */ = { isa = PBXGroup; children = ( + 188D38761A98B26E005C7F85 /* DBGBreakpointAnnotation.h */, + 18C999FC1A98AF370008AF54 /* DBGBreakpointAnnotationProvider.h */, + 188D38781A98B3D8005C7F85 /* DVTAnnotation.h */, + 180F0C651A98AE1500E97254 /* DVTAnnotationManager.h */, + 18C999FD1A98AF580008AF54 /* DVTAnnotationProvider.h */, 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */, 184407651A8F7B3E00C530CF /* DVTDocumentLocation.h */, 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */, @@ -110,11 +125,10 @@ 184C11781A740F8A002A7C65 /* DVTSourceModelItem.h */, 184C11791A740F8A002A7C65 /* DVTSourceNodeTypes.h */, 184C117A1A740F8A002A7C65 /* DVTSourceTextView.h */, + 188D38771A98B3AC005C7F85 /* DVTTextAnnotation.h */, 184407641A8F7B1900C530CF /* DVTTextDocumentLocation.h */, 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */, 184C117C1A740F8A002A7C65 /* DVTViewController.h */, - 187EEF6B1A8F78EC00E4EF39 /* IDEBreakpoint.h */, - 18D6AD0F1A8F72250082CB3F /* IDEBreakpointManager.h */, 184C117D1A740F8A002A7C65 /* IDEEditor.h */, 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */, 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */, @@ -150,6 +164,7 @@ 18FE09B81707639E00118FEB /* AppKit.framework */, 18FE09B51707639E00118FEB /* Cocoa.framework */, 18FE09B91707639E00118FEB /* CoreData.framework */, + 18C999FE1A98B04C0008AF54 /* DebuggerUI */, 184C118E1A741136002A7C65 /* DVTFoundation.framework */, 188308091A7411830005DF40 /* DVTKit.framework */, 18FE09BA1707639E00118FEB /* Foundation.framework */, @@ -171,8 +186,10 @@ 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */, 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, - 18D6AD0C1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.h */, - 18D6AD0D1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m */, + 18143CC21A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.h */, + 18143CC31A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m */, + 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */, + 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, 184C11701A740F8A002A7C65 /* Xcode Headers */, ); @@ -250,9 +267,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 188FCC8A1A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m in Sources */, + 18143CC41A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m in Sources */, 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */, 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, - 18D6AD0E1A8F72010082CB3F /* IDEBreakpointManager+SCXcodeMinimap.m in Sources */, 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -337,6 +355,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; @@ -365,6 +384,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", + "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; diff --git a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.h b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.h new file mode 100644 index 0000000..8f874e2 --- /dev/null +++ b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.h @@ -0,0 +1,23 @@ +// +// DBGBreakpointAnnotationProvider+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 21/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DBGBreakpointAnnotationProvider.h" + +@protocol DBGBreakpointAnnotationProviderDelegate; + +@interface DBGBreakpointAnnotationProvider (SCXcodeMinimap) + +@property (nonatomic, weak) id delegate; + +@end + +@protocol DBGBreakpointAnnotationProviderDelegate + +- (void)breakpointAnnotationProviderDidChangeBreakpoints:(DBGBreakpointAnnotationProvider *)annotationProvider; + +@end \ No newline at end of file diff --git a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m new file mode 100644 index 0000000..ad5f660 --- /dev/null +++ b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m @@ -0,0 +1,61 @@ +// +// DBGBreakpointAnnotationProvider+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 21/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h" +#import +#import "DBGBreakpointAnnotation.h" + +@implementation DBGBreakpointAnnotationProvider (SCXcodeMinimap) + +static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { + Method originalMethod = class_getInstanceMethod(class, originalSelector); + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); + if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { + class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} + ++ (void)load +{ + sc_swizzleInstanceMethod(self, @selector(_addAnnotationForFileBreakpoint:), @selector(sc_addAnnotationForFileBreakpoint:)); + sc_swizzleInstanceMethod(self, @selector(_removeAnnotation:), @selector(sc_removeAnnotation:)); + sc_swizzleInstanceMethod(self, @selector(didMoveAnnotation:), @selector(sc_didMoveAnnotation:)); +} + +- (void)setDelegate:(id)delegate +{ + objc_setAssociatedObject(self, @selector(delegate), delegate, OBJC_ASSOCIATION_ASSIGN); +} + +- (id)delegate +{ + return objc_getAssociatedObject(self, @selector(delegate)); +} + +- (void)sc_addAnnotationForFileBreakpoint:(id)arg1 +{ + [self sc_addAnnotationForFileBreakpoint:arg1]; + + [self.delegate breakpointAnnotationProviderDidChangeBreakpoints:self]; +} + +- (void)sc_removeAnnotation:(id)arg1 +{ + [self sc_removeAnnotation:arg1]; + + [self.delegate breakpointAnnotationProviderDidChangeBreakpoints:self]; +} + +- (void)sc_didMoveAnnotation:(id)arg1 +{ + [self.delegate breakpointAnnotationProviderDidChangeBreakpoints:self]; +} + +@end diff --git a/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.h b/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.h new file mode 100644 index 0000000..1308839 --- /dev/null +++ b/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.h @@ -0,0 +1,13 @@ +// +// DVTTextDocumentLocation+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 21/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DVTTextDocumentLocation.h" + +@interface DVTTextDocumentLocation (SCXcodeMinimap) + +@end diff --git a/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.m b/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.m new file mode 100644 index 0000000..3ae574f --- /dev/null +++ b/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.m @@ -0,0 +1,61 @@ +// +// DVTTextDocumentLocation+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 21/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DVTTextDocumentLocation+SCXcodeMinimap.h" +#import + +@implementation DVTTextDocumentLocation (SCXcodeMinimap) + +static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { + Method originalMethod = class_getInstanceMethod(class, originalSelector); + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); + if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { + class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} + ++ (void)load +{ +// sc_swizzleInstanceMethod(self, @selector(initWithDocumentURL:timestamp:startingColumnNumber:endingColumnNumber:startingLineNumber:endingLineNumber:characterRange:), @selector(sc_initWithDocumentURL:timestamp:startingColumnNumber:endingColumnNumber:startingLineNumber:endingLineNumber:characterRange:)); +// +// sc_swizzleInstanceMethod(self, @selector(initWithDocumentURL:timestamp:), @selector(sc_initWithDocumentURL:timestamp:)); +// sc_swizzleInstanceMethod(self, @selector(initWithDocumentURL:timestamp:characterRange:), @selector(sc_initWithDocumentURL:timestamp:characterRange:)); +// sc_swizzleInstanceMethod(self, @selector(initWithDocumentURL:timestamp:lineRange:), @selector(sc_initWithDocumentURL:timestamp:lineRange:)); +} + +- (id)sc_initWithDocumentURL:(id)arg1 timestamp:(id)arg2 startingColumnNumber:(long long)arg3 endingColumnNumber:(long long)arg4 startingLineNumber:(long long)arg5 endingLineNumber:(long long)arg6 characterRange:(struct _NSRange)arg7 +{ + NSLog(@"%@", [NSThread callStackSymbols]); + + return [self sc_initWithDocumentURL:arg1 timestamp:arg2 startingColumnNumber:arg3 endingColumnNumber:arg4 startingLineNumber:arg5 endingLineNumber:arg6 characterRange:arg7]; +} + +- (id)sc_initWithDocumentURL:(id)arg1 timestamp:(id)arg2 +{ + NSLog(@"%@", [NSThread callStackSymbols]); + + return [self sc_initWithDocumentURL:arg1 timestamp:arg2]; +} + +- (id)sc_initWithDocumentURL:(id)arg1 timestamp:(id)arg2 characterRange:(struct _NSRange)arg3 +{ + NSLog(@"%@", [NSThread callStackSymbols]); + + return [self sc_initWithDocumentURL:arg1 timestamp:arg2 characterRange:arg3]; +} + +- (id)sc_initWithDocumentURL:(id)arg1 timestamp:(id)arg2 lineRange:(struct _NSRange)arg3 +{ + NSLog(@"%@", [NSThread callStackSymbols]); + + return [self sc_initWithDocumentURL:arg1 timestamp:arg2 lineRange:arg3]; +} + +@end diff --git a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m index 7530254..da0dc40 100644 --- a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m +++ b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m @@ -56,6 +56,7 @@ - (SCKVOController *)kvoController if([breakpoint isKindOfClass:[IDEFileBreakpoint class]]) { [self _observeBreakpoint:breakpoint]; } + } } diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 707b494..ca49511 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -24,9 +24,10 @@ #import "DVTPreferenceSetManager.h" #import "DVTFoldingManager.h" -#import "IDEBreakpointManager+SCXcodeMinimap.h" -#import "IDEFileBreakpoint.h" -#import "DVTTextDocumentLocation.h" + +#import "DVTAnnotationManager.h" +#import "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h" +#import "DBGBreakpointAnnotation.h" const CGFloat kBackgroundColorShadowLevel = 0.1f; const CGFloat kDurationBetweenInvalidations = 0.5f; @@ -65,7 +66,7 @@ @implementation SCXcodeMinimapTheme @end -@interface SCXcodeMinimapView () +@interface SCXcodeMinimapView () @property (nonatomic, strong) IDESourceCodeEditor *editor; @property (nonatomic, strong) NSScrollView *editorScrollView; @@ -82,6 +83,8 @@ @interface SCXcodeMinimapView () )weakSelf.editorTextView]; } - [weakSelf invalidateDisplayForVisibleEditorRange]; + [weakSelf invalidateDisplayForVisibleRange]; }]; [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -227,24 +237,25 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager SCXcodeMinimapTheme *theme = ([layoutManager isEqualTo:self.textView.layoutManager] ? self.minimapTheme : self.editorTheme); // Delay invalidation for performance reasons and attempt a full range invalidation later - if(!self.shouldAllowFullSyntaxHighlight && ![layoutManager isEqual:self.editorTextView.layoutManager]) { + if(!self.shouldAllowFullSyntaxHighlight && [layoutManager isEqual:self.textView.layoutManager]) { - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleMinimapRange) object:nil]; - [self performSelector:@selector(invalidateDisplayForVisibleMinimapRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleRange) object:nil]; + [self performSelector:@selector(invalidateDisplayForVisibleRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor}; } - // Set background colors for breakpoints - if(self.breakpointDictionaries.count) { - for(NSDictionary *breakpointDictionary in self.breakpointDictionaries) { - NSRange range = [breakpointDictionary[kBreakpointRangeKey] rangeValue]; - BOOL enabled = [breakpointDictionary[kBreakpointEnabledKey] boolValue]; - - if(NSIntersectionRange(range, NSMakeRange(charIndex, 1)).length) { - *effectiveCharRange = range; - return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, - NSBackgroundColorAttributeName : (enabled ? theme.enabledBreakpointColor : theme.disabledBreakpointColor)}; + if(self.shouldAllowFullSyntaxHighlight) { + // Set background colors for breakpoints + if(self.breakpointDictionaries.count) { + for(NSDictionary *breakpointDictionary in self.breakpointDictionaries) { + NSRange range = [breakpointDictionary[kBreakpointRangeKey] rangeValue]; + + if(NSIntersectionRange(range, NSMakeRange(charIndex, 1)).length) { + *effectiveCharRange = range; + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, + NSBackgroundColorAttributeName : theme.enabledBreakpointColor}; + } } } } @@ -304,21 +315,11 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRan [self invalidateLayoutForVisibleMinimapRange]; } -#pragma mark - IDEBreakpointManagerDelegate - -- (void)breakpointManagerDidAddBreakpoint:(IDEBreakpointManager *)breakpointManager -{ - [self updateBreakpoints]; -} - -- (void)breakpointManagerDidRemoveBreakpoint:(IDEBreakpointManager *)breakpointManager -{ - [self updateBreakpoints]; -} +#pragma mark - DBGBreakpointAnnotationProviderDelegate -- (void)breakpointManagerDidChangeBreakpoint:(IDEBreakpointManager *)breakpointManager +- (void)breakpointAnnotationProviderDidChangeBreakpoints:(DBGBreakpointAnnotationProvider *)annotationProvider { - [self updateBreakpoints]; + [self invalidateDisplayForVisibleRange]; } - (void)updateBreakpoints @@ -331,32 +332,18 @@ - (void)updateBreakpoints self.breakpointDictionaries = [NSMutableArray array]; - IDEBreakpointManager *breakpointManager = [self.editor _breakpointManager]; - - for (NSUInteger index = 0, lineNumber = 1; index < self.textView.string.length; lineNumber++) { + for (NSUInteger index = 0, lineNumber = 0; index < self.textView.string.length; lineNumber++) { NSRange lineRange = [self.textView.string lineRangeForRange:NSMakeRange(index, 0)]; - for(IDEBreakpoint *breakpoint in breakpointManager.breakpoints) { - if([breakpoint isKindOfClass:[IDEFileBreakpoint class]]) { - IDEFileBreakpoint *fileBreakpoint = (IDEFileBreakpoint *)breakpoint; - - if([fileBreakpoint.documentURL isEqualTo:self.editor.document.fileURL] && fileBreakpoint.location.startingLineNumber == lineNumber) { - [self.breakpointDictionaries addObject:@{kBreakpointRangeKey : [NSValue valueWithRange:lineRange], - kBreakpointEnabledKey : @(fileBreakpoint.shouldBeEnabled && breakpointManager.breakpointsActivated)}]; - } + for(DBGBreakpointAnnotation *breakpointAnnotation in self.breakpointAnnotationProvider.annotations) { + if(breakpointAnnotation.paragraphRange.location == lineNumber) { + [self.breakpointDictionaries addObject:@{kBreakpointRangeKey : [NSValue valueWithRange:lineRange]}]; } } index = NSMaxRange(lineRange); } - - [self invalidateDisplayForVisibleMinimapRange]; - - BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; - if(editorHighlightingEnabled) { - [self invalidateDisplayForVisibleEditorRange]; - } } #pragma mark - Navigation @@ -489,12 +476,17 @@ - (void)resizeWithOldSuperviewSize:(NSSize)oldSize #pragma mark - Helpers -- (void)invalidateDisplayForVisibleMinimapRange +- (void)invalidateDisplayForVisibleRange { self.shouldAllowFullSyntaxHighlight = YES; + [self updateBreakpoints]; + NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; [self.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; + + NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; + [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:visibleEditorRange]; } - (void)invalidateLayoutForVisibleMinimapRange @@ -503,10 +495,4 @@ - (void)invalidateLayoutForVisibleMinimapRange [self.textView.layoutManager invalidateLayoutForCharacterRange:visibleMinimapRange actualCharacterRange:nil]; } -- (void)invalidateDisplayForVisibleEditorRange -{ - NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; - [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:visibleEditorRange]; -} - @end diff --git a/SCXcodeMinimap/Xcode Headers/DBGBreakpointAnnotation.h b/SCXcodeMinimap/Xcode Headers/DBGBreakpointAnnotation.h new file mode 100644 index 0000000..f4cdd25 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DBGBreakpointAnnotation.h @@ -0,0 +1,37 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTTextAnnotation.h" + +@class DVTObservingToken, IDEBreakpointIcon, IDEWorkspaceWindowController; + +@interface DBGBreakpointAnnotation : DVTTextAnnotation +{ + IDEWorkspaceWindowController *_workspaceWindowController; + IDEBreakpointIcon *_icon; + struct CGRect _lastRectDrawnIn; + DVTObservingToken *_workspaceWindowControllerObserver; + DVTObservingToken *_breakpointShouldBeEnabledObserver; + DVTObservingToken *_breakpointLocationOrAddressObserver; +} + +@property struct CGRect lastRectDrawnIn; // @synthesize lastRectDrawnIn=_lastRectDrawnIn; +- (void)_updateLandmarkItemIfAppropriate; +- (void)adjustParagraphIndexBy:(long long)arg1 lengthBy:(long long)arg2; +- (void)resolveLocationIfNeededForLayoutManager:(id)arg1; +- (id)annotationDisplayDescription; +- (id)annotationDisplayName; +- (void)_redisplay; +- (id)_iconForRect:(struct CGRect)arg1; +- (void)drawSidebarMarkerIconInRect:(struct CGRect)arg1 textView:(id)arg2; +- (struct CGRect)sidebarMarkerRectForFirstLineRect:(struct CGRect)arg1; +- (void)setLocation:(id)arg1; +- (void)annotationWillUninstall; +- (id)_initWithWorkspaceWindowController:(id)arg1 breakpoint:(id)arg2; +- (id)initWithWorkspaceWindowController:(id)arg1 addressBreakpoint:(id)arg2 inMemoryDocumentURL:(id)arg3; +- (id)initWithWorkspaceWindowController:(id)arg1 fileBreakpoint:(id)arg2; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DBGBreakpointAnnotationProvider.h b/SCXcodeMinimap/Xcode Headers/DBGBreakpointAnnotationProvider.h new file mode 100644 index 0000000..f085ad7 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DBGBreakpointAnnotationProvider.h @@ -0,0 +1,46 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTAnnotationProvider.h" + +@class DVTObservingToken, IDEAnnotationContext, IDEWorkspaceWindowController; + +@interface DBGBreakpointAnnotationProvider : DVTAnnotationProvider +{ + IDEAnnotationContext *_context; + IDEWorkspaceWindowController *_workspaceWindowController; + DVTObservingToken *_breakpointsObservingToken; +} + ++ (id)annotationProviderForContext:(id)arg1 error:(id *)arg2; +@property(readonly) IDEAnnotationContext *context; // @synthesize context=_context; +- (void)_revealInBreakpointNavigator:(id)arg1; +- (void)_deleteBreakpoint:(id)arg1; +- (void)_editBreakpoint:(id)arg1; +- (void)_editBreakpointForAnnotation:(id)arg1 inTextSideBarView:(id)arg2; +- (id)_createRevealInBreakpointNavigatorMenuItem:(id)arg1; +- (id)_createDeleteBreakpointMenuItem:(id)arg1; +- (id)_createToggleBreakpointMenuItem:(id)arg1; +- (id)_createEditBreakpointMenuItem:(id)arg1 inTextSidebarView:(id)arg2; +- (id)contextMenuItemsForAnnotation:(id)arg1 inTextSidebarView:(id)arg2; +- (void)didClickAnnotation:(id)arg1 inTextSidebarView:(id)arg2 event:(id)arg3; +- (void)didDeleteOrReplaceParagraphForAnnotation:(id)arg1; +- (void)didMoveAnnotation:(id)arg1; +- (unsigned long long)annotation:(id)arg1 willMoveToParagraphNumber:(unsigned long long)arg2; +- (void)didRemoveAnnotation:(id)arg1; +- (void)providerWillUninstall; +- (id)_documentURL; +- (void)_removeAnnotation:(id)arg1; +- (void)_handleAnnotationWasRemoved:(id)arg1; +- (void)_handleBreakpointRemoved:(id)arg1; +- (void)_addAnnotationForAddressBreakpoint:(id)arg1; +- (void)_addAnnotationForFileBreakpoint:(id)arg1; +- (void)_handleBreakpointAdded:(id)arg1; +- (void)_handleBreakpointsChanged:(id)arg1; +- (id)initWithContext:(id)arg1; +- (id)init; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTAnnotation.h b/SCXcodeMinimap/Xcode Headers/DVTAnnotation.h new file mode 100644 index 0000000..33e4876 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTAnnotation.h @@ -0,0 +1,24 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + + +@interface DVTAnnotation : NSObject +{ + double _precedence; + id _representedObject; + BOOL _visible; +} + +@property(retain) id representedObject; // @synthesize representedObject=_representedObject; +@property(getter=isVisible) BOOL visible; // @synthesize visible=_visible; +@property double precedence; // @synthesize precedence=_precedence; +@property(readonly) BOOL hideCarets; +- (id)annotationDisplayDescription; +- (id)annotationDisplayName; +- (long long)comparePrecedence:(id)arg1; +- (id)init; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTAnnotationManager.h b/SCXcodeMinimap/Xcode Headers/DVTAnnotationManager.h new file mode 100644 index 0000000..2159f7a --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTAnnotationManager.h @@ -0,0 +1,22 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + + +@class DVTAnnotationContext, NSMutableArray; + +@interface DVTAnnotationManager : NSObject +{ + NSMutableArray *_annotationProviders; + DVTAnnotationContext *_context; +} + +@property(retain) DVTAnnotationContext *context; // @synthesize context=_context; +@property(retain) NSMutableArray *annotationProviders; // @synthesize annotationProviders=_annotationProviders; +- (void)removeAllAnnotationProviders; +- (void)setupAnnotationProvidersWithContext:(id)arg1; +- (id)_installObservationBlockForAnnotationProvider:(id)arg1; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTAnnotationProvider.h b/SCXcodeMinimap/Xcode Headers/DVTAnnotationProvider.h new file mode 100644 index 0000000..f3a8beb --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTAnnotationProvider.h @@ -0,0 +1,24 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + + +@class NSMutableSet, NSSet; + +@interface DVTAnnotationProvider : NSObject +{ + NSMutableSet *_annotations; +} + ++ (id)annotationProviderForContext:(id)arg1 error:(id *)arg2; ++ (void)initialize; +- (void)providerWillUninstall; +- (id)init; + +// Remaining properties +@property(copy) NSSet *annotations; // @dynamic annotations; +@property(readonly) NSMutableSet *mutableAnnotations; // @dynamic mutableAnnotations; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTTextAnnotation.h b/SCXcodeMinimap/Xcode Headers/DVTTextAnnotation.h new file mode 100644 index 0000000..1b2993e --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTTextAnnotation.h @@ -0,0 +1,109 @@ +/* + * Generated by class-dump 3.3.4 (64 bit). + * + * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. + */ + +#import "DVTAnnotation.h" + +@class DVTMutableRangeArray, DVTSourceLandmarkItem, DVTTextDocumentLocation, NSArray, NSImage, NSMutableArray, NSMutableDictionary; + +@interface DVTTextAnnotation : DVTAnnotation +{ + NSMutableArray *_layoutManagers; + NSMutableDictionary *_themesByState; + DVTTextDocumentLocation *_location; + NSArray *_secondaryLocations; + DVTMutableRangeArray *_highlightedRanges; + struct _NSRange _paragraphRange; + unsigned long long _paragraphHash; + NSImage *_sidebarMarkerImage; + double _sidebarMarkerVerticalPadding; + double _sidebarMarkerHorizontalOffset; + double _sidebarMarkerOpacity; + unsigned long long _highlightSidebarStyle; + unsigned long long _severity; + struct { + unsigned int sidebarMarkerAlignment:4; + unsigned int wantsDisplayOverLineNumber:1; + unsigned int wantsReplaceLineNumber:1; + unsigned int wantsInvertedLineNumber:1; + unsigned int shouldDrawTemplateInverted:1; + unsigned int lineHighlightVisible:1; + unsigned int highlightedRangesVisible:1; + unsigned int userDraggable:1; + unsigned int userRemovable:1; + unsigned int isParagraphEdited:1; + } _taFlags; + BOOL _wantsScrollbarMarker; + BOOL _scrollbarMarkerHighlight; + BOOL _lazyInvalidation; + int _annotationStackPolicy; +} + ++ (void)drawLineHighlightForAnnotations:(id)arg1 highlightRanges:(BOOL)arg2 textView:(id)arg3 getParaRectBlock:(id)arg4; ++ (void)sortAndFilterSupressedAnnotationsInArray:(id)arg1 usingComparisonSelector:(SEL)arg2; ++ (id)logAspect; ++ (void)initialize; +@property BOOL lazyInvalidation; // @synthesize lazyInvalidation=_lazyInvalidation; +@property BOOL scrollbarMarkerHighlight; // @synthesize scrollbarMarkerHighlight=_scrollbarMarkerHighlight; +@property BOOL wantsScrollbarMarker; // @synthesize wantsScrollbarMarker=_wantsScrollbarMarker; +@property(nonatomic) double sidebarMarkerOpacity; // @synthesize sidebarMarkerOpacity=_sidebarMarkerOpacity; +@property(nonatomic) unsigned long long highlightSidebarStyle; // @synthesize highlightSidebarStyle=_highlightSidebarStyle; +@property(nonatomic) double sidebarMarkerHorizontalOffset; // @synthesize sidebarMarkerHorizontalOffset=_sidebarMarkerHorizontalOffset; +@property double sidebarMarkerVerticalPadding; // @synthesize sidebarMarkerVerticalPadding=_sidebarMarkerVerticalPadding; +@property(retain, nonatomic) NSImage *sidebarMarkerImage; // @synthesize sidebarMarkerImage=_sidebarMarkerImage; +@property int annotationStackPolicy; // @synthesize annotationStackPolicy=_annotationStackPolicy; +@property unsigned long long severity; // @synthesize severity=_severity; +@property(readonly) struct _NSRange paragraphRange; // @synthesize paragraphRange=_paragraphRange; +@property(retain, nonatomic) DVTTextDocumentLocation *location; // @synthesize location=_location; +- (id)annotationDisplayDescription; +- (BOOL)isFocusedInTextView:(id)arg1; +- (void)adjustParagraphIndexBy:(long long)arg1 lengthBy:(long long)arg2; +- (id)description; +- (void)fontAndColorThemeChanged:(id)arg1; +- (void)invalidateDisplayAndLayoutIfNeeded:(BOOL)arg1; +- (void)setNeedsInvalidate; +- (long long)comparePrecedenceAndLayering:(id)arg1; +- (struct CGRect)sidebarMarkerRectForFirstLineRect:(struct CGRect)arg1; +- (id)currentStateInTextView:(id)arg1; +- (void)drawHighlightedRangesInRect:(struct CGRect)arg1 textView:(id)arg2; +- (BOOL)drawsHighlightedRanges; +- (void)drawLineHighlightInRect:(struct CGRect)arg1 textView:(id)arg2; +- (BOOL)drawsLineHighlight; +- (void)drawSidebarMarkerIconInRect:(struct CGRect)arg1 textView:(id)arg2; +- (void)annotationWillDrawInTextView:(id)arg1; +@property(getter=isUserRemovable) BOOL userRemovable; +@property(getter=isUserDraggable) BOOL userDraggable; +- (void)synchronizeHighlightedRangesWithLocationsForTextStorage:(id)arg1; +- (void)removeAllHighlightedRanges; +- (void)removeHighlightedRange:(struct _NSRange)arg1; +- (void)removeHighlightedRangeAtIndex:(long long)arg1; +- (void)insertHighlightedRange:(struct _NSRange)arg1 atIndex:(long long)arg2; +- (void)addHighlightedRange:(struct _NSRange)arg1; +- (void)removeObjectFromHighlightedRangesAtIndex:(unsigned long long)arg1; +- (void)insertObject:(id)arg1 inHighlightedRangesAtIndex:(unsigned long long)arg2; +@property(copy) NSArray *highlightedRanges; // @synthesize highlightedRanges=_highlightedRanges; +@property(getter=isHighlightedRangesVisible) BOOL highlightedRangesVisible; +- (id)_highlightedRanges; +@property(getter=isLineHighlightVisible) BOOL lineHighlightVisible; +@property(readonly) DVTSourceLandmarkItem *enclosingLandmarkItem; +@property BOOL shouldDrawTemplateInverted; +@property BOOL wantsInvertedLineNumber; +@property BOOL wantsReplaceLineNumber; +@property BOOL wantsDisplayOverLineNumber; +- (void)setSidebarMarkerTopMargin:(double)arg1; +@property unsigned long long sidebarMarkerAlignment; +- (void)setVisible:(BOOL)arg1; +- (void)setTheme:(id)arg1 forState:(id)arg2; +- (id)themeForState:(id)arg1; +- (void)resolveLocationIfNeededForLayoutManager:(id)arg1; +@property(getter=isParagraphEdited) BOOL paragraphEdited; +@property(copy) NSArray *secondaryLocations; // @synthesize secondaryLocations=_secondaryLocations; +- (void)removeLayoutManager:(id)arg1; +- (void)addLayoutManager:(id)arg1; +@property(readonly) NSArray *layoutManagers; +- (void)dealloc; +- (id)init; + +@end diff --git a/SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h b/SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h deleted file mode 100644 index 28528e0..0000000 --- a/SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Generated by class-dump 3.3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. - */ - -#import "DVTInvalidation-Protocol.h" - -@class DVTMapTable, DVTStackBacktrace, IDEBreakpointBucket, NSArray, NSMutableArray, NSMutableSet, NSSet, NSString; - -@interface IDEBreakpoint : NSObject -{ - NSString *_displayName; - IDEBreakpointBucket *_bucket; - NSMutableSet *_matchedModuleNames; - BOOL _shouldBeEnabled; - int _debuggerState; - unsigned long long _ignoreCount; - unsigned long long _hitCount; - NSString *_condition; - BOOL _continueAfterRunningActions; - NSMutableArray *_actions; - NSMutableArray *_locations; - DVTMapTable *_actionsToSetsOfObservers; - int _breakpointStackSelectionBehavior; - NSString *_customStopReasonString; -} - -+ (id)propertiesAffectingPersistenceState; -+ (void)initialize; -@property(retain) NSString *customStopReasonString; // @synthesize customStopReasonString=_customStopReasonString; -@property int breakpointStackSelectionBehavior; // @synthesize breakpointStackSelectionBehavior=_breakpointStackSelectionBehavior; -@property unsigned long long hitCount; // @synthesize hitCount=_hitCount; -@property BOOL continueAfterRunningActions; // @synthesize continueAfterRunningActions=_continueAfterRunningActions; -@property(copy) NSString *condition; // @synthesize condition=_condition; -@property unsigned long long ignoreCount; // @synthesize ignoreCount=_ignoreCount; -@property int debuggerState; // @synthesize debuggerState=_debuggerState; -@property(nonatomic) BOOL shouldBeEnabled; // @synthesize shouldBeEnabled=_shouldBeEnabled; -@property(retain) IDEBreakpointBucket *bucket; // @synthesize bucket=_bucket; -@property(copy) NSString *displayName; // @synthesize displayName=_displayName; -- (void)primitiveInvalidate; -- (void)addLocations:(id)arg1 fromXMLUnarchiver:(id)arg2; -- (void)addActions:(id)arg1 fromXMLUnarchiver:(id)arg2; -- (id)_actionArchivingProxiesArray; -- (void)dvt_encodeRelationshipsWithXMLArchiver:(id)arg1 version:(id)arg2; -- (void)setBreakpointStackSelectionBehaviorFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2; -- (void)setContinueAfterRunningActionsFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2; -- (void)setShouldBeEnabledFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2; -- (BOOL)_booleanValueFromUTF8String:(char *)arg1; -- (void)dvt_encodeAttributesWithXMLArchiver:(id)arg1 version:(id)arg2; -- (id)initFromXMLUnarchiver:(id)arg1 archiveVersion:(float)arg2; -- (void)_handleActionsChanged:(id)arg1; -- (void)resetActionExpressionResults; -- (void)locationWasRemoved:(id)arg1; -- (void)_updateLocation:(id)arg1 fromLocation:(id)arg2; -- (void)_locationWasResolved:(id)arg1 currentLocations:(id)arg2; -- (unsigned long long)_indexOfSimilarBreakpointLocationMatching:(id)arg1 inLocations:(id)arg2; -- (void)locationWasResolved:(id)arg1; -- (void)setInitialResolvedLocations:(id)arg1; -@property(readonly) BOOL locationsProvideAdditionalInformation; -- (void)toggleShouldBeEnabled; -- (void)_notifyPersistencyStateChanged; -- (void)primitiveSetBucket:(id)arg1; -- (id)description; -- (id)copyWithZone:(struct _NSZone *)arg1; -- (id)init; -- (void)_dvt_commonInit; - -// Remaining properties -@property(copy) NSArray *actions; // @dynamic actions; -@property(retain) DVTStackBacktrace *creationBacktrace; -@property(readonly) DVTStackBacktrace *invalidationBacktrace; -@property(readonly) NSArray *locations; // @dynamic locations; -@property(copy) NSSet *matchedModuleNames; // @dynamic matchedModuleNames; -@property(readonly) NSMutableArray *mutableActions; // @dynamic mutableActions; -@property(readonly) NSMutableArray *mutableLocations; // @dynamic mutableLocations; -@property(readonly) NSMutableSet *mutableMatchedModuleNames; // @dynamic mutableMatchedModuleNames; -@property(readonly, nonatomic, getter=isValid) BOOL valid; - -@end diff --git a/SCXcodeMinimap/Xcode Headers/IDEBreakpointManager.h b/SCXcodeMinimap/Xcode Headers/IDEBreakpointManager.h deleted file mode 100644 index 210c9fc..0000000 --- a/SCXcodeMinimap/Xcode Headers/IDEBreakpointManager.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Generated by class-dump 3.3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. - */ - -#import "DVTInvalidation-Protocol.h" - -@class DVTMapTable, DVTObservingToken, DVTStackBacktrace, IDEBreakpointBucket, IDEWorkspace, NSArray, NSMutableArray; - -@interface IDEBreakpointManager : NSObject -{ - IDEWorkspace *_workspace; - DVTObservingToken *_workspaceReferencedContainersToken; - DVTObservingToken *_currentDebugSessionStateObserverToken; - DVTMapTable *_bucketsToObserverTokens; - IDEBreakpointBucket *_defaultBucket; - IDEBreakpointBucket *_userWorkspaceBucket; - NSMutableArray *_userProjectBuckets; - IDEBreakpointBucket *_userGlobalBucket; - IDEBreakpointBucket *_watchpointBucket; - IDEBreakpointBucket *_sharedWorkspaceBucket; - NSMutableArray *_sharedProjectBuckets; - DVTMapTable *_userToSharedBuckets; - DVTMapTable *_sharedToUserBuckets; - NSMutableArray *_breakpoints; - BOOL _breakpointsActivated; -} - -+ (BOOL)_isBreakpointAtLocation:(id)arg1 location:(id)arg2; -+ (void)initialize; -@property BOOL breakpointsActivated; // @synthesize breakpointsActivated=_breakpointsActivated; -@property(readonly) IDEBreakpointBucket *sharedWorkspaceBucket; // @synthesize sharedWorkspaceBucket=_sharedWorkspaceBucket; -@property(readonly) IDEBreakpointBucket *userGlobalBucket; // @synthesize userGlobalBucket=_userGlobalBucket; -@property(readonly) IDEBreakpointBucket *userWorkspaceBucket; // @synthesize userWorkspaceBucket=_userWorkspaceBucket; -@property(retain, nonatomic) IDEBreakpointBucket *defaultBucket; // @synthesize defaultBucket=_defaultBucket; -@property(readonly) IDEWorkspace *workspace; // @synthesize workspace=_workspace; -- (void)primitiveInvalidate; -- (void)_handleBreakpointsChanged:(id)arg1; -- (void)_addListenerToBucketsBreakpointList:(id)arg1; -- (void)_removeListenerFromBucketsBreakpointList:(id)arg1; -- (BOOL)_canSetBreakpointAtURL:(id)arg1; -- (void)setBreakpointShared:(id)arg1 shared:(BOOL)arg2; -- (id)fileBreakpointAtDocumentLocation:(id)arg1; -- (id)pathOfModulesMatchingFileBreakpoint:(id)arg1; -- (void)removeWatchpoint:(id)arg1; -- (void)removeBreakpoint:(id)arg1; -- (BOOL)_managesBucket:(id)arg1; -- (void)_addBreakpoint:(id)arg1 toBucket:(id)arg2; -- (void)addWatchpoint:(id)arg1; -- (void)addBreakpoint:(id)arg1; -- (id)createWatchpoint:(id)arg1 variableName:(id)arg2; -- (id)_createAddressBreakpointFrom:(id)arg1 usingLineOfDisassembly:(id)arg2; -- (id)createAddressBreakpoint:(id)arg1; -- (id)createFileBreakpointAtDocumentLocation:(id)arg1; -- (id)createBreakpointAtDocumentLocation:(id)arg1 usingStringAtLine:(id)arg2; -- (void)_handleWorkspaceContainerRemoved:(id)arg1; -- (void)_handleWorkspaceContainerInserted:(id)arg1; -- (void)_handleWorkspaceContainersChanges:(id)arg1; -- (void)_handleCurrentDebugSessionStateChanged:(id)arg1; -- (id)initWithWorkspace:(id)arg1 error:(id *)arg2; - -// Remaining properties -@property(copy) NSArray *breakpoints; // @dynamic breakpoints; -@property(retain) DVTStackBacktrace *creationBacktrace; -@property(readonly) DVTStackBacktrace *invalidationBacktrace; -@property(readonly) NSMutableArray *mutableBreakpoints; // @dynamic mutableBreakpoints; -@property(readonly) NSMutableArray *mutableSharedProjectBuckets; // @dynamic mutableSharedProjectBuckets; -@property(readonly) NSMutableArray *mutableUserProjectBuckets; // @dynamic mutableUserProjectBuckets; -@property(retain) NSArray *sharedProjectBuckets; // @dynamic sharedProjectBuckets; -@property(retain) NSArray *userProjectBuckets; // @dynamic userProjectBuckets; -@property(readonly, nonatomic, getter=isValid) BOOL valid; - -@end From ac13b9f08a08909c976b32d7e7691e61564f37a2 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 21 Feb 2015 13:59:47 +0000 Subject: [PATCH 44/96] Removed unused IDEBreakpointManager+SCXcodeMinimap --- .../IDEBreakpointManager+SCXcodeMinimap.h | 37 --- .../IDEBreakpointManager+SCXcodeMinimap.m | 267 ------------------ 2 files changed, 304 deletions(-) delete mode 100644 SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h delete mode 100644 SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m diff --git a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h deleted file mode 100644 index 5e70147..0000000 --- a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// IDEBreakpointManager+SCXcodeMinimap.h -// SCXcodeMinimap -// -// Created by Stefan Ceriu on 14/02/2015. -// Copyright (c) 2015 Stefan Ceriu. All rights reserved. -// - -#import "IDEBreakpointManager.h" - -typedef void (^SCKVONotificationBlock)(id object, NSDictionary *change); - -@interface SCKVOController : NSObject - -- (void)observeObject:(id)object forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options block:(SCKVONotificationBlock)block; -- (void)unobserveObject:(id)object forKeyPath:(NSString *)keyPath; -- (void)unobserveObject:(id)object; -- (void)unobserveAll; - -@end - -@protocol IDEBreakpointManagerDelegate; - -@interface IDEBreakpointManager (SCXcodeMinimap) - -@property (nonatomic, weak) id delegate; -@property (nonatomic, strong) SCKVOController *kvoController; - -@end - -@protocol IDEBreakpointManagerDelegate - -- (void)breakpointManagerDidAddBreakpoint:(IDEBreakpointManager *)breakpointManager; -- (void)breakpointManagerDidRemoveBreakpoint:(IDEBreakpointManager *)breakpointManager; -- (void)breakpointManagerDidChangeBreakpoint:(IDEBreakpointManager *)breakpointManager; - -@end \ No newline at end of file diff --git a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m b/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m deleted file mode 100644 index da0dc40..0000000 --- a/SCXcodeMinimap/IDEBreakpointManager+SCXcodeMinimap.m +++ /dev/null @@ -1,267 +0,0 @@ -// -// IDEBreakpointManager+SCXcodeMinimap.m -// SCXcodeMinimap -// -// Created by Stefan Ceriu on 14/02/2015. -// Copyright (c) 2015 Stefan Ceriu. All rights reserved. -// - -#import "IDEBreakpointManager+SCXcodeMinimap.h" -#import "IDEFileBreakpoint.h" -#import - -@implementation IDEBreakpointManager (SCXcodeMinimap) - -static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { - Method originalMethod = class_getInstanceMethod(class, originalSelector); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { - class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); - } else { - method_exchangeImplementations(originalMethod, swizzledMethod); - } -} - -+ (void)load -{ - sc_swizzleInstanceMethod(self, @selector(_handleWorkspaceContainerRemoved:), @selector(sc_handleWorkspaceContainerRemoved:)); - sc_swizzleInstanceMethod(self, @selector(addBreakpoint:), @selector(sc_addBreakpoint:)); - sc_swizzleInstanceMethod(self, @selector(removeBreakpoint:), @selector(sc_removeBreakpoint:)); -} - -- (void)setDelegate:(id)delegate -{ - objc_setAssociatedObject(self, @selector(delegate), delegate, OBJC_ASSOCIATION_ASSIGN); -} - -- (id)delegate -{ - return objc_getAssociatedObject(self, @selector(delegate)); -} - -- (void)setKvoController:(SCKVOController *)kvoController -{ - objc_setAssociatedObject(self, @selector(kvoController), kvoController, OBJC_ASSOCIATION_RETAIN_NONATOMIC); -} - -- (SCKVOController *)kvoController -{ - SCKVOController *kvoController = objc_getAssociatedObject(self, @selector(kvoController)); - - if(kvoController == nil) { - kvoController = [[SCKVOController alloc] init]; - [self setKvoController:kvoController]; - - for(IDEBreakpoint *breakpoint in self.breakpoints) { - if([breakpoint isKindOfClass:[IDEFileBreakpoint class]]) { - [self _observeBreakpoint:breakpoint]; - } - - } - } - - return kvoController; -} - -- (void)sc_handleWorkspaceContainerRemoved:(id)arg1 -{ - [self.kvoController unobserveAll]; -} - -- (void)sc_addBreakpoint:(IDEBreakpoint *)breakpoint -{ - [self sc_addBreakpoint:breakpoint]; - - [self _observeBreakpoint:breakpoint]; - - if([self.delegate respondsToSelector:@selector(breakpointManagerDidAddBreakpoint:)]) { - [self.delegate breakpointManagerDidAddBreakpoint:self]; - } -} - -- (void)sc_removeBreakpoint:(IDEBreakpoint *)breakpoint -{ - [self.kvoController unobserveObject:breakpoint]; - - [self sc_removeBreakpoint:breakpoint]; - - if([self.delegate respondsToSelector:@selector(breakpointManagerDidRemoveBreakpoint:)]) { - [self.delegate breakpointManagerDidRemoveBreakpoint:self]; - } -} - -- (void)_observeBreakpoint:(IDEBreakpoint *)breakpoint -{ - [self.kvoController observeObject:breakpoint forKeyPath:@"location" options:NSKeyValueObservingOptionNew block:^(id object, NSDictionary *change) { - if([self.delegate respondsToSelector:@selector(breakpointManagerDidChangeBreakpoint:)]) { - [self.delegate breakpointManagerDidChangeBreakpoint:self]; - } - }]; - - [self.kvoController observeObject:breakpoint forKeyPath:@"shouldBeEnabled" options:NSKeyValueObservingOptionNew block:^(id object, NSDictionary *change) { - if([self.delegate respondsToSelector:@selector(breakpointManagerDidChangeBreakpoint:)]) { - [self.delegate breakpointManagerDidChangeBreakpoint:self]; - } - }]; -} - -@end - - -@interface SCKVOKeyPathInfo : NSObject - -@property (nonatomic, strong) NSMutableSet *blocks; - -@end - - -@interface SCKVOInfo : NSObject - -@property (nonatomic, weak) id observer; -@property (nonatomic, strong) NSMutableDictionary *keyPathInfos; - -- (instancetype)initWithObserver:(id)observer; - -@end - - -@interface SCKVOController() - -@property (nonatomic, strong) NSMapTable *mapTable; - -@end - - -@implementation SCKVOController - -- (void)dealloc -{ - [self unobserveAll]; -} - -- (void)observeObject:(id)object forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options block:(SCKVONotificationBlock)block -{ - NSParameterAssert(object); - NSParameterAssert(keyPath); - NSParameterAssert(block); - - SCKVOInfo *info = [self.mapTable objectForKey:object]; - - if (!info) { - info = [[SCKVOInfo alloc] initWithObserver:object]; - [self.mapTable setObject:info forKey:object]; - } - - SCKVOKeyPathInfo *kvoKeyPathInfo = [info.keyPathInfos objectForKey:keyPath]; - - BOOL registerObserver = NO; - - if (!kvoKeyPathInfo) { - kvoKeyPathInfo = [[SCKVOKeyPathInfo alloc] init]; - [info.keyPathInfos setValue:kvoKeyPathInfo forKey:keyPath]; - registerObserver = YES; - } - - [kvoKeyPathInfo.blocks addObject:[block copy]]; - - if (registerObserver) { - [object addObserver:self forKeyPath:keyPath options:options context:NULL]; - } -} - -- (void)unobserveObject:(id)object forKeyPath:(NSString *)keyPath -{ - NSParameterAssert(object); - NSParameterAssert(keyPath); - - SCKVOInfo *info = [self.mapTable objectForKey:object]; - - if (info) { - if (info.keyPathInfos[keyPath]) { - [info.keyPathInfos removeObjectForKey:keyPath]; - [object removeObserver:self forKeyPath:keyPath context:NULL]; - - if (info.keyPathInfos.count == 0) { - [self.mapTable removeObjectForKey:object]; - } - } - } -} - -- (void)unobserveObject:(id)object -{ - NSParameterAssert(object); - - SCKVOInfo *info = [self.mapTable objectForKey:object]; - if (info) { - for (NSString *keyPath in [info.keyPathInfos allKeys]) { - [self unobserveObject:object forKeyPath:keyPath]; - } - } -} - -- (void)unobserveAll -{ - NSMapTable *mapTable = [self.mapTable copy]; - - for (id object in mapTable) { - [self unobserveObject:object]; - } -} - -- (NSMapTable *)mapTable -{ - if (!_mapTable) { - _mapTable = [NSMapTable mapTableWithKeyOptions:NSPointerFunctionsWeakMemory|NSPointerFunctionsObjectPointerPersonality valueOptions:NSPointerFunctionsStrongMemory|NSPointerFunctionsObjectPersonality]; - } - - return _mapTable; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath - ofObject:(id)object - change:(NSDictionary *)change - context:(void *)context -{ - SCKVOInfo *info = [self.mapTable objectForKey:object]; - - if (info) { - SCKVOKeyPathInfo *kvoKeyPathInfo = [info.keyPathInfos objectForKey:keyPath]; - - if (kvoKeyPathInfo) { - for (SCKVONotificationBlock block in kvoKeyPathInfo.blocks) { - block(object, change); - } - } - } -} - -@end - - -@implementation SCKVOKeyPathInfo - -- (instancetype)init -{ - if (self = [super init]) { - self.blocks = [NSMutableSet set]; - } - - return self; -} - -@end - - -@implementation SCKVOInfo - -- (instancetype)initWithObserver:(id)observer -{ - if (self = [super init]) { - self.observer = observer; - self.keyPathInfos = [NSMutableDictionary dictionary]; - } - return self; -} - -@end From cea4fae148c312741e03d69c877c734cb116cd9f Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 22 Feb 2015 14:26:13 +0000 Subject: [PATCH 45/96] Various tweaks and fixes. --- README.md | 36 ++++++----- SCXcodeMinimap.xcodeproj/project.pbxproj | 6 -- .../DVTTextDocumentLocation+SCXcodeMinimap.h | 13 ---- .../DVTTextDocumentLocation+SCXcodeMinimap.m | 61 ------------------- SCXcodeMinimap/SCXcodeMinimapView.m | 16 +++-- 5 files changed, 32 insertions(+), 100 deletions(-) delete mode 100644 SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.h delete mode 100644 SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.m diff --git a/README.md b/README.md index 19c9ae9..1197667 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,34 @@ -# SCXcodeMiniMap +# SCXcodeMinimap v2.0 +SCXcodeMiniMap is a Xcode plugin that adds a source editor Minimap to Xcode. -SCXcodeMiniMap is a plugin that adds a source editor MiniMap to Xcode. +Version 2.0 has been rewritten from the ground up to address performance issues (delays on large source files - 1000+ lines) and for creating a better base to build upon. As such, the following new features are now supported: -![SCXcodeMiniMap](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/SCXcodeMiniMapv1.3.png) +#### New Features +- Faster syntax highlighting +- Shows code foldings +- Comment and preprocessor directive highlighting +- Breakpoint highlighting +- All highlighting options are also available for the main Xcode editor +- Custom themes +- All options are accessible from the View/Minimap menu item -## Features -- It works with an unlimited number of opened editors, including the assistant and version editors -- The minimap and its selection view scroll seamlessly with the editor and provide a nice way of figuring out the current position in the document -- Full syntax highlighting -- It blends with the currently selected theme -- View menu item for showing/hiding it (Ctrl+Shift+M) -- Size configurable via the kDefaultZoomLevel parameter (defaults to 10% out of the editor's size) +#### Screenshots +Without editor highlighting | With editor highlighting +:--------------------------:|:--------------------------: +![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-01.png) | ![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-03.png) | +![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-02.png) | ![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-04.png) | -## Installation -- Build the project and restart Xcode or +#### Installation +- Through [Alcatraz](https://github.com/supermarin/Alcatraz) + +- Download the sources, build the project and restart Xcode - Download SCXcodeMinimap.xcplugin.zip from the releases tab, unzip and move it to the Xcode plugins folder ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeMinimap.xcplugin - If you encounter any issues you can uninstall it by removing the ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeMinimap.xcplugin folder -## License +#### License SCXcodeMiniMap is released under the GNU GENERAL PUBLIC LICENSE (see the LICENSE file) -## Contact +#### Contact Any suggestions or improvements are more than welcome. Feel free to contact me at [stefan.ceriu@yahoo.com](mailto:stefan.ceriu@yahoo.com) or [@stefanceriu](https://twitter.com/stefanceriu). \ No newline at end of file diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 8a80103..1686076 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 18143CC41A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18143CC31A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m */; }; 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */; }; 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */; }; 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 184C118E1A741136002A7C65 /* DVTFoundation.framework */; }; @@ -26,8 +25,6 @@ /* Begin PBXFileReference section */ 180F0C651A98AE1500E97254 /* DVTAnnotationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationManager.h; sourceTree = ""; }; 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 18143CC21A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTTextDocumentLocation+SCXcodeMinimap.h"; sourceTree = ""; }; - 18143CC31A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTTextDocumentLocation+SCXcodeMinimap.m"; sourceTree = ""; }; 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTFoldingManager.h; sourceTree = ""; }; 184407641A8F7B1900C530CF /* DVTTextDocumentLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextDocumentLocation.h; sourceTree = ""; }; 184407651A8F7B3E00C530CF /* DVTDocumentLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTDocumentLocation.h; sourceTree = ""; }; @@ -186,8 +183,6 @@ 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */, 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, - 18143CC21A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.h */, - 18143CC31A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m */, 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */, 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, @@ -268,7 +263,6 @@ buildActionMask = 2147483647; files = ( 188FCC8A1A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m in Sources */, - 18143CC41A98A83700BD8DD8 /* DVTTextDocumentLocation+SCXcodeMinimap.m in Sources */, 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */, 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, diff --git a/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.h b/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.h deleted file mode 100644 index 1308839..0000000 --- a/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// DVTTextDocumentLocation+SCXcodeMinimap.h -// SCXcodeMinimap -// -// Created by Stefan Ceriu on 21/02/2015. -// Copyright (c) 2015 Stefan Ceriu. All rights reserved. -// - -#import "DVTTextDocumentLocation.h" - -@interface DVTTextDocumentLocation (SCXcodeMinimap) - -@end diff --git a/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.m b/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.m deleted file mode 100644 index 3ae574f..0000000 --- a/SCXcodeMinimap/DVTTextDocumentLocation+SCXcodeMinimap.m +++ /dev/null @@ -1,61 +0,0 @@ -// -// DVTTextDocumentLocation+SCXcodeMinimap.m -// SCXcodeMinimap -// -// Created by Stefan Ceriu on 21/02/2015. -// Copyright (c) 2015 Stefan Ceriu. All rights reserved. -// - -#import "DVTTextDocumentLocation+SCXcodeMinimap.h" -#import - -@implementation DVTTextDocumentLocation (SCXcodeMinimap) - -static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { - Method originalMethod = class_getInstanceMethod(class, originalSelector); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { - class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); - } else { - method_exchangeImplementations(originalMethod, swizzledMethod); - } -} - -+ (void)load -{ -// sc_swizzleInstanceMethod(self, @selector(initWithDocumentURL:timestamp:startingColumnNumber:endingColumnNumber:startingLineNumber:endingLineNumber:characterRange:), @selector(sc_initWithDocumentURL:timestamp:startingColumnNumber:endingColumnNumber:startingLineNumber:endingLineNumber:characterRange:)); -// -// sc_swizzleInstanceMethod(self, @selector(initWithDocumentURL:timestamp:), @selector(sc_initWithDocumentURL:timestamp:)); -// sc_swizzleInstanceMethod(self, @selector(initWithDocumentURL:timestamp:characterRange:), @selector(sc_initWithDocumentURL:timestamp:characterRange:)); -// sc_swizzleInstanceMethod(self, @selector(initWithDocumentURL:timestamp:lineRange:), @selector(sc_initWithDocumentURL:timestamp:lineRange:)); -} - -- (id)sc_initWithDocumentURL:(id)arg1 timestamp:(id)arg2 startingColumnNumber:(long long)arg3 endingColumnNumber:(long long)arg4 startingLineNumber:(long long)arg5 endingLineNumber:(long long)arg6 characterRange:(struct _NSRange)arg7 -{ - NSLog(@"%@", [NSThread callStackSymbols]); - - return [self sc_initWithDocumentURL:arg1 timestamp:arg2 startingColumnNumber:arg3 endingColumnNumber:arg4 startingLineNumber:arg5 endingLineNumber:arg6 characterRange:arg7]; -} - -- (id)sc_initWithDocumentURL:(id)arg1 timestamp:(id)arg2 -{ - NSLog(@"%@", [NSThread callStackSymbols]); - - return [self sc_initWithDocumentURL:arg1 timestamp:arg2]; -} - -- (id)sc_initWithDocumentURL:(id)arg1 timestamp:(id)arg2 characterRange:(struct _NSRange)arg3 -{ - NSLog(@"%@", [NSThread callStackSymbols]); - - return [self sc_initWithDocumentURL:arg1 timestamp:arg2 characterRange:arg3]; -} - -- (id)sc_initWithDocumentURL:(id)arg1 timestamp:(id)arg2 lineRange:(struct _NSRange)arg3 -{ - NSLog(@"%@", [NSThread callStackSymbols]); - - return [self sc_initWithDocumentURL:arg1 timestamp:arg2 lineRange:arg3]; -} - -@end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index ca49511..9f22f24 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -214,11 +214,11 @@ - (void)setVisible:(BOOL)visible if(visible) { [self updateOffset]; [self.textView.layoutManager setDelegate:self]; - - BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; - if(editorHighlightingEnabled) { - [self.editorTextView.layoutManager setDelegate:self]; - } + } + + BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; + if(editorHighlightingEnabled) { + [self.editorTextView.layoutManager setDelegate:self]; } } @@ -230,7 +230,11 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager atCharacterIndex:(NSUInteger)charIndex effectiveRange:(NSRangePointer)effectiveCharRange { - if(!toScreen || self.hidden) { + if(!toScreen) { + return nil; + } + + if(self.hidden && [layoutManager isEqual:self.textView.layoutManager]) { return nil; } From 67546f6b4e8b8980727d6e373f8bae8bd4f2c196 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 22 Feb 2015 18:41:49 +0000 Subject: [PATCH 46/96] - cleaned up autoresizing masks and fixed sizing issues + exposed minimap size in the minimap menu - fixed retain cycles --- SCXcodeMinimap/SCXcodeMinimap.h | 5 +- SCXcodeMinimap/SCXcodeMinimap.m | 47 +++++++++++---- SCXcodeMinimap/SCXcodeMinimapView.h | 4 +- SCXcodeMinimap/SCXcodeMinimapView.m | 89 +++++++++++++++++++---------- 4 files changed, 98 insertions(+), 47 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index 3e4c817..7241a14 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -8,11 +8,12 @@ #import -const CGFloat kDefaultZoomLevel; - extern NSString *const SCXcodeMinimapShouldDisplayChangeNotification; extern NSString *const SCXcodeMinimapShouldDisplayKey; +extern NSString *const SCXcodeMinimapZoomLevelChangeNotification; +extern NSString *const SCXcodeMinimapZoomLevelKey; + extern NSString *const SCXcodeMinimapHighlightBreakpointsChangeNotification; extern NSString *const SCXcodeMinimapShouldHighlightBreakpointsKey; diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 358ad5b..7bda3fe 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -8,7 +8,6 @@ #import "SCXcodeMinimap.h" #import "SCXcodeMinimapView.h" -#import #import "IDESourceCodeEditor.h" #import "DVTSourceTextView.h" @@ -16,13 +15,14 @@ #import "DVTPreferenceSetManager.h" #import "DVTFontAndColorTheme.h" -const CGFloat kDefaultZoomLevel = 0.1f; - NSString *const IDESourceCodeEditorDidFinishSetupNotification = @"IDESourceCodeEditorDidFinishSetup"; NSString *const SCXcodeMinimapShouldDisplayChangeNotification = @"SCXcodeMinimapShouldDisplayChangeNotification"; NSString *const SCXcodeMinimapShouldDisplayKey = @"SCXcodeMinimapShouldDisplayKey"; +NSString *const SCXcodeMinimapZoomLevelChangeNotification = @"SCXcodeMinimapZoomLevelChangeNotification"; +NSString *const SCXcodeMinimapZoomLevelKey = @"SCXcodeMinimapZoomLevelKey"; + NSString *const SCXcodeMinimapHighlightBreakpointsChangeNotification = @"SCXcodeMinimapHighlightBreakpointsChangeNotification"; NSString *const SCXcodeMinimapShouldHighlightBreakpointsKey = @"SCXcodeMinimapShouldHighlightBreakpointsKey"; @@ -81,7 +81,8 @@ - (id)init - (void)registerUserDefaults { - NSDictionary *userDefaults = @{SCXcodeMinimapShouldDisplayKey : @(YES), + NSDictionary *userDefaults = @{SCXcodeMinimapZoomLevelKey : @(0.1f), + SCXcodeMinimapShouldDisplayKey : @(YES), SCXcodeMinimapShouldHighlightBreakpointsKey : @(YES), SCXcodeMinimapShouldHighlightCommentsKey : @(YES), SCXcodeMinimapShouldHighlightPreprocessorKey : @(YES)}; @@ -111,6 +112,20 @@ - (void)createMenuItem [showHideMinimapItem setTarget:self]; [minimapMenu addItem:showHideMinimapItem]; + NSMenuItem *minimapSizeItem = [[NSMenuItem alloc] init]; + NSSlider *sizeSlider = [[NSSlider alloc] initWithFrame:CGRectMake(0, 0, 150, 30)]; + [sizeSlider setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin]; + [sizeSlider setMaxValue:0.35f]; + [sizeSlider setMinValue:0.05f]; + [sizeSlider setTarget:self]; + [sizeSlider setAction:@selector(onSizeSliderValueChanged:)]; + + CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue]; + [sizeSlider setDoubleValue:zoomLevel]; + + [minimapSizeItem setView:sizeSlider]; + [minimapMenu addItem:minimapSizeItem]; + BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]; [showHideMinimapItem setTitle:(shouldDisplayMinimap ? kHideMinimapMenuItemTitle : kShowMinimapMenuItemTitle)]; @@ -294,6 +309,17 @@ - (void)setMinimapTheme:(NSMenuItem *)sender [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapThemeChangeNotification object:nil]; } +- (void)onSizeSliderValueChanged:(NSSlider *)sender +{ + NSEvent *event = [[NSApplication sharedApplication] currentEvent]; + if(event.type != NSLeftMouseUp) { + return; + } + + [[NSUserDefaults standardUserDefaults] setObject:@(sender.doubleValue) forKey:SCXcodeMinimapZoomLevelKey]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapZoomLevelChangeNotification object:nil]; +} + #pragma mark - Xcode Notification - (void)onDidFinishSetup:(NSNotification*)sender @@ -304,15 +330,12 @@ - (void)onDidFinishSetup:(NSNotification*)sender } IDESourceCodeEditor *editor = (IDESourceCodeEditor *)[sender object]; - [editor.textView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewWidthSizable | NSViewHeightSizable]; - - CGFloat width = editor.textView.bounds.size.width * kDefaultZoomLevel; - NSRect miniMapScrollViewFrame = NSMakeRect(editor.containerView.bounds.size.width - width, 0, width, editor.scrollView.bounds.size.height); - - SCXcodeMinimapView *miniMapView = [[SCXcodeMinimapView alloc] initWithFrame:miniMapScrollViewFrame editor:editor]; - [editor.containerView addSubview:miniMapView]; + [editor.textView setAutoresizingMask:NSViewMaxXMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable]; + [editor.scrollView setAutoresizingMask:NSViewMaxXMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable]; + [editor.containerView setAutoresizingMask:NSViewMaxXMargin | NSViewMaxYMargin | NSViewWidthSizable | NSViewHeightSizable]; - [miniMapView setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; + SCXcodeMinimapView *minimapView = [[SCXcodeMinimapView alloc] initWithEditor:editor]; + [editor.containerView addSubview:minimapView]; } @end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.h b/SCXcodeMinimap/SCXcodeMinimapView.h index d0cbbe5..d90941d 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.h +++ b/SCXcodeMinimap/SCXcodeMinimapView.h @@ -12,8 +12,6 @@ @interface SCXcodeMinimapView : NSView -- (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor; - -- (void)setVisible:(BOOL)visible; +- (instancetype)initWithEditor:(IDESourceCodeEditor *)editor; @end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 9f22f24..454a8ec 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -68,9 +68,8 @@ @implementation SCXcodeMinimapTheme @interface SCXcodeMinimapView () -@property (nonatomic, strong) IDESourceCodeEditor *editor; -@property (nonatomic, strong) NSScrollView *editorScrollView; -@property (nonatomic, strong) DVTSourceTextView *editorTextView; +@property (nonatomic, weak) IDESourceCodeEditor *editor; +@property (nonatomic, assign) DVTSourceTextView *editorTextView; @property (nonatomic, strong) NSScrollView *scrollView; @property (nonatomic, strong) DVTSourceTextView *textView; @@ -92,47 +91,44 @@ @implementation SCXcodeMinimapView - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; + [self.textView.textStorage removeLayoutManager:self.textView.layoutManager]; } -- (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor +- (instancetype)initWithEditor:(IDESourceCodeEditor *)editor { - if (self = [super initWithFrame:frame]) + if (self = [super init]) { self.editor = editor; - self.editorScrollView = editor.scrollView; self.editorTextView = editor.textView; [self.editorTextView.foldingManager setDelegate:self]; [self setWantsLayer:YES]; - [self setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; + [self setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin | NSViewWidthSizable | NSViewHeightSizable]; self.scrollView = [[NSScrollView alloc] initWithFrame:self.bounds]; - [self.scrollView setAutoresizingMask:NSViewMinXMargin | NSViewHeightSizable]; + [self.scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [self.scrollView setDrawsBackground:NO]; + [self.scrollView setMinMagnification:0.0f]; + [self.scrollView setMaxMagnification:1.0f]; + [self.scrollView setAllowsMagnification:NO]; [self.scrollView setHorizontalScrollElasticity:NSScrollElasticityNone]; [self.scrollView setVerticalScrollElasticity:NSScrollElasticityNone]; [self addSubview:self.scrollView]; - self.textView = [[DVTSourceTextView alloc] initWithFrame:self.editorTextView.bounds]; + self.textView = [[DVTSourceTextView alloc] init]; [self.textView setTextStorage:self.editorTextView.textStorage]; [self.textView setEditable:NO]; [self.textView setSelectable:NO]; [self.scrollView setDocumentView:self.textView]; - [self.scrollView setAllowsMagnification:YES]; - [self.scrollView setMinMagnification:kDefaultZoomLevel]; - [self.scrollView setMaxMagnification:kDefaultZoomLevel]; - [self.scrollView setMagnification:kDefaultZoomLevel]; - self.selectionView = [[SCXcodeMinimapSelectionView alloc] init]; [self.textView addSubview:_selectionView]; [self updateTheme]; - BOOL shouldHighlightBreakpoints = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpointsKey] boolValue]; if(shouldHighlightBreakpoints) { @@ -148,13 +144,20 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor } BOOL shouldHideEditorVerticalScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]; - [self.editorScrollView setHasVerticalScroller:!shouldHideEditorVerticalScroller]; + [self.editor.scrollView setHasVerticalScroller:!shouldHideEditorVerticalScroller]; + + // Notifications __weak typeof(self) weakSelf = self; [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapShouldDisplayChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { [weakSelf setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; }]; + [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapZoomLevelChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf updateSize]; + [weakSelf invalidateDisplayForVisibleRange]; + }]; + [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightBreakpointsChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { [weakSelf invalidateDisplayForVisibleRange]; }]; @@ -180,7 +183,7 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor }]; [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf.editorScrollView setHasVerticalScroller:![[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]]; + [weakSelf.editor.scrollView setHasVerticalScroller:![[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]]; }]; [[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapThemeChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -201,20 +204,21 @@ - (instancetype)initWithFrame:(NSRect)frame editor:(IDESourceCodeEditor *)editor return self; } +- (void)viewDidMoveToWindow +{ + [self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; +} + #pragma mark - Show/Hide - (void)setVisible:(BOOL)visible { - self.hidden = !visible; + self.hidden = !visible; - NSRect editorTextViewFrame = self.editorScrollView.frame; - editorTextViewFrame.size.width = self.editorScrollView.superview.frame.size.width - (visible ? self.bounds.size.width : 0.0f); - self.editorScrollView.frame = editorTextViewFrame; + [self updateSize]; + [self updateOffset]; - if(visible) { - [self updateOffset]; - [self.textView.layoutManager setDelegate:self]; - } + [self.textView.layoutManager setDelegate:(self.hidden ? nil : self)]; BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; if(editorHighlightingEnabled) { @@ -361,10 +365,10 @@ - (void)updateOffset CGFloat editorTextHeight = CGRectGetHeight([self.editorTextView.layoutManager usedRectForTextContainer:self.editorTextView.textContainer]); CGFloat minimapTextHeight = CGRectGetHeight([self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer]); - CGFloat adjustedEditorContentHeight = editorTextHeight - CGRectGetHeight(self.editorScrollView.bounds); + CGFloat adjustedEditorContentHeight = editorTextHeight - CGRectGetHeight(self.editor.scrollView.bounds); CGFloat adjustedMinimapContentHeight = minimapTextHeight - (CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)); - NSRect selectionViewFrame = NSMakeRect(0, 0, self.bounds.size.width * (1 / self.scrollView.magnification), self.editorScrollView.visibleRect.size.height); + NSRect selectionViewFrame = NSMakeRect(0, 0, self.bounds.size.width * (1 / self.scrollView.magnification), self.editor.scrollView.visibleRect.size.height); if(adjustedEditorContentHeight == 0.0f) { [self.selectionView setFrame:selectionViewFrame]; @@ -372,13 +376,13 @@ - (void)updateOffset } CGFloat ratio = (adjustedMinimapContentHeight / adjustedEditorContentHeight) * (1 / self.scrollView.magnification); - CGPoint offset = NSMakePoint(0, MAX(0, floorf(self.editorScrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification))); + CGPoint offset = NSMakePoint(0, MAX(0, floorf(self.editor.scrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification))); [self.scrollView.documentView scrollPoint:offset]; ratio = (minimapTextHeight - self.selectionView.bounds.size.height) / adjustedEditorContentHeight; - selectionViewFrame.origin.y = self.editorScrollView.contentView.bounds.origin.y * ratio; + selectionViewFrame.origin.y = self.editor.scrollView.contentView.bounds.origin.y * ratio; [self.selectionView setFrame:selectionViewFrame]; } @@ -470,11 +474,36 @@ - (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme return minimapTheme; } -#pragma mark - Autoresizing +#pragma mark - Sizing + +- (void)updateSize +{ + CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue]; + + CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel); + + NSRect editorScrollViewFrame = self.editor.scrollView.frame; + editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth + 10.0f; + self.editor.scrollView.frame = editorScrollViewFrame; + + [self setFrame:NSMakeRect(CGRectGetMaxX(editorScrollViewFrame), 0, minimapWidth, CGRectGetHeight(self.editor.containerView.bounds))]; + + CGRect frame = self.textView.bounds; + frame.size.width = CGRectGetWidth(self.editorTextView.bounds); + [self.textView setFrame:frame]; + + CGFloat actualZoomLevel = CGRectGetWidth(self.bounds) / CGRectGetWidth(self.editor.scrollView.bounds); + [self.scrollView setMagnification:actualZoomLevel]; +} - (void)resizeWithOldSuperviewSize:(NSSize)oldSize { [super resizeWithOldSuperviewSize:oldSize]; + + CGRect frame = self.textView.bounds; + frame.size.width = CGRectGetWidth(self.editorTextView.bounds); + [self.textView setFrame:frame]; + [self updateOffset]; } From 52ef89244b235c19f46adf1a5d44485f8b1abdf1 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 22 Feb 2015 21:31:28 +0000 Subject: [PATCH 47/96] Added size slider menu item and fixed minimap scrollView magnification. --- SCXcodeMinimap/SCXcodeMinimap.m | 26 +++++++++++++++++++------- SCXcodeMinimap/SCXcodeMinimapView.m | 8 ++++---- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 7bda3fe..1ab7d80 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -112,18 +112,30 @@ - (void)createMenuItem [showHideMinimapItem setTarget:self]; [minimapMenu addItem:showHideMinimapItem]; - NSMenuItem *minimapSizeItem = [[NSMenuItem alloc] init]; - NSSlider *sizeSlider = [[NSSlider alloc] initWithFrame:CGRectMake(0, 0, 150, 30)]; - [sizeSlider setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin]; + [minimapMenu addItem:[NSMenuItem separatorItem]]; + + NSView *sizeView = [[NSView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 200.0f, 20.0f)]; + [sizeView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin]; + + NSTextField *sizeViewTitleLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(18.0f, 0.0f, 50.0f, 20.0f)]; + [sizeViewTitleLabel setStringValue:@"Size"]; + [sizeViewTitleLabel setFont:[NSFont systemFontOfSize:14]]; + [sizeViewTitleLabel setBezeled:NO]; + [sizeViewTitleLabel setDrawsBackground:NO]; + [sizeViewTitleLabel setEditable:NO]; + [sizeViewTitleLabel setSelectable:NO]; + [sizeView addSubview:sizeViewTitleLabel]; + + NSSlider *sizeSlider = [[NSSlider alloc] initWithFrame:CGRectMake(60.0f, 0.0f, 136.0f, 20.0f)]; [sizeSlider setMaxValue:0.35f]; [sizeSlider setMinValue:0.05f]; [sizeSlider setTarget:self]; [sizeSlider setAction:@selector(onSizeSliderValueChanged:)]; + [sizeSlider setDoubleValue:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue]]; + [sizeView addSubview:sizeSlider]; - CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue]; - [sizeSlider setDoubleValue:zoomLevel]; - - [minimapSizeItem setView:sizeSlider]; + NSMenuItem *minimapSizeItem = [[NSMenuItem alloc] init]; + [minimapSizeItem setView:sizeView]; [minimapMenu addItem:minimapSizeItem]; BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 454a8ec..77a69a2 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -125,7 +125,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self.scrollView setDocumentView:self.textView]; self.selectionView = [[SCXcodeMinimapSelectionView alloc] init]; - [self.textView addSubview:_selectionView]; + [self.textView addSubview:self.selectionView]; [self updateTheme]; @@ -483,7 +483,7 @@ - (void)updateSize CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel); NSRect editorScrollViewFrame = self.editor.scrollView.frame; - editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth + 10.0f; + editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth; self.editor.scrollView.frame = editorScrollViewFrame; [self setFrame:NSMakeRect(CGRectGetMaxX(editorScrollViewFrame), 0, minimapWidth, CGRectGetHeight(self.editor.containerView.bounds))]; @@ -491,8 +491,8 @@ - (void)updateSize CGRect frame = self.textView.bounds; frame.size.width = CGRectGetWidth(self.editorTextView.bounds); [self.textView setFrame:frame]; - - CGFloat actualZoomLevel = CGRectGetWidth(self.bounds) / CGRectGetWidth(self.editor.scrollView.bounds); + + CGFloat actualZoomLevel = CGRectGetWidth(self.bounds) / CGRectGetWidth(self.editor.textView.bounds); [self.scrollView setMagnification:actualZoomLevel]; } From fb84f4249ef02b434bf28f8923270eedcebad36a Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 24 Feb 2015 21:23:39 +0000 Subject: [PATCH 48/96] - added breakpoint disabled state highlighting - reduced number of times breakpoint ranges are calculated - added compatibility plugin for Xcode 6.3 (#38) --- SCXcodeMinimap.xcodeproj/project.pbxproj | 8 ++ .../DBGBreakpointAnnotation+SCXcodeMinimap.h | 24 ++++++ .../DBGBreakpointAnnotation+SCXcodeMinimap.m | 74 ++++++++++++++++++ ...akpointAnnotationProvider+SCXcodeMinimap.h | 2 +- ...akpointAnnotationProvider+SCXcodeMinimap.m | 51 +++++++++--- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + SCXcodeMinimap/SCXcodeMinimapView.m | 25 ++++-- SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h | 78 +++++++++++++++++++ 8 files changed, 245 insertions(+), 18 deletions(-) create mode 100644 SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m create mode 100644 SCXcodeMinimap/Xcode Headers/IDEBreakpoint.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 1686076..0b8ee21 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ 1883080C1A7411930005DF40 /* IDESourceEditor.ideplugin in Resources */ = {isa = PBXBuildFile; fileRef = 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */; }; 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 1883080F1A7411A70005DF40 /* IDESourceEditor */; }; 188FCC8A1A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */; }; + 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */; }; 18C999FF1A98B04C0008AF54 /* DebuggerUI in Frameworks */ = {isa = PBXBuildFile; fileRef = 18C999FE1A98B04C0008AF54 /* DebuggerUI */; }; 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */; }; 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18FE09B51707639E00118FEB /* Cocoa.framework */; }; @@ -61,11 +62,14 @@ 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h"; sourceTree = ""; }; 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DBGBreakpointAnnotationProvider+SCXcodeMinimap.m"; sourceTree = ""; }; 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTPreferenceSetManager.h; sourceTree = ""; }; + 18C2EA5A1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBGBreakpointAnnotation+SCXcodeMinimap.h"; sourceTree = ""; }; + 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DBGBreakpointAnnotation+SCXcodeMinimap.m"; sourceTree = ""; }; 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFoldingLayoutManager.h; sourceTree = ""; }; 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTLayoutManager.h; sourceTree = ""; }; 18C999FC1A98AF370008AF54 /* DBGBreakpointAnnotationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotationProvider.h; sourceTree = ""; }; 18C999FD1A98AF580008AF54 /* DVTAnnotationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationProvider.h; sourceTree = ""; }; 18C999FE1A98B04C0008AF54 /* DebuggerUI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = DebuggerUI; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS/DebuggerUI; sourceTree = ""; }; + 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpoint.h; sourceTree = ""; }; 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 18FE09B51707639E00118FEB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; @@ -134,6 +138,7 @@ 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */, 184C11801A740F8A002A7C65 /* IDEViewController.h */, + 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */, ); path = "Xcode Headers"; sourceTree = ""; @@ -183,6 +188,8 @@ 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */, 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, + 18C2EA5A1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.h */, + 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */, 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */, 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, @@ -266,6 +273,7 @@ 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */, 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, + 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.h b/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.h new file mode 100644 index 0000000..d2bbf78 --- /dev/null +++ b/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.h @@ -0,0 +1,24 @@ +// +// DBGBreakpointAnnotation+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 24/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DBGBreakpointAnnotation.h" + +@protocol DBGBreakpointAnnotationDelegate; + +@interface DBGBreakpointAnnotation (SCXcodeMinimap) + +@property (nonatomic, readonly) BOOL enabled; +@property (nonatomic, weak) id minimapDelegate; + +@end + +@protocol DBGBreakpointAnnotationDelegate + +- (void)breakpointAnnotationDidChangeState:(DBGBreakpointAnnotation *)annotation; + +@end diff --git a/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m new file mode 100644 index 0000000..1e1cefe --- /dev/null +++ b/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m @@ -0,0 +1,74 @@ +// +// DBGBreakpointAnnotation+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 24/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DBGBreakpointAnnotation+SCXcodeMinimap.h" +#import + +#import "IDEFileBreakpoint.h" + +@implementation DBGBreakpointAnnotation (SCXcodeMinimap) + +static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { + Method originalMethod = class_getInstanceMethod(class, originalSelector); + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); + if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { + class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} + ++ (void)load +{ + sc_swizzleInstanceMethod(self, @selector(_redisplay), @selector(sc_redisplay)); + sc_swizzleInstanceMethod(self, @selector(adjustParagraphIndexBy:lengthBy:), @selector(sc_adjustParagraphIndexBy:lengthBy:)); +} + +- (id)minimapDelegate +{ + return objc_getAssociatedObject(self, @selector(minimapDelegate)); +} + +- (void)setMinimapDelegate:(id)minimapDelegate +{ + objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); +} + +- (BOOL)enabled +{ + if([self.representedObject isKindOfClass:[IDEFileBreakpoint class]]) { + IDEFileBreakpoint *fileBreakpoint = (IDEFileBreakpoint *)self.representedObject; + return fileBreakpoint.shouldBeEnabled; + } + + return NO; +} + +- (void)sc_redisplay +{ + [self sc_redisplay]; + + if([self.representedObject isKindOfClass:[IDEFileBreakpoint class]]) { + if([self.minimapDelegate respondsToSelector:@selector(breakpointAnnotationDidChangeState:)]) { + [self.minimapDelegate breakpointAnnotationDidChangeState:self]; + } + } +} + +- (void)sc_adjustParagraphIndexBy:(long long)arg1 lengthBy:(long long)arg2 +{ + [self sc_adjustParagraphIndexBy:arg1 lengthBy:arg2]; + + if([self.representedObject isKindOfClass:[IDEFileBreakpoint class]]) { + if([self.minimapDelegate respondsToSelector:@selector(breakpointAnnotationDidChangeState:)]) { + [self.minimapDelegate breakpointAnnotationDidChangeState:self]; + } + } +} + +@end diff --git a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.h b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.h index 8f874e2..1707764 100644 --- a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.h +++ b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.h @@ -12,7 +12,7 @@ @interface DBGBreakpointAnnotationProvider (SCXcodeMinimap) -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id minimapDelegate; @end diff --git a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m index ad5f660..6d503d8 100644 --- a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m +++ b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m @@ -8,7 +8,8 @@ #import "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h" #import -#import "DBGBreakpointAnnotation.h" + +#import "DBGBreakpointAnnotation+SCXcodeMinimap.h" @implementation DBGBreakpointAnnotationProvider (SCXcodeMinimap) @@ -29,33 +30,61 @@ + (void)load sc_swizzleInstanceMethod(self, @selector(didMoveAnnotation:), @selector(sc_didMoveAnnotation:)); } -- (void)setDelegate:(id)delegate +- (void)setMinimapDelegate:(id)minimapDelegate { - objc_setAssociatedObject(self, @selector(delegate), delegate, OBJC_ASSOCIATION_ASSIGN); + for(DBGBreakpointAnnotation *annotation in self.annotations) { + [annotation setMinimapDelegate:(id)self]; + } + + objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); } -- (id)delegate +- (id)minimapDelegate { - return objc_getAssociatedObject(self, @selector(delegate)); + return objc_getAssociatedObject(self, @selector(minimapDelegate)); } - (void)sc_addAnnotationForFileBreakpoint:(id)arg1 { [self sc_addAnnotationForFileBreakpoint:arg1]; - [self.delegate breakpointAnnotationProviderDidChangeBreakpoints:self]; + for(DBGBreakpointAnnotation *annotation in self.annotations) { + if([annotation.representedObject isEqual:arg1]) { + [annotation setMinimapDelegate:(id)self]; + } + } + + if([self.minimapDelegate respondsToSelector:@selector(breakpointAnnotationProviderDidChangeBreakpoints:)]) { + [self.minimapDelegate breakpointAnnotationProviderDidChangeBreakpoints:self]; + } +} + +- (void)sc_removeAnnotation:(DBGBreakpointAnnotation *)annotation +{ + [annotation setMinimapDelegate:nil]; + [self sc_removeAnnotation:annotation]; + + if([self.minimapDelegate respondsToSelector:@selector(breakpointAnnotationProviderDidChangeBreakpoints:)]) { + [self.minimapDelegate breakpointAnnotationProviderDidChangeBreakpoints:self]; + } } -- (void)sc_removeAnnotation:(id)arg1 +- (void)sc_didMoveAnnotation:(DBGBreakpointAnnotation *)annotation { - [self sc_removeAnnotation:arg1]; + [self sc_didMoveAnnotation:annotation]; - [self.delegate breakpointAnnotationProviderDidChangeBreakpoints:self]; + if([self.minimapDelegate respondsToSelector:@selector(breakpointAnnotationProviderDidChangeBreakpoints:)]) { + [self.minimapDelegate breakpointAnnotationProviderDidChangeBreakpoints:self]; + } } -- (void)sc_didMoveAnnotation:(id)arg1 +#pragma mark - DBGBreakpointAnnotationDelegate + +- (void)breakpointAnnotationDidChangeState:(DBGBreakpointAnnotation *)annotation { - [self.delegate breakpointAnnotationProviderDidChangeBreakpoints:self]; + if([self.minimapDelegate respondsToSelector:@selector(breakpointAnnotationProviderDidChangeBreakpoints:)]) { + [self.minimapDelegate breakpointAnnotationProviderDidChangeBreakpoints:self]; + } } @end diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 530898e..3d87f95 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -31,6 +31,7 @@ 63FC1C47-140D-42B0-BB4D-A10B2D225574 37B30044-3B14-46BA-ABAA-F01000C27B63 640F884E-CE55-4B40-87C0-8869546CAB7A + 992275C1-432A-4CF7-B659-D84ED6D42D3F NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 77a69a2..c1af0b0 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -27,6 +27,7 @@ #import "DVTAnnotationManager.h" #import "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h" +#import "DBGBreakpointAnnotation+SCXcodeMinimap.h" #import "DBGBreakpointAnnotation.h" const CGFloat kBackgroundColorShadowLevel = 0.1f; @@ -80,6 +81,8 @@ @interface SCXcodeMinimapView () Date: Wed, 25 Feb 2015 08:08:38 +0000 Subject: [PATCH 49/96] Fixes one crash and cleans up notification observers on dealloc. --- .../DBGBreakpointAnnotation+SCXcodeMinimap.m | 1 + ...akpointAnnotationProvider+SCXcodeMinimap.m | 1 + SCXcodeMinimap/SCXcodeMinimapView.m | 81 +++++++++++-------- 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m index 1e1cefe..cbbf064 100644 --- a/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m +++ b/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m @@ -12,6 +12,7 @@ #import "IDEFileBreakpoint.h" @implementation DBGBreakpointAnnotation (SCXcodeMinimap) +@dynamic minimapDelegate; static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { Method originalMethod = class_getInstanceMethod(class, originalSelector); diff --git a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m index 6d503d8..c2e9d8c 100644 --- a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m +++ b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m @@ -12,6 +12,7 @@ #import "DBGBreakpointAnnotation+SCXcodeMinimap.h" @implementation DBGBreakpointAnnotationProvider (SCXcodeMinimap) +@dynamic minimapDelegate; static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { Method originalMethod = class_getInstanceMethod(class, originalSelector); diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index c1af0b0..bff6445 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -70,7 +70,7 @@ @implementation SCXcodeMinimapTheme @interface SCXcodeMinimapView () @property (nonatomic, weak) IDESourceCodeEditor *editor; -@property (nonatomic, assign) DVTSourceTextView *editorTextView; +@property (nonatomic, strong) DVTSourceTextView *editorTextView; @property (nonatomic, strong) NSScrollView *scrollView; @property (nonatomic, strong) DVTSourceTextView *textView; @@ -87,15 +87,20 @@ @interface SCXcodeMinimapView () Date: Wed, 25 Feb 2015 10:46:04 +0000 Subject: [PATCH 50/96] - reduced number of syntax highlighting calls - fixed show/hide minimap menu item state - fixed crash when being removed from the superview --- SCXcodeMinimap/SCXcodeMinimap.m | 2 +- SCXcodeMinimap/SCXcodeMinimapView.m | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 1ab7d80..b4a4f0e 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -247,7 +247,7 @@ - (void)toggleMinimap:(NSMenuItem *)sender { BOOL shouldDisplayMinimap = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]; - [sender setTitle:(shouldDisplayMinimap ? kHideMinimapMenuItemTitle : kShowMinimapMenuItemTitle)]; + [sender setTitle:(!shouldDisplayMinimap ? kHideMinimapMenuItemTitle : kShowMinimapMenuItemTitle)]; [[NSUserDefaults standardUserDefaults] setObject:@(!shouldDisplayMinimap) forKey:SCXcodeMinimapShouldDisplayKey]; [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapShouldDisplayChangeNotification object:nil]; } diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index bff6445..8624328 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -221,6 +221,10 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor - (void)viewDidMoveToWindow { + if(self.window == nil) { + return; + } + [self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; } @@ -231,7 +235,6 @@ - (void)setVisible:(BOOL)visible self.hidden = !visible; [self updateSize]; - [self updateOffset]; [self.textView.layoutManager setDelegate:(self.hidden ? nil : self)]; @@ -516,12 +519,16 @@ - (void)updateSize CGFloat actualZoomLevel = CGRectGetWidth(self.bounds) / CGRectGetWidth(self.editor.textView.bounds); [self.scrollView setMagnification:actualZoomLevel]; + + [self updateOffset]; } - (void)resizeWithOldSuperviewSize:(NSSize)oldSize { [super resizeWithOldSuperviewSize:oldSize]; + self.shouldAllowFullSyntaxHighlight = NO; + CGRect frame = self.textView.bounds; frame.size.width = CGRectGetWidth(self.editorTextView.bounds); [self.textView setFrame:frame]; From d490291734c14572d7c850ce7a5efdd5aaa90495 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 27 Feb 2015 07:33:37 +0000 Subject: [PATCH 51/96] Fixes #39 - Alcatraz support. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 0b8ee21..d05e95f 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 184C118E1A741136002A7C65 /* DVTFoundation.framework */; }; 1876135F1A77A74300974BE1 /* IDEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1876135E1A77A74300974BE1 /* IDEKit.framework */; }; 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 188308091A7411830005DF40 /* DVTKit.framework */; }; - 1883080C1A7411930005DF40 /* IDESourceEditor.ideplugin in Resources */ = {isa = PBXBuildFile; fileRef = 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */; }; 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 1883080F1A7411A70005DF40 /* IDESourceEditor */; }; 188FCC8A1A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */; }; 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */; }; @@ -49,13 +48,12 @@ 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapSelectionView.m; sourceTree = ""; }; 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapView.h; sourceTree = ""; }; 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = SCXcodeMinimapView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 184C118E1A741136002A7C65 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; + 184C118E1A741136002A7C65 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDEEditorDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 1876135E1A77A74300974BE1 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = ../../../../../Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; + 1876135E1A77A74300974BE1 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEFileBreakpoint.h; sourceTree = ""; }; - 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../../../../../Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; - 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = IDESourceEditor.ideplugin; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin; sourceTree = ""; }; - 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; + 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; + 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = /Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; 188D38761A98B26E005C7F85 /* DBGBreakpointAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotation.h; sourceTree = ""; }; 188D38771A98B3AC005C7F85 /* DVTTextAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextAnnotation.h; sourceTree = ""; }; 188D38781A98B3D8005C7F85 /* DVTAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotation.h; sourceTree = ""; }; @@ -68,9 +66,9 @@ 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTLayoutManager.h; sourceTree = ""; }; 18C999FC1A98AF370008AF54 /* DBGBreakpointAnnotationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotationProvider.h; sourceTree = ""; }; 18C999FD1A98AF580008AF54 /* DVTAnnotationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationProvider.h; sourceTree = ""; }; - 18C999FE1A98B04C0008AF54 /* DebuggerUI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = DebuggerUI; path = ../../../../../Applications/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS/DebuggerUI; sourceTree = ""; }; + 18C999FE1A98B04C0008AF54 /* DebuggerUI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = DebuggerUI; path = /Applications/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS/DebuggerUI; sourceTree = ""; }; 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpoint.h; sourceTree = ""; }; - 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../../../../../Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; + 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 18FE09B51707639E00118FEB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 18FE09B81707639E00118FEB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -173,7 +171,6 @@ 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */, 1876135E1A77A74300974BE1 /* IDEKit.framework */, 1883080F1A7411A70005DF40 /* IDESourceEditor */, - 1883080B1A7411930005DF40 /* IDESourceEditor.ideplugin */, 8742532217307161001C947C /* QuartzCore.framework */, ); name = Frameworks; @@ -258,7 +255,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1883080C1A7411930005DF40 /* IDESourceEditor.ideplugin in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; From 9bafb657fe91eadafd318d01e05870a9eab34c6c Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 28 Feb 2015 13:08:28 +0000 Subject: [PATCH 52/96] Fixes #41 --- SCXcodeMinimap/SCXcodeMinimapView.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 8624328..187c67f 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -434,7 +434,8 @@ - (void)handleMouseEvent:(NSEvent *)theEvent { NSPoint point = [self.textView convertPoint:theEvent.locationInWindow fromView:nil]; NSUInteger characterIndex = [self.textView characterIndexForInsertionAtPoint:point]; - [self.editorTextView scrollRangeToVisible:NSMakeRange(characterIndex, 0) animate:YES]; + NSRange lineRange = [self.textView.string lineRangeForRange:NSMakeRange(characterIndex, 0)]; + [self.editorTextView scrollRangeToVisible:lineRange animate:YES]; } #pragma mark - Theme From 83fcc83b2b4d1519acd05e8e7bbb1c7ea083d0e8 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 28 Feb 2015 14:37:46 +0000 Subject: [PATCH 53/96] Various tweaks for #41 --- SCXcodeMinimap.xcodeproj/project.pbxproj | 6 ++++++ SCXcodeMinimap/SCXcodeMinimapScrollView.h | 13 +++++++++++++ SCXcodeMinimap/SCXcodeMinimapScrollView.m | 18 ++++++++++++++++++ SCXcodeMinimap/SCXcodeMinimapView.m | 23 ++++++++++++++++++----- 4 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 SCXcodeMinimap/SCXcodeMinimapScrollView.h create mode 100644 SCXcodeMinimap/SCXcodeMinimapScrollView.m diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index d05e95f..20c7370 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1819E4281AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m */; }; 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */; }; 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */; }; 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 184C118E1A741136002A7C65 /* DVTFoundation.framework */; }; @@ -25,6 +26,8 @@ /* Begin PBXFileReference section */ 180F0C651A98AE1500E97254 /* DVTAnnotationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationManager.h; sourceTree = ""; }; 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 1819E4271AA1FB5900C344F2 /* SCXcodeMinimapScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapScrollView.h; sourceTree = ""; }; + 1819E4281AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapScrollView.m; sourceTree = ""; }; 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTFoldingManager.h; sourceTree = ""; }; 184407641A8F7B1900C530CF /* DVTTextDocumentLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextDocumentLocation.h; sourceTree = ""; }; 184407651A8F7B3E00C530CF /* DVTDocumentLocation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTDocumentLocation.h; sourceTree = ""; }; @@ -183,6 +186,8 @@ 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */, 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */, 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */, + 1819E4271AA1FB5900C344F2 /* SCXcodeMinimapScrollView.h */, + 1819E4281AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m */, 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, 18C2EA5A1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.h */, @@ -270,6 +275,7 @@ 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */, + 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SCXcodeMinimap/SCXcodeMinimapScrollView.h b/SCXcodeMinimap/SCXcodeMinimapScrollView.h new file mode 100644 index 0000000..dfce945 --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapScrollView.h @@ -0,0 +1,13 @@ +// +// SCXcodeMinimapScrollView.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 28/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import + +@interface SCXcodeMinimapScrollView : NSScrollView + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapScrollView.m b/SCXcodeMinimap/SCXcodeMinimapScrollView.m new file mode 100644 index 0000000..9e06574 --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapScrollView.m @@ -0,0 +1,18 @@ +// +// SCXcodeMinimapScrollView.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 28/02/2015. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "SCXcodeMinimapScrollView.h" + +@implementation SCXcodeMinimapScrollView + +- (void)scrollWheel:(NSEvent *)theEvent +{ + // Disable the scroll wheel on top of the minimap +} + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 187c67f..9883d99 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -8,6 +8,7 @@ #import "SCXcodeMinimapView.h" #import "SCXcodeMinimap.h" +#import "SCXcodeMinimapScrollView.h" #import "SCXcodeMinimapSelectionView.h" #import "IDESourceCodeEditor.h" @@ -72,7 +73,7 @@ @interface SCXcodeMinimapView () Date: Sat, 28 Feb 2015 15:49:53 +0000 Subject: [PATCH 54/96] - disabling animations on the minimap content offset changes while dragging (#42) - forcing background and non-contiguous layout --- SCXcodeMinimap/SCXcodeMinimapView.m | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 9883d99..bbd0436 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -239,7 +239,9 @@ - (void)setVisible:(BOOL)visible [self updateSize]; - [self.textView.layoutManager setDelegate:(self.hidden ? nil : self)]; + [self.textView.layoutManager setDelegate:(self.hidden ? nil : self)]; + [self.textView.layoutManager setBackgroundLayoutEnabled:YES]; + [self.textView.layoutManager setAllowsNonContiguousLayout:YES]; BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; if(editorHighlightingEnabled) { @@ -444,11 +446,17 @@ - (void)handleMouseEvent:(NSEvent *)theEvent NSRect neededRect = [self.editorTextView.layoutManager boundingRectForGlyphRange:activeRange inTextContainer:self.editorTextView.textContainer]; neededRect.origin.y = MAX(0, neededRect.origin.y - CGRectGetHeight(self.editor.containerView.bounds) / 2); - [NSAnimationContext beginGrouping]; - [[NSAnimationContext currentContext] setDuration:0.25f]; - [self.editor.scrollView.contentView.animator setBoundsOrigin:CGPointMake(0, neededRect.origin.y)]; - [self.editor.scrollView reflectScrolledClipView:self.editor.scrollView.contentView]; - [NSAnimationContext endGrouping]; + BOOL shouldAnimateContentOffset = (theEvent.type != NSLeftMouseDragged); + + if(shouldAnimateContentOffset) { + [NSAnimationContext beginGrouping]; + [[NSAnimationContext currentContext] setDuration:0.25f]; + [self.editor.scrollView.contentView.animator setBoundsOrigin:CGPointMake(0, neededRect.origin.y)]; + [self.editor.scrollView reflectScrolledClipView:self.editor.scrollView.contentView]; + [NSAnimationContext endGrouping]; + } else { + [self.editor.scrollView.contentView setBoundsOrigin:CGPointMake(0, neededRect.origin.y)]; + } } #pragma mark - Theme From 3c95705eeea96de2314a9c1df052248c63d812b5 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 10 Mar 2015 19:05:16 +0000 Subject: [PATCH 55/96] Added compatibility UUID for Xcode 6.2 --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 3d87f95..137a105 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -32,6 +32,7 @@ 37B30044-3B14-46BA-ABAA-F01000C27B63 640F884E-CE55-4B40-87C0-8869546CAB7A 992275C1-432A-4CF7-B659-D84ED6D42D3F + A16FF353-8441-459E-A50C-B071F53F51B7 NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. From ba71d6442500751113d7575941f9d79721b05fc8 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 9 Apr 2015 15:28:51 +0100 Subject: [PATCH 56/96] Added Xcode 6.3 compatibility UUID. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 137a105..27a6acd 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -33,6 +33,7 @@ 640F884E-CE55-4B40-87C0-8869546CAB7A 992275C1-432A-4CF7-B659-D84ED6D42D3F A16FF353-8441-459E-A50C-B071F53F51B7 + 9F75337B-21B4-4ADC-B558-F9CADF7073A7 NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. From e63be6e3c9bd060cbe8776f440ed74e9d323cad4 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 26 Apr 2015 11:50:47 +0100 Subject: [PATCH 57/96] Fixes #48 - allow scrolling the main editor while on top of the minimap --- SCXcodeMinimap/SCXcodeMinimapScrollView.h | 3 +++ SCXcodeMinimap/SCXcodeMinimapScrollView.m | 18 +++++++++++++++++- SCXcodeMinimap/SCXcodeMinimapView.m | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapScrollView.h b/SCXcodeMinimap/SCXcodeMinimapScrollView.h index dfce945..dbdc094 100644 --- a/SCXcodeMinimap/SCXcodeMinimapScrollView.h +++ b/SCXcodeMinimap/SCXcodeMinimapScrollView.h @@ -10,4 +10,7 @@ @interface SCXcodeMinimapScrollView : NSScrollView +- (instancetype)initWithFrame:(CGRect)frame + editorScrollView:(NSScrollView *)scrollView; + @end diff --git a/SCXcodeMinimap/SCXcodeMinimapScrollView.m b/SCXcodeMinimap/SCXcodeMinimapScrollView.m index 9e06574..d854b07 100644 --- a/SCXcodeMinimap/SCXcodeMinimapScrollView.m +++ b/SCXcodeMinimap/SCXcodeMinimapScrollView.m @@ -8,11 +8,27 @@ #import "SCXcodeMinimapScrollView.h" +@interface SCXcodeMinimapScrollView () + +@property (nonatomic, strong) NSScrollView *editorScrollView; + +@end + @implementation SCXcodeMinimapScrollView +- (instancetype)initWithFrame:(CGRect)frame + editorScrollView:(NSScrollView *)scrollView +{ + if(self = [super initWithFrame:frame]) { + _editorScrollView = scrollView; + } + + return self; +} + - (void)scrollWheel:(NSEvent *)theEvent { - // Disable the scroll wheel on top of the minimap + [self.editorScrollView scrollWheel:theEvent]; } @end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index bbd0436..96b331c 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -116,7 +116,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin | NSViewWidthSizable | NSViewHeightSizable]; - self.scrollView = [[SCXcodeMinimapScrollView alloc] initWithFrame:self.bounds]; + self.scrollView = [[SCXcodeMinimapScrollView alloc] initWithFrame:self.bounds editorScrollView:self.editor.scrollView]; [self.scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [self.scrollView setDrawsBackground:NO]; [self.scrollView setMinMagnification:0.0f]; From b45a655ce30cf3c4b2a14968ca3aa8c03ba5446e Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 26 Apr 2015 14:29:12 +0100 Subject: [PATCH 58/96] Fixes #47 - hiding the scroll view scollers so they don't affec the content offset. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 6 ++++ SCXcodeMinimap/NSScroller+SCXcodeMinimap.h | 15 +++++++++ SCXcodeMinimap/NSScroller+SCXcodeMinimap.m | 37 ++++++++++++++++++++++ SCXcodeMinimap/SCXcodeMinimapView.m | 11 ++++--- 4 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 SCXcodeMinimap/NSScroller+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/NSScroller+SCXcodeMinimap.m diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 20c7370..1d6098f 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 1809FF8F1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */; }; 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1819E4281AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m */; }; 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */; }; 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */; }; @@ -24,6 +25,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 1809FF8D1AED1A730058D946 /* NSScroller+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSScroller+SCXcodeMinimap.h"; sourceTree = ""; }; + 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSScroller+SCXcodeMinimap.m"; sourceTree = ""; }; 180F0C651A98AE1500E97254 /* DVTAnnotationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationManager.h; sourceTree = ""; }; 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 1819E4271AA1FB5900C344F2 /* SCXcodeMinimapScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapScrollView.h; sourceTree = ""; }; @@ -194,6 +197,8 @@ 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */, 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */, 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */, + 1809FF8D1AED1A730058D946 /* NSScroller+SCXcodeMinimap.h */, + 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, 184C11701A740F8A002A7C65 /* Xcode Headers */, ); @@ -276,6 +281,7 @@ 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */, 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */, + 1809FF8F1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/SCXcodeMinimap/NSScroller+SCXcodeMinimap.h b/SCXcodeMinimap/NSScroller+SCXcodeMinimap.h new file mode 100644 index 0000000..eb784bf --- /dev/null +++ b/SCXcodeMinimap/NSScroller+SCXcodeMinimap.h @@ -0,0 +1,15 @@ +// +// NSScroller+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 4/26/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import + +@interface NSScroller (SCXcodeMinimap) + +@property (nonatomic, assign) BOOL forcedHidden; + +@end diff --git a/SCXcodeMinimap/NSScroller+SCXcodeMinimap.m b/SCXcodeMinimap/NSScroller+SCXcodeMinimap.m new file mode 100644 index 0000000..34794e7 --- /dev/null +++ b/SCXcodeMinimap/NSScroller+SCXcodeMinimap.m @@ -0,0 +1,37 @@ +// +// NSScroller+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 4/26/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "NSScroller+SCXcodeMinimap.h" +#import + +@implementation NSScroller (SCXcodeMinimap) +@dynamic forcedHidden; + +- (BOOL)forcedHidden +{ + return [objc_getAssociatedObject(self, @selector(forcedHidden)) boolValue]; +} + +- (void)setForcedHidden:(BOOL)forcedHidden +{ + objc_setAssociatedObject(self, @selector(forcedHidden), @(forcedHidden), OBJC_ASSOCIATION_ASSIGN); + + [self setHidden:forcedHidden]; +} + +- (void)setHidden:(BOOL)hidden +{ + if(self.forcedHidden) { + super.hidden = YES; + return; + } + + super.hidden = hidden; +} + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 96b331c..c4aa855 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -31,6 +31,8 @@ #import "DBGBreakpointAnnotation+SCXcodeMinimap.h" #import "DBGBreakpointAnnotation.h" +#import "NSScroller+SCXcodeMinimap.h" + const CGFloat kBackgroundColorShadowLevel = 0.1f; const CGFloat kDurationBetweenInvalidations = 0.5f; @@ -156,10 +158,8 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self invalidateDisplayForVisibleRange]; } - - BOOL shouldHideEditorVerticalScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]; - [self.editor.scrollView setHasVerticalScroller:!shouldHideEditorVerticalScroller]; - + BOOL shouldHideVerticalScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]; + [self.editor.scrollView.verticalScroller setForcedHidden:shouldHideVerticalScroller]; // Notifications @@ -201,7 +201,8 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf.editor.scrollView setHasVerticalScroller:![[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]]; + BOOL shouldHideVerticalScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]; + [weakSelf.editor.scrollView.verticalScroller setForcedHidden:shouldHideVerticalScroller]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapThemeChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { From 3c797c7b175c0685d0988f7352809ed1ea646244 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 5 May 2015 18:47:29 +0100 Subject: [PATCH 59/96] Attempt at fixing #52 - forcing the layoutManager to layout the whole text container - reusing the same height in both the minimap and the editor textView --- SCXcodeMinimap/SCXcodeMinimapView.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index c4aa855..9dc4ef4 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -393,11 +393,11 @@ - (void)updateOffset return; } - CGFloat editorTextHeight = CGRectGetHeight([self.editorTextView.layoutManager usedRectForTextContainer:self.editorTextView.textContainer]); - CGFloat minimapTextHeight = CGRectGetHeight([self.textView.layoutManager usedRectForTextContainer:self.textView.textContainer]); + [self.editorTextView.layoutManager ensureLayoutForTextContainer:self.editorTextView.textContainer]; + CGFloat editorTextHeight = CGRectGetHeight([self.editorTextView.layoutManager usedRectForTextContainer:self.editorTextView.textContainer]); CGFloat adjustedEditorContentHeight = editorTextHeight - CGRectGetHeight(self.editor.scrollView.bounds); - CGFloat adjustedMinimapContentHeight = minimapTextHeight - (CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)); + CGFloat adjustedMinimapContentHeight = editorTextHeight - (CGRectGetHeight(self.scrollView.bounds) * (1 / self.scrollView.magnification)); NSRect selectionViewFrame = NSMakeRect(0, 0, self.textView.bounds.size.width * (1 / self.scrollView.magnification), self.editor.scrollView.visibleRect.size.height); @@ -413,7 +413,7 @@ - (void)updateOffset [self.scrollView.documentView scrollPoint:offset]; - ratio = (minimapTextHeight - self.selectionView.bounds.size.height) / adjustedEditorContentHeight; + ratio = (editorTextHeight - self.selectionView.bounds.size.height) / adjustedEditorContentHeight; selectionViewFrame.origin.y = self.editor.scrollView.contentView.bounds.origin.y * ratio; [self.selectionView setFrame:selectionViewFrame]; From 36469b2d4e86a259ca59ca4c08945645c489ddeb Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 6 May 2015 12:09:14 +0100 Subject: [PATCH 60/96] Fixes #46 (live issues) and improves code folding handling --- SCXcodeMinimap/SCXcodeMinimapView.m | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 9dc4ef4..e1ea656 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -113,7 +113,6 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor self.editor = editor; self.editorTextView = editor.textView; - [self.editorTextView.foldingManager setDelegate:self]; [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin | NSViewWidthSizable | NSViewHeightSizable]; @@ -132,7 +131,15 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self addSubview:self.scrollView]; self.textView = [[DVTSourceTextView alloc] init]; - [self.textView setTextStorage:self.editorTextView.textStorage]; + + // The editor's layout manager needs to be the last one, otherwise live issues don't work + NSTextStorage *storage = self.editorTextView.textStorage; + [storage removeLayoutManager:self.editorTextView.layoutManager]; + [storage addLayoutManager:self.textView.layoutManager]; + [storage addLayoutManager:self.editorTextView.layoutManager]; + + [self.editorTextView.foldingManager setDelegate:self]; + [self.textView setEditable:NO]; [self.textView setSelectable:NO]; @@ -336,7 +343,8 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didFoldRange:(NSRange [self.textView.foldingManager foldRange:range]; - [self invalidateLayoutForVisibleMinimapRange]; + [self.textView.layoutManager ensureLayoutForTextContainer:self.textView.textContainer]; + [self updateOffset]; } - (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRange)range @@ -345,7 +353,8 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRan [self.textView.foldingManager unfoldRange:range]; - [self invalidateLayoutForVisibleMinimapRange]; + [self.textView.layoutManager ensureLayoutForTextContainer:self.textView.textContainer]; + [self updateOffset]; } #pragma mark - DBGBreakpointAnnotationProviderDelegate @@ -576,10 +585,4 @@ - (void)invalidateDisplayForVisibleRange [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:visibleEditorRange]; } -- (void)invalidateLayoutForVisibleMinimapRange -{ - NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; - [self.textView.layoutManager invalidateLayoutForCharacterRange:visibleMinimapRange actualCharacterRange:nil]; -} - @end From 83359dc36e7476bab6c0d43b612c73edadeb7798 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 21 May 2015 08:22:35 +0200 Subject: [PATCH 61/96] Added plugin compatibility UUIDs for Xcode 6.3.2 and 6.4. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 27a6acd..271622f 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -34,6 +34,9 @@ 992275C1-432A-4CF7-B659-D84ED6D42D3F A16FF353-8441-459E-A50C-B071F53F51B7 9F75337B-21B4-4ADC-B558-F9CADF7073A7 + 992275C1-432A-4CF7-B659-D84ED6D42D3F + E969541F-E6F9-4D25-8158-72DC3545A6C6 + 8DC44374-2B35-4C57-A6FE-2AD66A36AAD9 NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. From 1d1bfd264e440aa5a59329f08cd322ba1fc4b81f Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 24 May 2015 12:23:04 +0100 Subject: [PATCH 62/96] Added warnings and errors highlighting (#55) --- SCXcodeMinimap.xcodeproj/project.pbxproj | 24 +- ...akpointAnnotationProvider+SCXcodeMinimap.m | 10 +- ...DEIssueAnnotationProvider+SCXcodeMinimap.h | 23 ++ ...DEIssueAnnotationProvider+SCXcodeMinimap.m | 91 ++++++++ SCXcodeMinimap/SCXcodeMinimap.h | 3 + SCXcodeMinimap/SCXcodeMinimap.m | 31 ++- SCXcodeMinimap/SCXcodeMinimapTheme.h | 30 +++ SCXcodeMinimap/SCXcodeMinimapTheme.m | 59 +++++ SCXcodeMinimap/SCXcodeMinimapView.m | 214 ++++++++++-------- .../DVTMessageBubbleAnnotation.h | 43 ++++ .../Xcode Headers/IDEBuildIssueAnnotation.h | 25 ++ .../IDEBuildIssueErrorAnnotation.h | 23 ++ .../IDEBuildIssueWarningAnnotation.h | 23 ++ .../IDEIssueAnnotationProvider.h | 30 +++ 14 files changed, 526 insertions(+), 103 deletions(-) create mode 100644 SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m create mode 100644 SCXcodeMinimap/SCXcodeMinimapTheme.h create mode 100644 SCXcodeMinimap/SCXcodeMinimapTheme.m create mode 100644 SCXcodeMinimap/Xcode Headers/DVTMessageBubbleAnnotation.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEBuildIssueAnnotation.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEBuildIssueErrorAnnotation.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEBuildIssueWarningAnnotation.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEIssueAnnotationProvider.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 1d6098f..0126b77 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -15,10 +15,12 @@ 1876135F1A77A74300974BE1 /* IDEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1876135E1A77A74300974BE1 /* IDEKit.framework */; }; 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 188308091A7411830005DF40 /* DVTKit.framework */; }; 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 1883080F1A7411A70005DF40 /* IDESourceEditor */; }; + 1889464D1B11DDEE0036175B /* SCXcodeMinimapTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 1889464C1B11DDEE0036175B /* SCXcodeMinimapTheme.m */; }; 188FCC8A1A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */; }; 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */; }; 18C999FF1A98B04C0008AF54 /* DebuggerUI in Frameworks */ = {isa = PBXBuildFile; fileRef = 18C999FE1A98B04C0008AF54 /* DebuggerUI */; }; 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */; }; + 18E577FC1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */; }; 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18FE09B51707639E00118FEB /* Cocoa.framework */; }; 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */; }; 8742532317307161001C947C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8742532217307161001C947C /* QuartzCore.framework */; }; @@ -28,6 +30,7 @@ 1809FF8D1AED1A730058D946 /* NSScroller+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSScroller+SCXcodeMinimap.h"; sourceTree = ""; }; 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSScroller+SCXcodeMinimap.m"; sourceTree = ""; }; 180F0C651A98AE1500E97254 /* DVTAnnotationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationManager.h; sourceTree = ""; }; + 180F24D61B119866009ACE49 /* IDEIssueAnnotationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEIssueAnnotationProvider.h; sourceTree = ""; }; 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDESourceCodeDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 1819E4271AA1FB5900C344F2 /* SCXcodeMinimapScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapScrollView.h; sourceTree = ""; }; 1819E4281AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapScrollView.m; sourceTree = ""; }; @@ -60,6 +63,8 @@ 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEFileBreakpoint.h; sourceTree = ""; }; 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = /Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; + 1889464B1B11DDEE0036175B /* SCXcodeMinimapTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapTheme.h; sourceTree = ""; }; + 1889464C1B11DDEE0036175B /* SCXcodeMinimapTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapTheme.m; sourceTree = ""; }; 188D38761A98B26E005C7F85 /* DBGBreakpointAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotation.h; sourceTree = ""; }; 188D38771A98B3AC005C7F85 /* DVTTextAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTTextAnnotation.h; sourceTree = ""; }; 188D38781A98B3D8005C7F85 /* DVTAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotation.h; sourceTree = ""; }; @@ -75,6 +80,12 @@ 18C999FE1A98B04C0008AF54 /* DebuggerUI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = DebuggerUI; path = /Applications/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS/DebuggerUI; sourceTree = ""; }; 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpoint.h; sourceTree = ""; }; 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; + 18E577F61B119BF200421483 /* IDEBuildIssueAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEBuildIssueAnnotation.h; sourceTree = ""; }; + 18E577F71B119C1000421483 /* IDEBuildIssueWarningAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBuildIssueWarningAnnotation.h; sourceTree = ""; }; + 18E577F81B119C3F00421483 /* IDEBuildIssueErrorAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBuildIssueErrorAnnotation.h; sourceTree = ""; }; + 18E577F91B119C7200421483 /* DVTMessageBubbleAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTMessageBubbleAnnotation.h; sourceTree = ""; }; + 18E577FA1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEIssueAnnotationProvider+SCXcodeMinimap.h"; sourceTree = ""; }; + 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEIssueAnnotationProvider+SCXcodeMinimap.m"; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 18FE09B51707639E00118FEB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 18FE09B81707639E00118FEB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -122,6 +133,7 @@ 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */, 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */, 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */, + 18E577F91B119C7200421483 /* DVTMessageBubbleAnnotation.h */, 184C11741A740F8A002A7C65 /* DVTPointerArray.h */, 184C11751A740F8A002A7C65 /* DVTPreferenceSet-Protocol.h */, 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */, @@ -134,15 +146,19 @@ 184407641A8F7B1900C530CF /* DVTTextDocumentLocation.h */, 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */, 184C117C1A740F8A002A7C65 /* DVTViewController.h */, + 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */, + 18E577F61B119BF200421483 /* IDEBuildIssueAnnotation.h */, + 18E577F81B119C3F00421483 /* IDEBuildIssueErrorAnnotation.h */, + 18E577F71B119C1000421483 /* IDEBuildIssueWarningAnnotation.h */, 184C117D1A740F8A002A7C65 /* IDEEditor.h */, 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */, 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */, 18FEFA8C1A782D8600DC98C5 /* IDEFileTextSettings.h */, + 180F24D61B119866009ACE49 /* IDEIssueAnnotationProvider.h */, 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */, 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */, 184C11801A740F8A002A7C65 /* IDEViewController.h */, - 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */, ); path = "Xcode Headers"; sourceTree = ""; @@ -193,10 +209,14 @@ 1819E4281AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m */, 184C11811A740F97002A7C65 /* SCXcodeMinimapSelectionView.h */, 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, + 1889464B1B11DDEE0036175B /* SCXcodeMinimapTheme.h */, + 1889464C1B11DDEE0036175B /* SCXcodeMinimapTheme.m */, 18C2EA5A1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.h */, 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */, 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */, 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */, + 18E577FA1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.h */, + 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */, 1809FF8D1AED1A730058D946 /* NSScroller+SCXcodeMinimap.h */, 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, @@ -280,7 +300,9 @@ 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */, + 1889464D1B11DDEE0036175B /* SCXcodeMinimapTheme.m in Sources */, 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */, + 18E577FC1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m in Sources */, 1809FF8F1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m index c2e9d8c..5bd69ac 100644 --- a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m +++ b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m @@ -31,6 +31,11 @@ + (void)load sc_swizzleInstanceMethod(self, @selector(didMoveAnnotation:), @selector(sc_didMoveAnnotation:)); } +- (id)minimapDelegate +{ + return objc_getAssociatedObject(self, @selector(minimapDelegate)); +} + - (void)setMinimapDelegate:(id)minimapDelegate { for(DBGBreakpointAnnotation *annotation in self.annotations) { @@ -40,11 +45,6 @@ - (void)setMinimapDelegate:(id)minimapD objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); } -- (id)minimapDelegate -{ - return objc_getAssociatedObject(self, @selector(minimapDelegate)); -} - - (void)sc_addAnnotationForFileBreakpoint:(id)arg1 { [self sc_addAnnotationForFileBreakpoint:arg1]; diff --git a/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.h b/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.h new file mode 100644 index 0000000..04d90bb --- /dev/null +++ b/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.h @@ -0,0 +1,23 @@ +// +// IDEIssueAnnotationProvider+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 5/24/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "IDEIssueAnnotationProvider.h" + +@protocol IDEIssueAnnotationProviderDelegate; + +@interface IDEIssueAnnotationProvider (SCXcodeMinimap) + +@property (nonatomic, weak) id minimapDelegate; + +@end + +@protocol IDEIssueAnnotationProviderDelegate + +- (void)issueAnnotationProviderDidChangeIssues:(IDEIssueAnnotationProvider *)annotationProvider; + +@end diff --git a/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m new file mode 100644 index 0000000..6d6e5ab --- /dev/null +++ b/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m @@ -0,0 +1,91 @@ +// +// IDEIssueAnnotationProvider+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 5/24/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "IDEIssueAnnotationProvider+SCXcodeMinimap.h" +#import + +static void *IDEIssueAnnotationProviderIssuesObservingContext = &IDEIssueAnnotationProviderIssuesObservingContext; + +@interface IDEIssueAnnotationProvider (SCXcodeMinimap_Private) + +@property (nonatomic, assign) BOOL isObservingAnnotations; + +@end + +@implementation IDEIssueAnnotationProvider (SCXcodeMinimap) +@dynamic minimapDelegate; + +static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { + Method originalMethod = class_getInstanceMethod(class, originalSelector); + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); + if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { + class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} + ++ (void)load +{ + sc_swizzleInstanceMethod(self, @selector(providerWillUninstall), @selector(sc_providerWillUninstall)); + sc_swizzleInstanceMethod(self, @selector(didDeleteOrReplaceParagraphForAnnotation:), @selector(sc_didDeleteOrReplaceParagraphForAnnotation:)); +} + +- (void)sc_providerWillUninstall +{ + [self sc_providerWillUninstall]; + + if(self.isObservingAnnotations) { + [self removeObserver:self forKeyPath:@"annotations"]; + } +} + +- (void)_didDeleteOrReplaceParagraphForAnnotation:(id)annotation +{ + [self _didDeleteOrReplaceParagraphForAnnotation:annotation]; + + if([self.minimapDelegate respondsToSelector:@selector(issueAnnotationProviderDidChangeIssues:)]) { + [self.minimapDelegate issueAnnotationProviderDidChangeIssues:self]; + } +} + +- (id)minimapDelegate +{ + return objc_getAssociatedObject(self, @selector(minimapDelegate)); +} + +- (void)setMinimapDelegate:(id)minimapDelegate +{ + objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); + + if(minimapDelegate) { + self.isObservingAnnotations = YES; + [self addObserver:self forKeyPath:@"annotations" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:IDEIssueAnnotationProviderIssuesObservingContext]; + } +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if(context == IDEIssueAnnotationProviderIssuesObservingContext) { + if([self.minimapDelegate respondsToSelector:@selector(issueAnnotationProviderDidChangeIssues:)]) { + [self.minimapDelegate issueAnnotationProviderDidChangeIssues:self]; + } + } +} + +- (BOOL)isObservingAnnotations +{ + return [objc_getAssociatedObject(self, @selector(isObservingAnnotations)) boolValue]; +} + +- (void)setIsObservingAnnotations:(BOOL)isObservingAnnotations +{ + objc_setAssociatedObject(self, @selector(isObservingAnnotations), @(isObservingAnnotations), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index 7241a14..80d6141 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -17,6 +17,9 @@ extern NSString *const SCXcodeMinimapZoomLevelKey; extern NSString *const SCXcodeMinimapHighlightBreakpointsChangeNotification; extern NSString *const SCXcodeMinimapShouldHighlightBreakpointsKey; +extern NSString *const SCXcodeMinimapHighlightIssuesChangeNotification; +extern NSString *const SCXcodeMinimapShouldHighlightIssuesKey; + extern NSString *const SCXcodeMinimapHighlightCommentsChangeNotification; extern NSString *const SCXcodeMinimapShouldHighlightCommentsKey; diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index b4a4f0e..3137071 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -26,6 +26,9 @@ NSString *const SCXcodeMinimapHighlightBreakpointsChangeNotification = @"SCXcodeMinimapHighlightBreakpointsChangeNotification"; NSString *const SCXcodeMinimapShouldHighlightBreakpointsKey = @"SCXcodeMinimapShouldHighlightBreakpointsKey"; +NSString *const SCXcodeMinimapHighlightIssuesChangeNotification = @"SCXcodeMinimapHighlightIssuesChangeNotification"; +NSString *const SCXcodeMinimapShouldHighlightIssuesKey = @"SCXcodeMinimapShouldHighlightIssuesKey"; + NSString *const SCXcodeMinimapHighlightCommentsChangeNotification = @"SCXcodeMinimapHighlightCommentsChangeNotification"; NSString *const SCXcodeMinimapShouldHighlightCommentsKey = @"SCXcodeMinimapShouldHighlightCommentsKey"; @@ -48,6 +51,7 @@ NSString *const kHideMinimapMenuItemTitle = @"Hide Minimap"; NSString *const kHighlightBreakpointsMenuItemTitle = @"Highlight breakpoints"; +NSString *const kHighlightIssuesMenuItemTitle = @"Highlight issues"; NSString *const kHighlightCommentsMenuItemTitle = @"Highlight comments"; NSString *const kHighlightPreprocessorMenuItemTitle = @"Highlight preprocessor"; NSString *const kHighlightEditorMenuItemTitle = @"Highlight main editor"; @@ -84,6 +88,7 @@ - (void)registerUserDefaults NSDictionary *userDefaults = @{SCXcodeMinimapZoomLevelKey : @(0.1f), SCXcodeMinimapShouldDisplayKey : @(YES), SCXcodeMinimapShouldHighlightBreakpointsKey : @(YES), + SCXcodeMinimapShouldHighlightIssuesKey : @(YES), SCXcodeMinimapShouldHighlightCommentsKey : @(YES), SCXcodeMinimapShouldHighlightPreprocessorKey : @(YES)}; @@ -94,16 +99,16 @@ - (void)registerUserDefaults - (void)createMenuItem { - NSMenuItem *editMenuItem = [[NSApp mainMenu] itemWithTitle:kViewMenuItemTitle]; + NSMenuItem *viewMenuItem = [[NSApp mainMenu] itemWithTitle:kViewMenuItemTitle]; - if(editMenuItem == nil) { + if(viewMenuItem == nil) { return; } - [editMenuItem.submenu addItem:[NSMenuItem separatorItem]]; + [viewMenuItem.submenu addItem:[NSMenuItem separatorItem]]; NSMenuItem *minimapMenuItem = [[NSMenuItem alloc] initWithTitle:kMinimapMenuItemTitle action:nil keyEquivalent:@""]; - [editMenuItem.submenu addItem:minimapMenuItem]; + [viewMenuItem.submenu addItem:minimapMenuItem]; NSMenu *minimapMenu = [[NSMenu alloc] init]; { @@ -154,6 +159,15 @@ - (void)createMenuItem [highlightBreakpointsMenuItem setState:(breakpointHighlightingEnabled ? NSOnState : NSOffState)]; + NSMenuItem *highlightIssuesMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightIssuesMenuItemTitle + action:@selector(toggleIssuesHighlighting:) keyEquivalent:@""]; + [highlightIssuesMenuItem setTarget:self]; + [minimapMenu addItem:highlightIssuesMenuItem]; + + BOOL issueHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightIssuesKey] boolValue]; + [highlightIssuesMenuItem setState:(issueHighlightingEnabled ? NSOnState : NSOffState)]; + + NSMenuItem *highlightCommentsMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightCommentsMenuItemTitle action:@selector(toggleCommentsHighlighting:) keyEquivalent:@""]; [highlightCommentsMenuItem setTarget:self]; @@ -261,6 +275,15 @@ - (void)toggleBreakpointHighlighting:(NSMenuItem *)sender [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightBreakpointsChangeNotification object:nil]; } +- (void)toggleIssuesHighlighting:(NSMenuItem *)sender +{ + BOOL issueHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightIssuesKey] boolValue]; + + [sender setState:(issueHighlightingEnabled ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!issueHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightIssuesKey]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightIssuesChangeNotification object:nil]; +} + - (void)toggleCommentsHighlighting:(NSMenuItem *)sender { BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightCommentsKey] boolValue]; diff --git a/SCXcodeMinimap/SCXcodeMinimapTheme.h b/SCXcodeMinimap/SCXcodeMinimapTheme.h new file mode 100644 index 0000000..f6fc287 --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapTheme.h @@ -0,0 +1,30 @@ +// +// SCXcodeMinimapTheme.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 5/24/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DVTFontAndColorTheme.h" + +@interface SCXcodeMinimapTheme : NSObject + ++ (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme; + +@property (nonatomic, strong) NSColor *backgroundColor; +@property (nonatomic, strong) NSColor *selectionColor; + +@property (nonatomic, strong) NSColor *sourcePlainTextColor; +@property (nonatomic, strong) NSColor *sourceTextBackgroundColor; +@property (nonatomic, strong) NSColor *commentBackgroundColor; +@property (nonatomic, strong) NSColor *preprocessorBackgroundColor; +@property (nonatomic, strong) NSColor *enabledBreakpointColor; +@property (nonatomic, strong) NSColor *disabledBreakpointColor; + +@property (nonatomic, strong) NSColor *buildIssueWarningBackgroundColor; +@property (nonatomic, strong) NSColor *buildIssueErrorBackgroundColor; + +@property (nonatomic, strong) DVTFontAndColorTheme *dvtTheme; + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapTheme.m b/SCXcodeMinimap/SCXcodeMinimapTheme.m new file mode 100644 index 0000000..a9a0712 --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapTheme.m @@ -0,0 +1,59 @@ +// +// SCXcodeMinimapTheme.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 5/24/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "SCXcodeMinimapTheme.h" +#import "DVTSourceNodeTypes.h" +#import "DVTPointerArray.h" + +const CGFloat kBackgroundColorShadowLevel = 0.1f; + +static NSString * const kXcodeSyntaxCommentNodeName = @"xcode.syntax.comment"; +static NSString * const kXcodeSyntaxPreprocessorNodeName = @"xcode.syntax.preprocessor"; + +@implementation SCXcodeMinimapTheme + ++ (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme +{ + SCXcodeMinimapTheme *minimapTheme = [[SCXcodeMinimapTheme alloc] init]; + + minimapTheme.backgroundColor = [theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel]; + + minimapTheme.selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [minimapTheme.backgroundColor redComponent]) + green:(1.0f - [minimapTheme.backgroundColor greenComponent]) + blue:(1.0f - [minimapTheme.backgroundColor blueComponent]) + alpha:0.2f]; + + + DVTPointerArray *colors = [theme syntaxColorsByNodeType]; + minimapTheme.commentBackgroundColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; + minimapTheme.commentBackgroundColor = [NSColor colorWithCalibratedRed:minimapTheme.commentBackgroundColor.redComponent + green:minimapTheme.commentBackgroundColor.greenComponent + blue:minimapTheme.commentBackgroundColor.blueComponent + alpha:0.3f]; + + + minimapTheme.preprocessorBackgroundColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]]; + minimapTheme.preprocessorBackgroundColor = [NSColor colorWithCalibratedRed:minimapTheme.preprocessorBackgroundColor.redComponent + green:minimapTheme.preprocessorBackgroundColor.greenComponent + blue:minimapTheme.preprocessorBackgroundColor.blueComponent + alpha:0.3f]; + + minimapTheme.enabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:200.0f/255.0f alpha:1.0f]; + minimapTheme.disabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:200.0f/255.0f alpha:0.5f]; + + minimapTheme.buildIssueWarningBackgroundColor = [NSColor colorWithRed:255/255.0f green:255/255.0f blue:0/255.0f alpha:0.75f]; + minimapTheme.buildIssueErrorBackgroundColor = [NSColor colorWithRed:255/255.0f green:0/255.0f blue:0/255.0f alpha:0.75f]; + + minimapTheme.sourcePlainTextColor = theme.sourcePlainTextColor; + minimapTheme.sourceTextBackgroundColor = theme.sourceTextBackgroundColor; + minimapTheme.dvtTheme = theme; + + return minimapTheme; +} + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index e1ea656..56defb2 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -21,7 +21,7 @@ #import "DVTSourceTextView.h" #import "DVTSourceNodeTypes.h" -#import "DVTFontAndColorTheme.h" +#import "SCXcodeMinimapTheme.h" #import "DVTPreferenceSetManager.h" #import "DVTFoldingManager.h" @@ -31,9 +31,19 @@ #import "DBGBreakpointAnnotation+SCXcodeMinimap.h" #import "DBGBreakpointAnnotation.h" +#import "IDEIssueAnnotationProvider+SCXcodeMinimap.h" +#import "IDEBuildIssueErrorAnnotation.h" +#import "IDEBuildIssueWarningAnnotation.h" + #import "NSScroller+SCXcodeMinimap.h" -const CGFloat kBackgroundColorShadowLevel = 0.1f; +typedef NS_ENUM(NSUInteger, SCXcodeMinimapAnnotationType) { + SCXcodeMinimapAnnotationTypeUndefined, + SCXcodeMinimapBuildIssueTypeWarning, + SCXcodeMinimapBuildIssueTypeError, + SCXcodeMinimapAnnotationTypeBreakpoint +}; + const CGFloat kDurationBetweenInvalidations = 0.5f; static NSString * const kXcodeSyntaxCommentNodeName = @"xcode.syntax.comment"; @@ -45,32 +55,15 @@ static NSString * const IDESourceCodeEditorTextViewBoundsDidChangeNotification = @"IDESourceCodeEditorTextViewBoundsDidChangeNotification"; static NSString * const DVTFontAndColorSourceTextSettingsChangedNotification = @"DVTFontAndColorSourceTextSettingsChangedNotification"; -static NSString * const kBreakpointRangeKey = @"kBreakpointRangeKey"; -static NSString * const kBreakpointEnabledKey = @"kBreakpointEnabledKey"; - - -@interface SCXcodeMinimapTheme : NSObject - -@property (nonatomic, strong) NSColor *backgroundColor; -@property (nonatomic, strong) NSColor *selectionColor; - -@property (nonatomic, strong) NSColor *sourcePlainTextColor; -@property (nonatomic, strong) NSColor *sourceTextBackgroundColor; -@property (nonatomic, strong) NSColor *commentBackgroundColor; -@property (nonatomic, strong) NSColor *preprocessorBackgroundColor; -@property (nonatomic, strong) NSColor *enabledBreakpointColor; -@property (nonatomic, strong) NSColor *disabledBreakpointColor; - -@property (nonatomic, strong) DVTFontAndColorTheme *dvtTheme; - -@end - -@implementation SCXcodeMinimapTheme - -@end +static NSString * const kAnnotationRangeKey = @"kAnnotationRangeKey"; +static NSString * const kAnnotationEnabledKey = @"kAnnotationEnabledKey"; +static NSString * const kAnnotationTypeKey = @"kAnnotationTypeKey"; -@interface SCXcodeMinimapView () +@interface SCXcodeMinimapView () < NSLayoutManagerDelegate, + DVTFoldingManagerDelegate, + DBGBreakpointAnnotationProviderDelegate, + IDEIssueAnnotationProviderDelegate > @property (nonatomic, weak) IDESourceCodeEditor *editor; @property (nonatomic, strong) DVTSourceTextView *editorTextView; @@ -85,10 +78,13 @@ @interface SCXcodeMinimapView () Date: Sun, 24 May 2015 12:23:40 +0100 Subject: [PATCH 63/96] Fixed crashes on editor theme changes. --- SCXcodeMinimap/SCXcodeMinimapView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 56defb2..d331956 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -132,7 +132,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor // The editor's layout manager needs to be the last one, otherwise live issues don't work NSTextStorage *storage = self.editorTextView.textStorage; [storage removeLayoutManager:self.editorTextView.layoutManager]; - [storage addLayoutManager:self.textView.layoutManager]; + [self.textView setTextStorage:storage]; [storage addLayoutManager:self.editorTextView.layoutManager]; [self.editorTextView.foldingManager setDelegate:self]; From fc4bbd4ac607db6e792c0296ae8b5db19f08f497 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 24 May 2015 12:24:14 +0100 Subject: [PATCH 64/96] Fixed minimap 'View' submenu item creation on Xcode 6.3+ --- SCXcodeMinimap/SCXcodeMinimap.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 3137071..f64675f 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -76,7 +76,10 @@ - (id)init if (self = [super init]) { [self registerUserDefaults]; - [self createMenuItem]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self createMenuItem]; + }); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDidFinishSetup:) name:IDESourceCodeEditorDidFinishSetupNotification object:nil]; } From bda58bd16ba6e026894bdbc00ba5c77613b13d9d Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 25 May 2015 11:41:03 +0100 Subject: [PATCH 65/96] Added selected symbol instances highlighting (#56), background updates for breakpoints and build issues, plus clean up. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 12 + .../DBGBreakpointAnnotation+SCXcodeMinimap.m | 13 +- ...akpointAnnotationProvider+SCXcodeMinimap.m | 13 +- .../DVTLayoutManager+SCXcodeMinimap.h | 23 ++ .../DVTLayoutManager+SCXcodeMinimap.m | 39 +++ ...DEIssueAnnotationProvider+SCXcodeMinimap.m | 12 +- SCXcodeMinimap/SCXcodeMinimap.h | 3 + SCXcodeMinimap/SCXcodeMinimap.m | 35 ++- SCXcodeMinimap/SCXcodeMinimapCommon.h | 11 + SCXcodeMinimap/SCXcodeMinimapCommon.m | 19 ++ SCXcodeMinimap/SCXcodeMinimapTheme.h | 2 + SCXcodeMinimap/SCXcodeMinimapTheme.m | 5 +- SCXcodeMinimap/SCXcodeMinimapView.m | 235 +++++++++++------- .../Xcode Headers/DVTLayoutManager.h | 63 ++++- 14 files changed, 350 insertions(+), 135 deletions(-) create mode 100644 SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.m create mode 100644 SCXcodeMinimap/SCXcodeMinimapCommon.h create mode 100644 SCXcodeMinimap/SCXcodeMinimapCommon.m diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 0126b77..0f982b0 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -21,6 +21,8 @@ 18C999FF1A98B04C0008AF54 /* DebuggerUI in Frameworks */ = {isa = PBXBuildFile; fileRef = 18C999FE1A98B04C0008AF54 /* DebuggerUI */; }; 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */; }; 18E577FC1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */; }; + 18ECB80E1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECB80D1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m */; }; + 18ECB8111B1322A300EE4D82 /* SCXcodeMinimapCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECB8101B1322A300EE4D82 /* SCXcodeMinimapCommon.m */; }; 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18FE09B51707639E00118FEB /* Cocoa.framework */; }; 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */; }; 8742532317307161001C947C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8742532217307161001C947C /* QuartzCore.framework */; }; @@ -86,6 +88,10 @@ 18E577F91B119C7200421483 /* DVTMessageBubbleAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTMessageBubbleAnnotation.h; sourceTree = ""; }; 18E577FA1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEIssueAnnotationProvider+SCXcodeMinimap.h"; sourceTree = ""; }; 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEIssueAnnotationProvider+SCXcodeMinimap.m"; sourceTree = ""; }; + 18ECB80C1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTLayoutManager+SCXcodeMinimap.h"; sourceTree = ""; }; + 18ECB80D1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTLayoutManager+SCXcodeMinimap.m"; sourceTree = ""; }; + 18ECB80F1B1322A300EE4D82 /* SCXcodeMinimapCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapCommon.h; sourceTree = ""; }; + 18ECB8101B1322A300EE4D82 /* SCXcodeMinimapCommon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapCommon.m; sourceTree = ""; }; 18FE09B21707639E00118FEB /* SCXcodeMinimap.xcplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SCXcodeMinimap.xcplugin; sourceTree = BUILT_PRODUCTS_DIR; }; 18FE09B51707639E00118FEB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 18FE09B81707639E00118FEB /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; @@ -215,10 +221,14 @@ 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */, 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */, 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */, + 18ECB80C1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.h */, + 18ECB80D1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m */, 18E577FA1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.h */, 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */, 1809FF8D1AED1A730058D946 /* NSScroller+SCXcodeMinimap.h */, 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */, + 18ECB80F1B1322A300EE4D82 /* SCXcodeMinimapCommon.h */, + 18ECB8101B1322A300EE4D82 /* SCXcodeMinimapCommon.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, 184C11701A740F8A002A7C65 /* Xcode Headers */, ); @@ -297,10 +307,12 @@ files = ( 188FCC8A1A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m in Sources */, 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */, + 18ECB8111B1322A300EE4D82 /* SCXcodeMinimapCommon.m in Sources */, 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */, 1889464D1B11DDEE0036175B /* SCXcodeMinimapTheme.m in Sources */, + 18ECB80E1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m in Sources */, 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */, 18E577FC1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m in Sources */, 1809FF8F1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m in Sources */, diff --git a/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m index cbbf064..59c9ca6 100644 --- a/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m +++ b/SCXcodeMinimap/DBGBreakpointAnnotation+SCXcodeMinimap.m @@ -7,23 +7,12 @@ // #import "DBGBreakpointAnnotation+SCXcodeMinimap.h" -#import - +#import "SCXcodeMinimapCommon.h" #import "IDEFileBreakpoint.h" @implementation DBGBreakpointAnnotation (SCXcodeMinimap) @dynamic minimapDelegate; -static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { - Method originalMethod = class_getInstanceMethod(class, originalSelector); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { - class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); - } else { - method_exchangeImplementations(originalMethod, swizzledMethod); - } -} - + (void)load { sc_swizzleInstanceMethod(self, @selector(_redisplay), @selector(sc_redisplay)); diff --git a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m index 5bd69ac..432ed04 100644 --- a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m +++ b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m @@ -7,23 +7,12 @@ // #import "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h" -#import - #import "DBGBreakpointAnnotation+SCXcodeMinimap.h" +#import "SCXcodeMinimapCommon.h" @implementation DBGBreakpointAnnotationProvider (SCXcodeMinimap) @dynamic minimapDelegate; -static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { - Method originalMethod = class_getInstanceMethod(class, originalSelector); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { - class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); - } else { - method_exchangeImplementations(originalMethod, swizzledMethod); - } -} - + (void)load { sc_swizzleInstanceMethod(self, @selector(_addAnnotationForFileBreakpoint:), @selector(sc_addAnnotationForFileBreakpoint:)); diff --git a/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.h b/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.h new file mode 100644 index 0000000..8955730 --- /dev/null +++ b/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.h @@ -0,0 +1,23 @@ +// +// DVTLayoutManager+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 5/25/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DVTLayoutManager.h" + +@protocol DVTLayoutManagerMinimapDelegate; + +@interface DVTLayoutManager (SCXcodeMinimap) + +@property (nonatomic, weak) id minimapDelegate; + +@end + +@protocol DVTLayoutManagerMinimapDelegate + +- (void)layoutManagerDidRequestSelectedSymbolInstancesHighlight:(DVTLayoutManager *)layoutManager; + +@end \ No newline at end of file diff --git a/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.m b/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.m new file mode 100644 index 0000000..cec2cb1 --- /dev/null +++ b/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.m @@ -0,0 +1,39 @@ +// +// DVTLayoutManager+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 5/25/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "DVTLayoutManager+SCXcodeMinimap.h" +#import "SCXcodeMinimapCommon.h" + +@implementation DVTLayoutManager (SCXcodeMinimap) +@dynamic minimapDelegate; + ++ (void)load +{ + sc_swizzleInstanceMethod(self, @selector(_displayAutoHighlightTokens), @selector(sc_displayAutoHighlightTokens)); +} + +- (void)sc_displayAutoHighlightTokens +{ + [self sc_displayAutoHighlightTokens]; + + if([self.minimapDelegate respondsToSelector:@selector(layoutManagerDidRequestSelectedSymbolInstancesHighlight:)]) { + [self.minimapDelegate layoutManagerDidRequestSelectedSymbolInstancesHighlight:self]; + } +} + +- (id)minimapDelegate +{ + return objc_getAssociatedObject(self, @selector(minimapDelegate)); +} + +- (void)setMinimapDelegate:(id)minimapDelegate +{ + objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); +} + +@end diff --git a/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m index 6d6e5ab..158bf64 100644 --- a/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m +++ b/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m @@ -7,7 +7,7 @@ // #import "IDEIssueAnnotationProvider+SCXcodeMinimap.h" -#import +#import "SCXcodeMinimapCommon.h" static void *IDEIssueAnnotationProviderIssuesObservingContext = &IDEIssueAnnotationProviderIssuesObservingContext; @@ -20,16 +20,6 @@ @interface IDEIssueAnnotationProvider (SCXcodeMinimap_Private) @implementation IDEIssueAnnotationProvider (SCXcodeMinimap) @dynamic minimapDelegate; -static void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { - Method originalMethod = class_getInstanceMethod(class, originalSelector); - Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); - if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { - class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); - } else { - method_exchangeImplementations(originalMethod, swizzledMethod); - } -} - + (void)load { sc_swizzleInstanceMethod(self, @selector(providerWillUninstall), @selector(sc_providerWillUninstall)); diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index 80d6141..e71453b 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -20,6 +20,9 @@ extern NSString *const SCXcodeMinimapShouldHighlightBreakpointsKey; extern NSString *const SCXcodeMinimapHighlightIssuesChangeNotification; extern NSString *const SCXcodeMinimapShouldHighlightIssuesKey; +extern NSString *const SCXcodeMinimapHighlightSelectedSymbolChangeNotification; +extern NSString *const SCXcodeMinimapShouldHighlightSelectedSymbolKey; + extern NSString *const SCXcodeMinimapHighlightCommentsChangeNotification; extern NSString *const SCXcodeMinimapShouldHighlightCommentsKey; diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index f64675f..cf18c55 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -29,6 +29,9 @@ NSString *const SCXcodeMinimapHighlightIssuesChangeNotification = @"SCXcodeMinimapHighlightIssuesChangeNotification"; NSString *const SCXcodeMinimapShouldHighlightIssuesKey = @"SCXcodeMinimapShouldHighlightIssuesKey"; +NSString *const SCXcodeMinimapHighlightSelectedSymbolChangeNotification = @"SCXcodeMinimapHighlightSelectedSymbolChangeNotification"; +NSString *const SCXcodeMinimapShouldHighlightSelectedSymbolKey = @"SCXcodeMinimapShouldHighlightSelectedSymbolKey"; + NSString *const SCXcodeMinimapHighlightCommentsChangeNotification = @"SCXcodeMinimapHighlightCommentsChangeNotification"; NSString *const SCXcodeMinimapShouldHighlightCommentsKey = @"SCXcodeMinimapShouldHighlightCommentsKey"; @@ -52,6 +55,7 @@ NSString *const kHighlightBreakpointsMenuItemTitle = @"Highlight breakpoints"; NSString *const kHighlightIssuesMenuItemTitle = @"Highlight issues"; +NSString *const kHighlightSelectedSymbolMenuItemTitle = @"Highlight selected symbol"; NSString *const kHighlightCommentsMenuItemTitle = @"Highlight comments"; NSString *const kHighlightPreprocessorMenuItemTitle = @"Highlight preprocessor"; NSString *const kHighlightEditorMenuItemTitle = @"Highlight main editor"; @@ -88,12 +92,13 @@ - (id)init - (void)registerUserDefaults { - NSDictionary *userDefaults = @{SCXcodeMinimapZoomLevelKey : @(0.1f), - SCXcodeMinimapShouldDisplayKey : @(YES), - SCXcodeMinimapShouldHighlightBreakpointsKey : @(YES), - SCXcodeMinimapShouldHighlightIssuesKey : @(YES), - SCXcodeMinimapShouldHighlightCommentsKey : @(YES), - SCXcodeMinimapShouldHighlightPreprocessorKey : @(YES)}; + NSDictionary *userDefaults = @{SCXcodeMinimapZoomLevelKey : @(0.1f), + SCXcodeMinimapShouldDisplayKey : @(YES), + SCXcodeMinimapShouldHighlightBreakpointsKey : @(YES), + SCXcodeMinimapShouldHighlightIssuesKey : @(YES), + SCXcodeMinimapShouldHighlightSelectedSymbolKey : @(YES), + SCXcodeMinimapShouldHighlightCommentsKey : @(YES), + SCXcodeMinimapShouldHighlightPreprocessorKey : @(YES)}; [[NSUserDefaults standardUserDefaults] registerDefaults:userDefaults]; } @@ -171,6 +176,15 @@ - (void)createMenuItem [highlightIssuesMenuItem setState:(issueHighlightingEnabled ? NSOnState : NSOffState)]; + NSMenuItem *highlightSelectedSymbolMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightSelectedSymbolMenuItemTitle + action:@selector(toggleSelectedSymbolHighlighting:) keyEquivalent:@""]; + [highlightSelectedSymbolMenuItem setTarget:self]; + [minimapMenu addItem:highlightSelectedSymbolMenuItem]; + + BOOL selectedSymbolHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightSelectedSymbolKey] boolValue]; + [highlightSelectedSymbolMenuItem setState:(selectedSymbolHighlightingEnabled ? NSOnState : NSOffState)]; + + NSMenuItem *highlightCommentsMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightCommentsMenuItemTitle action:@selector(toggleCommentsHighlighting:) keyEquivalent:@""]; [highlightCommentsMenuItem setTarget:self]; @@ -287,6 +301,15 @@ - (void)toggleIssuesHighlighting:(NSMenuItem *)sender [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightIssuesChangeNotification object:nil]; } +- (void)toggleSelectedSymbolHighlighting:(NSMenuItem *)sender +{ + BOOL selectedSymbolHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightSelectedSymbolKey] boolValue]; + + [sender setState:(selectedSymbolHighlightingEnabled ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!selectedSymbolHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightSelectedSymbolKey]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightSelectedSymbolChangeNotification object:nil]; +} + - (void)toggleCommentsHighlighting:(NSMenuItem *)sender { BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightCommentsKey] boolValue]; diff --git a/SCXcodeMinimap/SCXcodeMinimapCommon.h b/SCXcodeMinimap/SCXcodeMinimapCommon.h new file mode 100644 index 0000000..b41c160 --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapCommon.h @@ -0,0 +1,11 @@ +// +// SCXcodeMinimapCommon.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 5/25/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import + +extern void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector); diff --git a/SCXcodeMinimap/SCXcodeMinimapCommon.m b/SCXcodeMinimap/SCXcodeMinimapCommon.m new file mode 100644 index 0000000..495764d --- /dev/null +++ b/SCXcodeMinimap/SCXcodeMinimapCommon.m @@ -0,0 +1,19 @@ +// +// SCXcodeMinimapCommon.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 5/25/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "SCXcodeMinimapCommon.h" + +void sc_swizzleInstanceMethod(Class class, SEL originalSelector, SEL swizzledSelector) { + Method originalMethod = class_getInstanceMethod(class, originalSelector); + Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); + if (class_addMethod(class, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod))) { + class_replaceMethod(class, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} diff --git a/SCXcodeMinimap/SCXcodeMinimapTheme.h b/SCXcodeMinimap/SCXcodeMinimapTheme.h index f6fc287..785a499 100644 --- a/SCXcodeMinimap/SCXcodeMinimapTheme.h +++ b/SCXcodeMinimap/SCXcodeMinimapTheme.h @@ -25,6 +25,8 @@ @property (nonatomic, strong) NSColor *buildIssueWarningBackgroundColor; @property (nonatomic, strong) NSColor *buildIssueErrorBackgroundColor; +@property (nonatomic, strong) NSColor *highlightedSymbolBackgroundColor; + @property (nonatomic, strong) DVTFontAndColorTheme *dvtTheme; @end diff --git a/SCXcodeMinimap/SCXcodeMinimapTheme.m b/SCXcodeMinimap/SCXcodeMinimapTheme.m index a9a0712..5d35ead 100644 --- a/SCXcodeMinimap/SCXcodeMinimapTheme.m +++ b/SCXcodeMinimap/SCXcodeMinimapTheme.m @@ -46,8 +46,9 @@ + (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme minimapTheme.enabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:200.0f/255.0f alpha:1.0f]; minimapTheme.disabledBreakpointColor = [NSColor colorWithRed:65.0f/255.0f green:113.0f/255.0f blue:200.0f/255.0f alpha:0.5f]; - minimapTheme.buildIssueWarningBackgroundColor = [NSColor colorWithRed:255/255.0f green:255/255.0f blue:0/255.0f alpha:0.75f]; - minimapTheme.buildIssueErrorBackgroundColor = [NSColor colorWithRed:255/255.0f green:0/255.0f blue:0/255.0f alpha:0.75f]; + minimapTheme.buildIssueWarningBackgroundColor = [NSColor colorWithRed:1.0f green:1.0f blue:0.0f alpha:0.75f]; + minimapTheme.buildIssueErrorBackgroundColor = [NSColor colorWithRed:1.0f green:0.0f blue:0.0f alpha:0.75f]; + minimapTheme.highlightedSymbolBackgroundColor = [NSColor colorWithRed:0.0f green:1.0f blue:0.0f alpha:0.75f]; minimapTheme.sourcePlainTextColor = theme.sourcePlainTextColor; minimapTheme.sourceTextBackgroundColor = theme.sourceTextBackgroundColor; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index d331956..8e2f51f 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -15,7 +15,7 @@ #import "IDEEditorDocument.h" #import "DVTTextStorage.h" -#import "DVTLayoutManager.h" +#import "DVTLayoutManager+SCXcodeMinimap.h" #import "DVTPointerArray.h" #import "DVTSourceTextView.h" @@ -39,9 +39,10 @@ typedef NS_ENUM(NSUInteger, SCXcodeMinimapAnnotationType) { SCXcodeMinimapAnnotationTypeUndefined, - SCXcodeMinimapBuildIssueTypeWarning, - SCXcodeMinimapBuildIssueTypeError, - SCXcodeMinimapAnnotationTypeBreakpoint + SCXcodeMinimapAnnotationTypeTypeWarning, + SCXcodeMinimapAnnotationTypeTypeError, + SCXcodeMinimapAnnotationTypeBreakpoint, + SCXcodeMinimapAnnotationTypeHighlightToken, }; const CGFloat kDurationBetweenInvalidations = 0.5f; @@ -63,7 +64,8 @@ typedef NS_ENUM(NSUInteger, SCXcodeMinimapAnnotationType) { @interface SCXcodeMinimapView () < NSLayoutManagerDelegate, DVTFoldingManagerDelegate, DBGBreakpointAnnotationProviderDelegate, - IDEIssueAnnotationProviderDelegate > + IDEIssueAnnotationProviderDelegate, + DVTLayoutManagerMinimapDelegate > @property (nonatomic, weak) IDESourceCodeEditor *editor; @property (nonatomic, strong) DVTSourceTextView *editorTextView; @@ -79,12 +81,13 @@ @interface SCXcodeMinimapView () < NSLayoutManagerDelegate, @property (nonatomic, assign) BOOL shouldAllowFullSyntaxHighlight; @property (nonatomic, weak) DBGBreakpointAnnotationProvider *breakpointAnnotationProvider; -@property (nonatomic, strong) NSMutableArray *breakpointsDictionaries; - @property (nonatomic, weak) IDEIssueAnnotationProvider *issueAnnotationProvider; -@property (nonatomic, strong) NSMutableArray *issuesDictionaries; -@property (nonatomic, assign) BOOL shouldInvalidateAnnotations; +@property (nonatomic, assign) BOOL shouldUpdateBreakpointsAndIssues; + +@property (nonatomic, strong) NSMutableArray *breakpointsDictionaries; +@property (nonatomic, strong) NSMutableArray *issuesDictionaries; +@property (nonatomic, strong) NSMutableArray *highlightedSymbolDictionaries; @property (nonatomic, strong) NSMutableArray *notificationObservers; @@ -151,7 +154,6 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor for(NSDictionary *providerDictionary in self.editorTextView.annotationManager.annotationProviders) { id annotationProvider = providerDictionary[@"annotationProviderObject"]; - if([annotationProvider isKindOfClass:[DBGBreakpointAnnotationProvider class]]) { self.breakpointAnnotationProvider = annotationProvider; [self.breakpointAnnotationProvider setMinimapDelegate:self]; @@ -162,15 +164,14 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor } BOOL shouldHighlightBreakpoints = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpointsKey] boolValue]; - if(shouldHighlightBreakpoints) { - self.shouldInvalidateAnnotations = YES; - [self invalidateDisplayForVisibleRange]; + BOOL shouldHighlightIssues = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightIssuesKey] boolValue]; + if(shouldHighlightBreakpoints || shouldHighlightIssues) { + [self invalidateBreakpointsAndIssues]; } - BOOL shouldHighlightIssues = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightIssuesKey] boolValue]; - if(shouldHighlightIssues) { - self.shouldInvalidateAnnotations = YES; - [self invalidateDisplayForVisibleRange]; + BOOL shouldHighlightSelectedSymbol = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightIssuesKey] boolValue]; + if(shouldHighlightSelectedSymbol) { + [self invalidateHighligtedSymbols]; } BOOL shouldHideVerticalScroller = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHideEditorScrollerKey] boolValue]; @@ -187,25 +188,27 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapZoomLevelChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { [weakSelf updateSize]; - [weakSelf invalidateDisplayForVisibleRange]; + [weakSelf delayedInvalidateDisplayForVisibleRange]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightBreakpointsChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - weakSelf.shouldInvalidateAnnotations = YES; - [weakSelf invalidateDisplayForVisibleRange]; + [weakSelf invalidateBreakpointsAndIssues]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightIssuesChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - weakSelf.shouldInvalidateAnnotations = YES; - [weakSelf invalidateDisplayForVisibleRange]; + [weakSelf invalidateBreakpointsAndIssues]; + }]]; + + [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightSelectedSymbolChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf invalidateHighligtedSymbols]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightCommentsChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf invalidateDisplayForVisibleRange]; + [weakSelf delayedInvalidateDisplayForVisibleRange]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightPreprocessorChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf invalidateDisplayForVisibleRange]; + [weakSelf delayedInvalidateDisplayForVisibleRange]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightEditorChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -217,7 +220,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [weakSelf.editorTextView.layoutManager setDelegate:(id)weakSelf.editorTextView]; } - [weakSelf invalidateDisplayForVisibleRange]; + [weakSelf delayedInvalidateDisplayForVisibleRange]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -264,9 +267,12 @@ - (void)setVisible:(BOOL)visible [self.textView.layoutManager setBackgroundLayoutEnabled:YES]; [self.textView.layoutManager setAllowsNonContiguousLayout:YES]; + DVTLayoutManager *editorLayoutManager = (DVTLayoutManager *)self.editorTextView.layoutManager; + [editorLayoutManager setMinimapDelegate:self]; + BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; if(editorHighlightingEnabled) { - [self.editorTextView.layoutManager setDelegate:self]; + [editorLayoutManager setDelegate:self]; } } @@ -290,15 +296,24 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager // Delay invalidation for performance reasons and attempt a full range invalidation later if(!self.shouldAllowFullSyntaxHighlight && [layoutManager isEqual:self.textView.layoutManager]) { - - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleRange) object:nil]; - [self performSelector:@selector(invalidateDisplayForVisibleRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; - + [self delayedInvalidateDisplayForVisibleRange]; return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor}; } - + if(self.shouldAllowFullSyntaxHighlight) { - // Set background colors for breakpoints + + if(self.highlightedSymbolDictionaries.count) { + for(NSDictionary *highlightSymbolDictionary in self.highlightedSymbolDictionaries) { + NSRange range = [highlightSymbolDictionary[kAnnotationRangeKey] rangeValue]; + + if(NSIntersectionRange(range, NSMakeRange(charIndex, 1)).length) { + *effectiveCharRange = range; + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, + NSBackgroundColorAttributeName : theme.highlightedSymbolBackgroundColor}; + } + } + } + if(self.breakpointsDictionaries.count) { for(NSDictionary *breakpointDictionary in self.breakpointsDictionaries) { NSRange range = [breakpointDictionary[kAnnotationRangeKey] rangeValue]; @@ -312,16 +327,15 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager } } - // Set background colors for issues if(self.issuesDictionaries.count) { for(NSDictionary *issueDictionary in self.issuesDictionaries) { NSRange range = [issueDictionary[kAnnotationRangeKey] rangeValue]; SCXcodeMinimapAnnotationType annotationType = [issueDictionary[kAnnotationTypeKey] unsignedIntegerValue]; NSColor *backgroundColor = [NSColor greenColor]; - if(annotationType == SCXcodeMinimapBuildIssueTypeError) { + if(annotationType == SCXcodeMinimapAnnotationTypeTypeError) { backgroundColor = self.minimapTheme.buildIssueErrorBackgroundColor; - } else if(annotationType == SCXcodeMinimapBuildIssueTypeWarning) { + } else if(annotationType == SCXcodeMinimapAnnotationTypeTypeWarning) { backgroundColor = self.minimapTheme.buildIssueWarningBackgroundColor; } @@ -395,67 +409,97 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRan - (void)breakpointAnnotationProviderDidChangeBreakpoints:(DBGBreakpointAnnotationProvider *)annotationProvider { - self.shouldInvalidateAnnotations = YES; - - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleRange) object:nil]; - [self performSelector:@selector(invalidateDisplayForVisibleRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; + [self invalidateBreakpointsAndIssues]; } #pragma mark - IDEIssueAnnotationProviderDelegate - (void)issueAnnotationProviderDidChangeIssues:(IDEIssueAnnotationProvider *)annotationProvider { - self.shouldInvalidateAnnotations = YES; - - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleRange) object:nil]; - [self performSelector:@selector(invalidateDisplayForVisibleRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; + [self invalidateBreakpointsAndIssues]; +} + +#pragma mark - DVTLayoutManagerMinimapDelegate + +- (void)layoutManagerDidRequestSelectedSymbolInstancesHighlight:(DVTLayoutManager *)layoutManager +{ + [self invalidateHighligtedSymbols]; } #pragma mark - Annotations -- (void)updateAnnotations +- (void)updateBreakpointsAndIssuesWithCompletion:(void(^)())completion { + self.breakpointsDictionaries = [NSMutableArray array]; + self.issuesDictionaries = [NSMutableArray array]; + BOOL canHighlightBreakpoints = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpointsKey] boolValue]; BOOL canHighlightIssues = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightIssuesKey] boolValue]; - self.breakpointsDictionaries = [NSMutableArray array]; - self.issuesDictionaries = [NSMutableArray array]; + if(!canHighlightBreakpoints && !canHighlightIssues) { + if(completion) { + completion(); + } + return; + } - for (NSUInteger index = 0, lineNumber = 0; index < self.textView.string.length; lineNumber++) { - - NSRange lineRange = [self.textView.string lineRangeForRange:NSMakeRange(index, 0)]; - - if(canHighlightBreakpoints) { - for(DBGBreakpointAnnotation *breakpointAnnotation in self.breakpointAnnotationProvider.annotations) { - if(breakpointAnnotation.paragraphRange.location == lineNumber) { - [self.breakpointsDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], - kAnnotationEnabledKey : @(breakpointAnnotation.enabled)}]; + __weak typeof(self) weakSelf = self; + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ + for (NSUInteger index = 0, lineNumber = 0; index < self.textView.string.length; lineNumber++) { + + NSRange lineRange = [weakSelf.textView.string lineRangeForRange:NSMakeRange(index, 0)]; + + if(canHighlightBreakpoints) { + for(DBGBreakpointAnnotation *breakpointAnnotation in weakSelf.breakpointAnnotationProvider.annotations) { + if(breakpointAnnotation.paragraphRange.location == lineNumber) { + [weakSelf.breakpointsDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], + kAnnotationEnabledKey : @(breakpointAnnotation.enabled), + kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeBreakpoint)}]; + } } } - } - - if(canHighlightIssues) { - for(IDEBuildIssueAnnotation *issueAnnotation in self.issueAnnotationProvider.annotations) { - if(issueAnnotation.paragraphRange.location == lineNumber) { - - SCXcodeMinimapAnnotationType annotationType = SCXcodeMinimapAnnotationTypeUndefined; - - if([issueAnnotation isKindOfClass:[IDEBuildIssueWarningAnnotation class]]) { - annotationType = SCXcodeMinimapBuildIssueTypeWarning; - } else if([issueAnnotation isKindOfClass:[IDEBuildIssueErrorAnnotation class]]) { - annotationType = SCXcodeMinimapBuildIssueTypeError; + + if(canHighlightIssues) { + for(IDEBuildIssueAnnotation *issueAnnotation in weakSelf.issueAnnotationProvider.annotations) { + if(issueAnnotation.paragraphRange.location == lineNumber) { + + SCXcodeMinimapAnnotationType annotationType = SCXcodeMinimapAnnotationTypeUndefined; + if([issueAnnotation isKindOfClass:[IDEBuildIssueErrorAnnotation class]]) { + annotationType = SCXcodeMinimapAnnotationTypeTypeError; + } else if([issueAnnotation isKindOfClass:[IDEBuildIssueWarningAnnotation class]]) { + annotationType = SCXcodeMinimapAnnotationTypeTypeWarning; + } + + [weakSelf.issuesDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], + kAnnotationTypeKey : @(annotationType)}]; } - - [self.issuesDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], - kAnnotationTypeKey : @(annotationType)}]; } } + + index = NSMaxRange(lineRange); } - index = NSMaxRange(lineRange); - } + dispatch_async(dispatch_get_main_queue(), ^{ + if(completion) { + completion(); + } + }); + }); +} + +- (void)updateHighlightedSymbols +{ + BOOL canHighlightSelectedSymbol = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightSelectedSymbolKey] boolValue]; + + self.highlightedSymbolDictionaries = [NSMutableArray array]; - self.shouldInvalidateAnnotations = NO; + if(canHighlightSelectedSymbol) { + DVTLayoutManager *layoutManager = (DVTLayoutManager *)self.editorTextView.layoutManager; + [layoutManager.autoHighlightTokenRanges enumerateObjectsUsingBlock:^(NSValue *rangeValue, NSUInteger idx, BOOL *stop) { + [self.highlightedSymbolDictionaries addObject:@{kAnnotationRangeKey : rangeValue, + kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeHighlightToken)}]; + }]; + } } #pragma mark - Navigation @@ -598,19 +642,44 @@ - (void)resizeWithOldSuperviewSize:(NSSize)oldSize #pragma mark - Helpers +- (void)invalidateBreakpointsAndIssues +{ + self.shouldUpdateBreakpointsAndIssues = YES; + [self delayedInvalidateDisplayForVisibleRange]; +} + +- (void)invalidateHighligtedSymbols +{ + [self updateHighlightedSymbols]; + [self delayedInvalidateDisplayForVisibleRange]; +} + +- (void)delayedInvalidateDisplayForVisibleRange +{ + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleRange) object:nil]; + [self performSelector:@selector(invalidateDisplayForVisibleRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; +} + - (void)invalidateDisplayForVisibleRange { - if(self.shouldInvalidateAnnotations) { - [self updateAnnotations]; - } - - self.shouldAllowFullSyntaxHighlight = YES; - - NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; - [self.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; + void (^performVisibleRangeInvalidation)() = ^{ + self.shouldAllowFullSyntaxHighlight = YES; + + NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; + [self.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; + + NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; + [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:visibleEditorRange]; + }; - NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; - [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:visibleEditorRange]; + if(self.shouldUpdateBreakpointsAndIssues) { + self.shouldUpdateBreakpointsAndIssues = NO; + [self updateBreakpointsAndIssuesWithCompletion:^{ + performVisibleRangeInvalidation(); + }]; + } else { + performVisibleRangeInvalidation(); + } } @end diff --git a/SCXcodeMinimap/Xcode Headers/DVTLayoutManager.h b/SCXcodeMinimap/Xcode Headers/DVTLayoutManager.h index 2af94a7..b4129b1 100644 --- a/SCXcodeMinimap/Xcode Headers/DVTLayoutManager.h +++ b/SCXcodeMinimap/Xcode Headers/DVTLayoutManager.h @@ -1,36 +1,71 @@ -/* - * Generated by class-dump 3.3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. - */ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// #import "DVTFoldingLayoutManager.h" -@class DVTMapTable, DVTPointerArray, NSArray, NSMutableArray, NSMutableSet, NSSet; +@class DVTMapTable, DVTMutableRangeArray, DVTObservingToken, DVTPointerArray, NSArray, NSColor, NSMutableArray, NSMutableSet, NSSet, NSString, NSTimer; @interface DVTLayoutManager : DVTFoldingLayoutManager { + NSArray *_temporaryLinkRanges; NSMutableArray *_annotations; DVTPointerArray *_lastDeletedAnnotations; DVTMapTable *_messageBubblesForAnnotations; NSMutableSet *_accessoryAnnotations; NSArray *_sortedAccessoryAnnotations; + NSTimer *_autoHighlightTokenTimer; + DVTObservingToken *_autoHighlightTextCompletionObserver; + DVTMutableRangeArray *_autoHighlightTokenRanges; + DVTMutableRangeArray *_tokenizedEditingTokenRanges; + unsigned long long _tokenizedEditingEditedTokenIndex; + unsigned long long _tokenizedEditingDeferedOffset; + struct _NSRange _tokenizedEditingSelectionRange; + NSColor *_tokenizedEditingTokenBorderColor; + NSColor *_tokenizedEditingTokenBackgroundColor; + NSColor *_tokenizedEditingSelectedTokenBorderColor; + NSColor *_tokenizedEditingSelectedTokenBackgroundColor; + BOOL _tokenizedEditingEnabled; } ++ (Class)_dvtDefaultTypesetterClass; + (void)initialize; +@property(copy) NSColor *tokenizedEditingSelectedTokenBackgroundColor; // @synthesize tokenizedEditingSelectedTokenBackgroundColor=_tokenizedEditingSelectedTokenBackgroundColor; +@property(copy) NSColor *tokenizedEditingSelectedTokenBorderColor; // @synthesize tokenizedEditingSelectedTokenBorderColor=_tokenizedEditingSelectedTokenBorderColor; +@property(copy) NSColor *tokenizedEditingTokenBackgroundColor; // @synthesize tokenizedEditingTokenBackgroundColor=_tokenizedEditingTokenBackgroundColor; +@property(copy) NSColor *tokenizedEditingTokenBorderColor; // @synthesize tokenizedEditingTokenBorderColor=_tokenizedEditingTokenBorderColor; +@property struct _NSRange tokenizedEditingSelectionRange; // @synthesize tokenizedEditingSelectionRange=_tokenizedEditingSelectionRange; +@property(readonly, copy) NSArray *tokenizedEditingTokenRanges; // @synthesize tokenizedEditingTokenRanges=_tokenizedEditingTokenRanges; +@property(readonly, copy) NSArray *autoHighlightTokenRanges; // @synthesize autoHighlightTokenRanges=_autoHighlightTokenRanges; @property(readonly) NSSet *accessoryAnnotations; // @synthesize accessoryAnnotations=_accessoryAnnotations; @property(readonly) NSArray *annotations; // @synthesize annotations=_annotations; +@property(retain) NSArray *temporaryLinkRanges; // @synthesize temporaryLinkRanges=_temporaryLinkRanges; - (struct _NSRange)rangeForCharacterRange:(struct _NSRange)arg1 withContextLines:(long long)arg2 proposedHeight:(double *)arg3 contentLines:(unsigned long long *)arg4 totalLines:(unsigned long long *)arg5; - (void)drawUnderlineForGlyphRange:(struct _NSRange)arg1 underlineType:(long long)arg2 baselineOffset:(double)arg3 lineFragmentRect:(struct CGRect)arg4 lineFragmentGlyphRange:(struct _NSRange)arg5 containerOrigin:(struct CGPoint)arg6; - (void)drawBackgroundForGlyphRange:(struct _NSRange)arg1 atPoint:(struct CGPoint)arg2; - (void)fillBackgroundRectArray:(struct CGRect *)arg1 count:(unsigned long long)arg2 forCharacterRange:(struct _NSRange)arg3 color:(id)arg4; - (void)textStorage:(id)arg1 didUpdateLineRange:(struct _NSRange)arg2 changeInLength:(long long)arg3 replacedCharacterRangeEndsOnLineTerminator:(BOOL)arg4 entireFirstLineReplaced:(BOOL)arg5; - (void)textStorageDidEndEditing:(id)arg1; +- (void)textStorage:(id)arg1 didEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; +- (void)textStorage:(id)arg1 willEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; +- (void)textStorage:(id)arg1 didReplaceCharactersInRange:(struct _NSRange)arg2 withString:(id)arg3 changeInLength:(long long)arg4; - (void)textStorage:(id)arg1 willReplaceCharactersInRange:(struct _NSRange)arg2 withString:(id)arg3 changeInLength:(long long)arg4; - (void)foldingManager:(id)arg1 didUnfoldRange:(struct _NSRange)arg2; - (void)foldingManager:(id)arg1 didFoldRange:(struct _NSRange)arg2; - (void)didRemoveAnnotations:(id)arg1; - (void)didInsertAnnotations:(id)arg1; +- (void)drawTokensForGlyphRange:(struct _NSRange)arg1 border:(BOOL)arg2 background:(BOOL)arg3; +- (id)tokenizedEditingTokenPathsForCharacterRange:(struct _NSRange)arg1 displayOnly:(BOOL)arg2; +- (void)updateTokenizedEditingTokenRanges; +- (unsigned long long)indexOfTokenizedEditingTokenRange:(struct _NSRange)arg1; +@property(getter=isTokenizedEditingEnabled) BOOL tokenizedEditingEnabled; // @synthesize tokenizedEditingEnabled=_tokenizedEditingEnabled; +- (void)scheduleAutoHighlightTokenWithTextView:(id)arg1; +- (void)_autoHighlightTokenWithTimer:(id)arg1; +- (void)_clearAutoHighlightTokens; +- (void)_displayAutoHighlightTokens; +@property(getter=isAutoHighlightTokensEnabled) BOOL autoHighlightTokensEnabled; - (void)hideMessageBubblesInRange:(struct _NSRange)arg1; - (void)showMessageBubblesInRange:(struct _NSRange)arg1; @property(getter=isAnnotationAdjustmentEnabled) BOOL annotationAdjustmentEnabled; @@ -43,18 +78,28 @@ - (void)_removeAnnotationsAtIndexes:(id)arg1; - (void)addAnnotation:(id)arg1; - (id)annotationsInRange:(struct _NSRange)arg1; -- (void)_mergeBubbleViewsAtParagraphIndex:(unsigned long long)arg1; -- (id)_annotationIndexesInParagraphRange:(struct _NSRange)arg1 suggestedIndex:(unsigned long long *)arg2; +- (void)mergeAnnotationsAtParagraphIndex:(unsigned long long)arg1; +- (id)annotationIndexesInParagraphRange:(struct _NSRange)arg1 suggestedIndex:(unsigned long long *)arg2; - (void)_removeBubbleViewFromAnnotation:(id)arg1; - (void)_addBubbleViewToAnnotation:(id)arg1 annotationsInRange:(id)arg2; - (void)_assertAnnotationIntegrity; - (void)_updateMessageBubbleVisibilityForAnnotation:(id)arg1; +@property BOOL temporaryLinkIsAlternate; +- (void)clearTemporaryLinkRanges; +- (void)setTemporaryLinkRanges:(id)arg1 isAlternate:(BOOL)arg2; - (void)invalidateDisplayForCharacterRange:(struct _NSRange)arg1; - (void)_invalidateLayoutForMessageBubblesInCharacterRange:(struct _NSRange)arg1; -- (void)_invalidateLayoutForExtendedCharacterRange:(NSRange)charRange isSoft:(BOOL)isSoft; - (unsigned long long)layoutOptions; +- (void)setDelegate:(id)arg1; - (id)initWithCoder:(id)arg1; - (id)init; - (void)_layoutManagerCommonInit; +// Remaining properties +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) Class superclass; + @end + From 763e458cb48e1b2a2eb3ee68661256007c32c038 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 25 May 2015 17:25:53 +0100 Subject: [PATCH 66/96] Fixes selected symbol highlighting crashes under Xcode 6.2 --- SCXcodeMinimap/SCXcodeMinimapView.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 8e2f51f..86380d8 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -495,6 +495,10 @@ - (void)updateHighlightedSymbols if(canHighlightSelectedSymbol) { DVTLayoutManager *layoutManager = (DVTLayoutManager *)self.editorTextView.layoutManager; + if(![layoutManager respondsToSelector:@selector(autoHighlightTokenRanges)]) { + return; + } + [layoutManager.autoHighlightTokenRanges enumerateObjectsUsingBlock:^(NSValue *rangeValue, NSUInteger idx, BOOL *stop) { [self.highlightedSymbolDictionaries addObject:@{kAnnotationRangeKey : rangeValue, kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeHighlightToken)}]; From f42aacc528e9a1d7ba2429743bd132882c7e8e4f Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 27 May 2015 17:59:55 +0100 Subject: [PATCH 67/96] Fixes #58 --- SCXcodeMinimap/SCXcodeMinimapView.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 86380d8..c7aee87 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -635,6 +635,10 @@ - (void)resizeWithOldSuperviewSize:(NSSize)oldSize { [super resizeWithOldSuperviewSize:oldSize]; + if(self.editorTextView.textStorage.editedMask) { + return; + } + self.shouldAllowFullSyntaxHighlight = NO; CGRect frame = self.textView.bounds; From e743424ff3c934e64f6416423b1b31869e2b6ff1 Mon Sep 17 00:00:00 2001 From: Richard Ross Date: Thu, 28 May 2015 18:27:15 -0700 Subject: [PATCH 68/96] Fixed minimap hiding annotations before toggling visibility. --- SCXcodeMinimap/SCXcodeMinimapView.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index e1ea656..4bc4087 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -235,8 +235,10 @@ - (void)viewDidMoveToWindow if(self.window == nil) { return; } - - [self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; + + dispatch_async(dispatch_get_main_queue(), ^{ + [self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; + }); } #pragma mark - Show/Hide @@ -536,9 +538,10 @@ - (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme - (void)updateSize { CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue]; - + CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel); - + NSLog(@"zoomLevel: %f, minimapWidth: %f", zoomLevel, minimapWidth); + NSRect editorScrollViewFrame = self.editor.scrollView.frame; editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth; self.editor.scrollView.frame = editorScrollViewFrame; From 1699c5a24b53498026f30846822aa5e3a4346b09 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 29 May 2015 07:34:47 +0100 Subject: [PATCH 69/96] Removed unnecessary log. --- SCXcodeMinimap/SCXcodeMinimapView.m | 1 - 1 file changed, 1 deletion(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 086dbb2..194f111 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -616,7 +616,6 @@ - (void)updateSize CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue]; CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel); - NSLog(@"zoomLevel: %f, minimapWidth: %f", zoomLevel, minimapWidth); NSRect editorScrollViewFrame = self.editor.scrollView.frame; editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth; From 2f3dbfb0a129aec4197cbdf7e05a6bc53b710665 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 29 May 2015 22:12:36 +0100 Subject: [PATCH 70/96] Considering text container insets in offset calculations, moved size menu item title to its own constant. --- SCXcodeMinimap/SCXcodeMinimap.m | 4 +++- SCXcodeMinimap/SCXcodeMinimapView.m | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index cf18c55..f6b3610 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -53,6 +53,8 @@ NSString *const kShowMinimapMenuItemTitle = @"Show Minimap"; NSString *const kHideMinimapMenuItemTitle = @"Hide Minimap"; +NSString *const kSizeMenuItemTitle = @"Size"; + NSString *const kHighlightBreakpointsMenuItemTitle = @"Highlight breakpoints"; NSString *const kHighlightIssuesMenuItemTitle = @"Highlight issues"; NSString *const kHighlightSelectedSymbolMenuItemTitle = @"Highlight selected symbol"; @@ -131,7 +133,7 @@ - (void)createMenuItem [sizeView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin]; NSTextField *sizeViewTitleLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(18.0f, 0.0f, 50.0f, 20.0f)]; - [sizeViewTitleLabel setStringValue:@"Size"]; + [sizeViewTitleLabel setStringValue:kSizeMenuItemTitle]; [sizeViewTitleLabel setFont:[NSFont systemFontOfSize:14]]; [sizeViewTitleLabel setBezeled:NO]; [sizeViewTitleLabel setDrawsBackground:NO]; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 194f111..d175daf 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -529,15 +529,14 @@ - (void)updateOffset return; } - CGFloat ratio = (adjustedMinimapContentHeight / adjustedEditorContentHeight) * (1 / self.scrollView.magnification); - CGPoint offset = NSMakePoint(self.editor.scrollView.contentView.bounds.origin.x, - MAX(0, floorf(self.editor.scrollView.contentView.bounds.origin.y * ratio * self.scrollView.magnification))); - - [self.scrollView.documentView scrollPoint:offset]; + CGFloat editorYOffset = CGRectGetMinY(self.editor.scrollView.contentView.bounds) + ABS(CGRectGetMinY(self.editorTextView.frame)); + CGFloat ratio = (adjustedMinimapContentHeight / adjustedEditorContentHeight) * (1 / self.scrollView.magnification); + [self.scrollView.documentView scrollPoint:NSMakePoint(self.editor.scrollView.contentView.bounds.origin.x, + MAX(0, floorf(editorYOffset * ratio * self.scrollView.magnification)))]; ratio = (editorTextHeight - self.selectionView.bounds.size.height) / adjustedEditorContentHeight; - selectionViewFrame.origin.y = self.editor.scrollView.contentView.bounds.origin.y * ratio; + selectionViewFrame.origin.y = editorYOffset * ratio; [self.selectionView setFrame:selectionViewFrame]; } @@ -569,6 +568,7 @@ - (void)handleMouseEvent:(NSEvent *)theEvent NSRect neededRect = [self.editorTextView.layoutManager boundingRectForGlyphRange:activeRange inTextContainer:self.editorTextView.textContainer]; neededRect.origin.y = MAX(0, neededRect.origin.y - CGRectGetHeight(self.editor.containerView.bounds) / 2); + neededRect.origin.y += CGRectGetMinY(self.editorTextView.frame); BOOL shouldAnimateContentOffset = (theEvent.type != NSLeftMouseDragged); From 7b2cc7f30f2408b49a47fad2eb1a44fa6331793d Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 30 May 2015 11:13:25 +0100 Subject: [PATCH 71/96] Fixed size menu item layout and updated readme. --- README.md | 27 ++++++++++------- ...akpointAnnotationProvider+SCXcodeMinimap.m | 2 +- SCXcodeMinimap/SCXcodeMinimap.m | 6 ++-- SCXcodeMinimap/SCXcodeMinimapView.m | 30 +++++++++---------- 4 files changed, 35 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 1197667..a33b5f0 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,27 @@ -# SCXcodeMinimap v2.0 +# SCXcodeMinimap v2.2 SCXcodeMiniMap is a Xcode plugin that adds a source editor Minimap to Xcode. -Version 2.0 has been rewritten from the ground up to address performance issues (delays on large source files - 1000+ lines) and for creating a better base to build upon. As such, the following new features are now supported: +#### Features -#### New Features -- Faster syntax highlighting -- Shows code foldings -- Comment and preprocessor directive highlighting -- Breakpoint highlighting -- All highlighting options are also available for the main Xcode editor +- Custom size - Custom themes -- All options are accessible from the View/Minimap menu item +- Can hide the main editor scroller +- Show code foldings +- Highlights comments and preprocessor directives +- Highlights breakpoints +- Highlights build errors and warnings +- Hihglights Xcode's "instances of selected symbol" (Preferences/Text Editing) +- All these highlighting options are also available for the main editor + +All options are configurable through the View/Minimap menu item #### Screenshots Without editor highlighting | With editor highlighting :--------------------------:|:--------------------------: -![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-01.png) | ![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-03.png) | -![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-02.png) | ![](https://dl.dropboxusercontent.com/u/12748201/SCXcodeMiniMap/v2.0/SCXcodeMinimap%20v2.0-04.png) | +![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-01.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-03.png) | +![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-02.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-04.png) | + +![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/selectedSymbolInstancesHighlighting.gif) #### Installation - Through [Alcatraz](https://github.com/supermarin/Alcatraz) diff --git a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m index 432ed04..9d8ea4f 100644 --- a/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m +++ b/SCXcodeMinimap/DBGBreakpointAnnotationProvider+SCXcodeMinimap.m @@ -21,7 +21,7 @@ + (void)load } - (id)minimapDelegate -{ +{ return objc_getAssociatedObject(self, @selector(minimapDelegate)); } diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index f6b3610..2e0c7d1 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -129,10 +129,10 @@ - (void)createMenuItem [minimapMenu addItem:[NSMenuItem separatorItem]]; - NSView *sizeView = [[NSView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 200.0f, 20.0f)]; + NSView *sizeView = [[NSView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 225.0f, 20.0f)]; [sizeView setAutoresizingMask:NSViewMinXMargin | NSViewMaxXMargin | NSViewMinYMargin | NSViewMaxYMargin]; - NSTextField *sizeViewTitleLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(18.0f, 0.0f, 50.0f, 20.0f)]; + NSTextField *sizeViewTitleLabel = [[NSTextField alloc] initWithFrame:NSMakeRect(20.0f, 0.0f, 50.0f, 20.0f)]; [sizeViewTitleLabel setStringValue:kSizeMenuItemTitle]; [sizeViewTitleLabel setFont:[NSFont systemFontOfSize:14]]; [sizeViewTitleLabel setBezeled:NO]; @@ -141,7 +141,7 @@ - (void)createMenuItem [sizeViewTitleLabel setSelectable:NO]; [sizeView addSubview:sizeViewTitleLabel]; - NSSlider *sizeSlider = [[NSSlider alloc] initWithFrame:CGRectMake(60.0f, 0.0f, 136.0f, 20.0f)]; + NSSlider *sizeSlider = [[NSSlider alloc] initWithFrame:CGRectMake(60.0f, 0.0f, 156.0f, 20.0f)]; [sizeSlider setMaxValue:0.35f]; [sizeSlider setMinValue:0.05f]; [sizeSlider setTarget:self]; diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index d175daf..7e97294 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -96,7 +96,7 @@ @interface SCXcodeMinimapView () < NSLayoutManagerDelegate, @implementation SCXcodeMinimapView - (void)dealloc -{ +{ for(id observer in self.notificationObservers) { [[NSNotificationCenter defaultCenter] removeObserver:observer]; } @@ -113,7 +113,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor self.editor = editor; self.editorTextView = editor.textView; - + [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin | NSViewWidthSizable | NSViewHeightSizable]; @@ -251,10 +251,10 @@ - (void)viewDidMoveToWindow if(self.window == nil) { return; } - - dispatch_async(dispatch_get_main_queue(), ^{ - [self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; - }); + + dispatch_async(dispatch_get_main_queue(), ^{ + [self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; + }); } #pragma mark - Show/Hide @@ -265,7 +265,7 @@ - (void)setVisible:(BOOL)visible [self updateSize]; - [self.textView.layoutManager setDelegate:(self.hidden ? nil : self)]; + [self.textView.layoutManager setDelegate:(self.hidden ? nil : self)]; [self.textView.layoutManager setBackgroundLayoutEnabled:YES]; [self.textView.layoutManager setAllowsNonContiguousLayout:YES]; @@ -301,7 +301,7 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager [self delayedInvalidateDisplayForVisibleRange]; return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor}; } - + if(self.shouldAllowFullSyntaxHighlight) { if(self.highlightedSymbolDictionaries.count) { @@ -455,8 +455,8 @@ - (void)updateBreakpointsAndIssuesWithCompletion:(void(^)())completion for(DBGBreakpointAnnotation *breakpointAnnotation in weakSelf.breakpointAnnotationProvider.annotations) { if(breakpointAnnotation.paragraphRange.location == lineNumber) { [weakSelf.breakpointsDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], - kAnnotationEnabledKey : @(breakpointAnnotation.enabled), - kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeBreakpoint)}]; + kAnnotationEnabledKey : @(breakpointAnnotation.enabled), + kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeBreakpoint)}]; } } } @@ -473,7 +473,7 @@ - (void)updateBreakpointsAndIssuesWithCompletion:(void(^)())completion } [weakSelf.issuesDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], - kAnnotationTypeKey : @(annotationType)}]; + kAnnotationTypeKey : @(annotationType)}]; } } } @@ -588,7 +588,7 @@ - (void)handleMouseEvent:(NSEvent *)theEvent - (void)updateTheme { self.editorTheme = [SCXcodeMinimapTheme minimapThemeWithTheme:[DVTFontAndColorTheme currentTheme]]; - + DVTPreferenceSetManager *preferenceSetManager = [DVTFontAndColorTheme preferenceSetsManager]; NSArray *preferenceSet = [preferenceSetManager availablePreferenceSets]; @@ -614,9 +614,9 @@ - (void)updateTheme - (void)updateSize { CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue]; - + CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel); - + NSRect editorScrollViewFrame = self.editor.scrollView.frame; editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth; self.editor.scrollView.frame = editorScrollViewFrame; @@ -626,7 +626,7 @@ - (void)updateSize CGRect frame = self.textView.bounds; frame.size.width = CGRectGetWidth(self.editorTextView.bounds); [self.textView setFrame:frame]; - + CGFloat actualZoomLevel = CGRectGetWidth(self.bounds) / CGRectGetWidth(self.editor.textView.bounds); [self.scrollView setMagnification:actualZoomLevel]; From 459a7473333fa79c9a388e4667c146de60433815 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 6 Jun 2015 16:35:13 +0100 Subject: [PATCH 72/96] - added search results highlighting - added autohiding for small files (#44) - started invalidating the full text range on changes (prevents artifacts) --- README.md | 22 +- SCXcodeMinimap.xcodeproj/project.pbxproj | 12 +- .../xcschemes/SCXcodeMinimap.xcscheme | 17 +- .../DVTLayoutManager+SCXcodeMinimap.m | 18 +- .../IDESourceCodeEditor+SCXcodeMinimap.h | 25 ++ .../IDESourceCodeEditor+SCXcodeMinimap.m | 53 ++++ SCXcodeMinimap/SCXcodeMinimap-Info.plist | 4 +- SCXcodeMinimap/SCXcodeMinimap.h | 6 + SCXcodeMinimap/SCXcodeMinimap.m | 45 +++ SCXcodeMinimap/SCXcodeMinimapTheme.h | 3 + SCXcodeMinimap/SCXcodeMinimapTheme.m | 11 +- SCXcodeMinimap/SCXcodeMinimapView.m | 262 ++++++++++++------ SCXcodeMinimap/Xcode Headers/DVTFindResult.h | 43 +++ 13 files changed, 401 insertions(+), 120 deletions(-) create mode 100644 SCXcodeMinimap/IDESourceCodeEditor+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/IDESourceCodeEditor+SCXcodeMinimap.m create mode 100644 SCXcodeMinimap/Xcode Headers/DVTFindResult.h diff --git a/README.md b/README.md index a33b5f0..7b752cf 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,19 @@ -# SCXcodeMinimap v2.2 +# SCXcodeMinimap v2.3 SCXcodeMiniMap is a Xcode plugin that adds a source editor Minimap to Xcode. #### Features - Custom size - Custom themes +- Highlighting: + - search results + - comments and preprocessor directives + - breakpoints + - build errors and warnings + - Xcode's "instances of selected symbol" (Preferences/Text Editing) +- Can autohide for small files - Can hide the main editor scroller -- Show code foldings -- Highlights comments and preprocessor directives -- Highlights breakpoints -- Highlights build errors and warnings -- Hihglights Xcode's "instances of selected symbol" (Preferences/Text Editing) -- All these highlighting options are also available for the main editor +- Shows code foldings All options are configurable through the View/Minimap menu item @@ -21,14 +23,16 @@ Without editor highlighting | With editor highlighting ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-01.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-03.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-02.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-04.png) | +![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/searchResultsHighlighting.png) + ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/selectedSymbolInstancesHighlighting.gif) #### Installation - Through [Alcatraz](https://github.com/supermarin/Alcatraz) -- Download the sources, build the project and restart Xcode +- or download the sources, build the project and restart Xcode -- Download SCXcodeMinimap.xcplugin.zip from the releases tab, unzip and move it to the Xcode plugins folder ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeMinimap.xcplugin +- or download SCXcodeMinimap.xcplugin.zip from the releases tab, unzip and move it to the Xcode plugins folder ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeMinimap.xcplugin - If you encounter any issues you can uninstall it by removing the ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/SCXcodeMinimap.xcplugin folder diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 0f982b0..f325c22 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */; }; 18C999FF1A98B04C0008AF54 /* DebuggerUI in Frameworks */ = {isa = PBXBuildFile; fileRef = 18C999FE1A98B04C0008AF54 /* DebuggerUI */; }; 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */; }; + 18DE25ED1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DE25EC1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m */; }; 18E577FC1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */; }; 18ECB80E1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECB80D1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m */; }; 18ECB8111B1322A300EE4D82 /* SCXcodeMinimapCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECB8101B1322A300EE4D82 /* SCXcodeMinimapCommon.m */; }; @@ -82,6 +83,9 @@ 18C999FE1A98B04C0008AF54 /* DebuggerUI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = DebuggerUI; path = /Applications/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS/DebuggerUI; sourceTree = ""; }; 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpoint.h; sourceTree = ""; }; 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; + 18DE25EB1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDESourceCodeEditor+SCXcodeMinimap.h"; sourceTree = ""; }; + 18DE25EC1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDESourceCodeEditor+SCXcodeMinimap.m"; sourceTree = ""; }; + 18DE6AFB1B203D070042615D /* DVTFindResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFindResult.h; sourceTree = ""; }; 18E577F61B119BF200421483 /* IDEBuildIssueAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEBuildIssueAnnotation.h; sourceTree = ""; }; 18E577F71B119C1000421483 /* IDEBuildIssueWarningAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBuildIssueWarningAnnotation.h; sourceTree = ""; }; 18E577F81B119C3F00421483 /* IDEBuildIssueErrorAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBuildIssueErrorAnnotation.h; sourceTree = ""; }; @@ -134,6 +138,7 @@ 18C999FD1A98AF580008AF54 /* DVTAnnotationProvider.h */, 184C11711A740F8A002A7C65 /* DVTCompletingTextView.h */, 184407651A8F7B3E00C530CF /* DVTDocumentLocation.h */, + 18DE6AFB1B203D070042615D /* DVTFindResult.h */, 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */, 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */, 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */, @@ -217,6 +222,8 @@ 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */, 1889464B1B11DDEE0036175B /* SCXcodeMinimapTheme.h */, 1889464C1B11DDEE0036175B /* SCXcodeMinimapTheme.m */, + 18ECB80F1B1322A300EE4D82 /* SCXcodeMinimapCommon.h */, + 18ECB8101B1322A300EE4D82 /* SCXcodeMinimapCommon.m */, 18C2EA5A1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.h */, 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */, 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */, @@ -225,10 +232,10 @@ 18ECB80D1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m */, 18E577FA1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.h */, 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */, + 18DE25EB1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.h */, + 18DE25EC1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m */, 1809FF8D1AED1A730058D946 /* NSScroller+SCXcodeMinimap.h */, 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */, - 18ECB80F1B1322A300EE4D82 /* SCXcodeMinimapCommon.h */, - 18ECB8101B1322A300EE4D82 /* SCXcodeMinimapCommon.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, 184C11701A740F8A002A7C65 /* Xcode Headers */, ); @@ -311,6 +318,7 @@ 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */, 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */, 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */, + 18DE25ED1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m in Sources */, 1889464D1B11DDEE0036175B /* SCXcodeMinimapTheme.m in Sources */, 18ECB80E1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m in Sources */, 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */, diff --git a/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme b/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme index 8dde247..a2103d7 100644 --- a/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme +++ b/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme @@ -1,10 +1,10 @@ + version = "2.0"> + parallelizeBuildables = "NO" + buildImplicitDependencies = "NO"> diff --git a/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.m b/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.m index cec2cb1..8ead5c5 100644 --- a/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.m +++ b/SCXcodeMinimap/DVTLayoutManager+SCXcodeMinimap.m @@ -17,15 +17,6 @@ + (void)load sc_swizzleInstanceMethod(self, @selector(_displayAutoHighlightTokens), @selector(sc_displayAutoHighlightTokens)); } -- (void)sc_displayAutoHighlightTokens -{ - [self sc_displayAutoHighlightTokens]; - - if([self.minimapDelegate respondsToSelector:@selector(layoutManagerDidRequestSelectedSymbolInstancesHighlight:)]) { - [self.minimapDelegate layoutManagerDidRequestSelectedSymbolInstancesHighlight:self]; - } -} - - (id)minimapDelegate { return objc_getAssociatedObject(self, @selector(minimapDelegate)); @@ -36,4 +27,13 @@ - (void)setMinimapDelegate:(id)minimapDelegate objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); } +- (void)sc_displayAutoHighlightTokens +{ + [self sc_displayAutoHighlightTokens]; + + if([self.minimapDelegate respondsToSelector:@selector(layoutManagerDidRequestSelectedSymbolInstancesHighlight:)]) { + [self.minimapDelegate layoutManagerDidRequestSelectedSymbolInstancesHighlight:self]; + } +} + @end diff --git a/SCXcodeMinimap/IDESourceCodeEditor+SCXcodeMinimap.h b/SCXcodeMinimap/IDESourceCodeEditor+SCXcodeMinimap.h new file mode 100644 index 0000000..a84fa94 --- /dev/null +++ b/SCXcodeMinimap/IDESourceCodeEditor+SCXcodeMinimap.h @@ -0,0 +1,25 @@ +// +// IDESourceCodeEditor+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 6/4/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "IDESourceCodeEditor.h" + +@protocol IDESourceCodeEditorSearchResultsDelegate; + +@interface IDESourceCodeEditor (SCXcodeMinimap) + +@property (nonatomic, weak) id searchResultsDelegate; + +@property (nonatomic, strong) NSArray *searchResults; + +@end + +@protocol IDESourceCodeEditorSearchResultsDelegate + +- (void)sourceCodeEditorDidUpdateSearchResults:(IDESourceCodeEditor *)editor; + +@end diff --git a/SCXcodeMinimap/IDESourceCodeEditor+SCXcodeMinimap.m b/SCXcodeMinimap/IDESourceCodeEditor+SCXcodeMinimap.m new file mode 100644 index 0000000..9b1aa38 --- /dev/null +++ b/SCXcodeMinimap/IDESourceCodeEditor+SCXcodeMinimap.m @@ -0,0 +1,53 @@ +// +// IDESourceCodeEditor+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 6/4/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "IDESourceCodeEditor+SCXcodeMinimap.h" +#import "SCXcodeMinimapCommon.h" + +@implementation IDESourceCodeEditor (SCXcodeMinimap) + ++ (void)load +{ + sc_swizzleInstanceMethod([self class], @selector(dvtFindBar:didUpdateResults:), @selector(sc_dvtFindBar:didUpdateResults:)); +} + +- (void)sc_dvtFindBar:(id)findBar didUpdateResults:(NSArray *)searchResults +{ + [self sc_dvtFindBar:findBar didUpdateResults:searchResults]; + [self setSearchResults:searchResults]; +} + +- (NSArray *)searchResults +{ + return objc_getAssociatedObject(self, @selector(searchResults)); +} + +- (void)setSearchResults:(NSArray *)searchResults +{ + if([self.searchResults isEqual:searchResults]) { + return; + } + + objc_setAssociatedObject(self, @selector(searchResults), searchResults, OBJC_ASSOCIATION_RETAIN); + + if([self.searchResultsDelegate respondsToSelector:@selector(sourceCodeEditorDidUpdateSearchResults:)]) { + [self.searchResultsDelegate sourceCodeEditorDidUpdateSearchResults:self]; + } +} + +- (id)searchResultsDelegate +{ + return objc_getAssociatedObject(self, @selector(searchResultsDelegate)); +} + +- (void)setSearchResultsDelegate:(id)searchResultsDelegate +{ + objc_setAssociatedObject(self, @selector(searchResultsDelegate), searchResultsDelegate, OBJC_ASSOCIATION_ASSIGN); +} + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 271622f..20bf43f 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -38,10 +38,12 @@ E969541F-E6F9-4D25-8158-72DC3545A6C6 8DC44374-2B35-4C57-A6FE-2AD66A36AAD9 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright Copyright © 2013 Stefan Ceriu. All rights reserved. NSPrincipalClass - + SCXcodeMinimap XC4Compatible XCGCReady diff --git a/SCXcodeMinimap/SCXcodeMinimap.h b/SCXcodeMinimap/SCXcodeMinimap.h index e71453b..1c06091 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.h +++ b/SCXcodeMinimap/SCXcodeMinimap.h @@ -23,6 +23,9 @@ extern NSString *const SCXcodeMinimapShouldHighlightIssuesKey; extern NSString *const SCXcodeMinimapHighlightSelectedSymbolChangeNotification; extern NSString *const SCXcodeMinimapShouldHighlightSelectedSymbolKey; +extern NSString *const SCXcodeMinimapHighlightSearchResultsChangeNotification; +extern NSString *const SCXcodeMinimapShouldHighlightSearchResultsKey; + extern NSString *const SCXcodeMinimapHighlightCommentsChangeNotification; extern NSString *const SCXcodeMinimapShouldHighlightCommentsKey; @@ -35,6 +38,9 @@ extern NSString *const SCXcodeMinimapShouldHighlightEditorKey; extern NSString *const SCXcodeMinimapHideEditorScrollerChangeNotification; extern NSString *const SCXcodeMinimapShouldHideEditorScrollerKey; +extern NSString *const SCXcodeMinimapAutohideChangeNotification; +extern NSString *const SCXcodeMinimapShouldAutohideKey; + extern NSString *const SCXcodeMinimapThemeChangeNotification; extern NSString *const SCXcodeMinimapThemeKey; diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 2e0c7d1..26d4380 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -32,6 +32,9 @@ NSString *const SCXcodeMinimapHighlightSelectedSymbolChangeNotification = @"SCXcodeMinimapHighlightSelectedSymbolChangeNotification"; NSString *const SCXcodeMinimapShouldHighlightSelectedSymbolKey = @"SCXcodeMinimapShouldHighlightSelectedSymbolKey"; +NSString *const SCXcodeMinimapHighlightSearchResultsChangeNotification = @"SCXcodeMinimapHighlightSearchResultsChangeNotification"; +NSString *const SCXcodeMinimapShouldHighlightSearchResultsKey = @"SCXcodeMinimapShouldHighlightSearchResultsKey"; + NSString *const SCXcodeMinimapHighlightCommentsChangeNotification = @"SCXcodeMinimapHighlightCommentsChangeNotification"; NSString *const SCXcodeMinimapShouldHighlightCommentsKey = @"SCXcodeMinimapShouldHighlightCommentsKey"; @@ -44,6 +47,9 @@ NSString *const SCXcodeMinimapHideEditorScrollerChangeNotification = @"SCXcodeMinimapHideEditorScrollerChangeNotification"; NSString *const SCXcodeMinimapShouldHideEditorScrollerKey = @"SCXcodeMinimapShouldHideEditorScrollerKey"; +NSString *const SCXcodeMinimapAutohideChangeNotification = @"SCXcodeMinimapAutohideChangeNotification"; +NSString *const SCXcodeMinimapShouldAutohideKey = @"SCXcodeMinimapShouldAutohideKey"; + NSString *const SCXcodeMinimapThemeChangeNotification = @"SCXcodeMinimapThemeChangeNotification"; NSString *const SCXcodeMinimapThemeKey = @"SCXcodeMinimapThemeKey"; @@ -58,10 +64,12 @@ NSString *const kHighlightBreakpointsMenuItemTitle = @"Highlight breakpoints"; NSString *const kHighlightIssuesMenuItemTitle = @"Highlight issues"; NSString *const kHighlightSelectedSymbolMenuItemTitle = @"Highlight selected symbol"; +NSString *const kHighlightSearchResultsMenuItemTitle = @"Highlight search results"; NSString *const kHighlightCommentsMenuItemTitle = @"Highlight comments"; NSString *const kHighlightPreprocessorMenuItemTitle = @"Highlight preprocessor"; NSString *const kHighlightEditorMenuItemTitle = @"Highlight main editor"; NSString *const kHideEditorScrollerMenuItemTitle = @"Hide editor scroller"; +NSString *const kAutohideMenuItemTitle = @"Autohide"; NSString *const kThemeMenuItemTitle = @"Theme"; NSString *const kEditorThemeMenuItemTitle = @"Editor Theme"; @@ -99,6 +107,7 @@ - (void)registerUserDefaults SCXcodeMinimapShouldHighlightBreakpointsKey : @(YES), SCXcodeMinimapShouldHighlightIssuesKey : @(YES), SCXcodeMinimapShouldHighlightSelectedSymbolKey : @(YES), + SCXcodeMinimapShouldHighlightSearchResultsKey : @(YES), SCXcodeMinimapShouldHighlightCommentsKey : @(YES), SCXcodeMinimapShouldHighlightPreprocessorKey : @(YES)}; @@ -187,6 +196,15 @@ - (void)createMenuItem [highlightSelectedSymbolMenuItem setState:(selectedSymbolHighlightingEnabled ? NSOnState : NSOffState)]; + NSMenuItem *highlightSearchResultsMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightSearchResultsMenuItemTitle + action:@selector(toggleSearchResultsHighlighting:) keyEquivalent:@""]; + [highlightSearchResultsMenuItem setTarget:self]; + [minimapMenu addItem:highlightSearchResultsMenuItem]; + + BOOL searchResultsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightSearchResultsKey] boolValue]; + [highlightSearchResultsMenuItem setState:(searchResultsHighlightingEnabled ? NSOnState : NSOffState)]; + + NSMenuItem *highlightCommentsMenuItem = [[NSMenuItem alloc] initWithTitle:kHighlightCommentsMenuItemTitle action:@selector(toggleCommentsHighlighting:) keyEquivalent:@""]; [highlightCommentsMenuItem setTarget:self]; @@ -223,6 +241,15 @@ - (void)createMenuItem [hideEditorScrollerMenuItem setState:(shouldHideEditorScroller ? NSOnState : NSOffState)]; + NSMenuItem *autohideMenuItem = [[NSMenuItem alloc] initWithTitle:kAutohideMenuItemTitle + action:@selector(toggleAutohide:) keyEquivalent:@""]; + [autohideMenuItem setTarget:self]; + [minimapMenu addItem:autohideMenuItem]; + + BOOL shouldAutohide = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldAutohideKey] boolValue]; + [autohideMenuItem setState:(shouldAutohide ? NSOnState : NSOffState)]; + + [minimapMenu addItem:[NSMenuItem separatorItem]]; } @@ -312,6 +339,15 @@ - (void)toggleSelectedSymbolHighlighting:(NSMenuItem *)sender [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightSelectedSymbolChangeNotification object:nil]; } +- (void)toggleSearchResultsHighlighting:(NSMenuItem *)sender +{ + BOOL searchResultsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightSearchResultsKey] boolValue]; + + [sender setState:(searchResultsHighlightingEnabled ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!searchResultsHighlightingEnabled) forKey:SCXcodeMinimapShouldHighlightSearchResultsKey]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHighlightSearchResultsChangeNotification object:nil]; +} + - (void)toggleCommentsHighlighting:(NSMenuItem *)sender { BOOL commentsHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightCommentsKey] boolValue]; @@ -348,6 +384,15 @@ - (void)toggleEditorScrollerHiding:(NSMenuItem *)sender [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil]; } +- (void)toggleAutohide:(NSMenuItem *)sender +{ + BOOL shouldAutohide = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldAutohideKey] boolValue]; + + [sender setState:(shouldAutohide ? NSOffState : NSOnState)]; + [[NSUserDefaults standardUserDefaults] setObject:@(!shouldAutohide) forKey:SCXcodeMinimapShouldAutohideKey]; + [[NSNotificationCenter defaultCenter] postNotificationName:SCXcodeMinimapAutohideChangeNotification object:nil]; +} + - (void)setMinimapTheme:(NSMenuItem *)sender { NSString *currentThemeName = [[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapThemeKey]; diff --git a/SCXcodeMinimap/SCXcodeMinimapTheme.h b/SCXcodeMinimap/SCXcodeMinimapTheme.h index 785a499..556360f 100644 --- a/SCXcodeMinimap/SCXcodeMinimapTheme.h +++ b/SCXcodeMinimap/SCXcodeMinimapTheme.h @@ -27,6 +27,9 @@ @property (nonatomic, strong) NSColor *highlightedSymbolBackgroundColor; +@property (nonatomic, strong) NSColor *searchResultForegroundColor; +@property (nonatomic, strong) NSColor *searchResultBackgroundColor; + @property (nonatomic, strong) DVTFontAndColorTheme *dvtTheme; @end diff --git a/SCXcodeMinimap/SCXcodeMinimapTheme.m b/SCXcodeMinimap/SCXcodeMinimapTheme.m index 5d35ead..d656a8e 100644 --- a/SCXcodeMinimap/SCXcodeMinimapTheme.m +++ b/SCXcodeMinimap/SCXcodeMinimapTheme.m @@ -21,6 +21,8 @@ + (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme { SCXcodeMinimapTheme *minimapTheme = [[SCXcodeMinimapTheme alloc] init]; + minimapTheme.dvtTheme = theme; + minimapTheme.backgroundColor = [theme.sourceTextBackgroundColor shadowWithLevel:kBackgroundColorShadowLevel]; minimapTheme.selectionColor = [NSColor colorWithCalibratedRed:(1.0f - [minimapTheme.backgroundColor redComponent]) @@ -28,6 +30,8 @@ + (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme blue:(1.0f - [minimapTheme.backgroundColor blueComponent]) alpha:0.2f]; + minimapTheme.sourcePlainTextColor = theme.sourcePlainTextColor; + minimapTheme.sourceTextBackgroundColor = theme.sourceTextBackgroundColor; DVTPointerArray *colors = [theme syntaxColorsByNodeType]; minimapTheme.commentBackgroundColor = [colors pointerAtIndex:[DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName]]; @@ -48,11 +52,10 @@ + (SCXcodeMinimapTheme *)minimapThemeWithTheme:(DVTFontAndColorTheme *)theme minimapTheme.buildIssueWarningBackgroundColor = [NSColor colorWithRed:1.0f green:1.0f blue:0.0f alpha:0.75f]; minimapTheme.buildIssueErrorBackgroundColor = [NSColor colorWithRed:1.0f green:0.0f blue:0.0f alpha:0.75f]; - minimapTheme.highlightedSymbolBackgroundColor = [NSColor colorWithRed:0.0f green:1.0f blue:0.0f alpha:0.75f]; + minimapTheme.highlightedSymbolBackgroundColor = [NSColor colorWithRed:255.0f/255.0f green:29.0f/255.0f blue:21.0f/255.0f alpha:0.75f]; - minimapTheme.sourcePlainTextColor = theme.sourcePlainTextColor; - minimapTheme.sourceTextBackgroundColor = theme.sourceTextBackgroundColor; - minimapTheme.dvtTheme = theme; + minimapTheme.searchResultForegroundColor = [minimapTheme.sourcePlainTextColor colorWithAlphaComponent:0.25f]; + minimapTheme.searchResultBackgroundColor = [NSColor colorWithRed:255.0f/255.0f green:29.0f/255.0f blue:21.0f/255.0f alpha:0.75f]; return minimapTheme; } diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 7e97294..9b5297f 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -11,7 +11,7 @@ #import "SCXcodeMinimapScrollView.h" #import "SCXcodeMinimapSelectionView.h" -#import "IDESourceCodeEditor.h" +#import "IDESourceCodeEditor+SCXcodeMinimap.h" #import "IDEEditorDocument.h" #import "DVTTextStorage.h" @@ -21,6 +21,9 @@ #import "DVTSourceTextView.h" #import "DVTSourceNodeTypes.h" +#import "DVTFindResult.h" +#import "DVTTextDocumentLocation.h" + #import "SCXcodeMinimapTheme.h" #import "DVTPreferenceSetManager.h" @@ -43,6 +46,7 @@ typedef NS_ENUM(NSUInteger, SCXcodeMinimapAnnotationType) { SCXcodeMinimapAnnotationTypeTypeError, SCXcodeMinimapAnnotationTypeBreakpoint, SCXcodeMinimapAnnotationTypeHighlightToken, + SCXcodeMinimapAnnotationTypeSearchResult }; const CGFloat kDurationBetweenInvalidations = 0.5f; @@ -65,7 +69,8 @@ @interface SCXcodeMinimapView () < NSLayoutManagerDelegate, DVTFoldingManagerDelegate, DBGBreakpointAnnotationProviderDelegate, IDEIssueAnnotationProviderDelegate, - DVTLayoutManagerMinimapDelegate > + DVTLayoutManagerMinimapDelegate, + IDESourceCodeEditorSearchResultsDelegate > @property (nonatomic, weak) IDESourceCodeEditor *editor; @property (nonatomic, strong) DVTSourceTextView *editorTextView; @@ -85,9 +90,10 @@ @interface SCXcodeMinimapView () < NSLayoutManagerDelegate, @property (nonatomic, assign) BOOL shouldUpdateBreakpointsAndIssues; -@property (nonatomic, strong) NSMutableArray *breakpointsDictionaries; -@property (nonatomic, strong) NSMutableArray *issuesDictionaries; -@property (nonatomic, strong) NSMutableArray *highlightedSymbolDictionaries; +@property (nonatomic, strong) NSMutableArray *breakpoints; +@property (nonatomic, strong) NSMutableArray *buildIssues; +@property (nonatomic, strong) NSMutableArray *highlightedSymbols; +@property (nonatomic, strong) NSMutableArray *searchResults; @property (nonatomic, strong) NSMutableArray *notificationObservers; @@ -111,6 +117,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor if (self = [super init]) { self.editor = editor; + [self.editor setSearchResultsDelegate:self]; self.editorTextView = editor.textView; @@ -150,7 +157,6 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self updateTheme]; - for(NSDictionary *providerDictionary in self.editorTextView.annotationManager.annotationProviders) { id annotationProvider = providerDictionary[@"annotationProviderObject"]; @@ -188,7 +194,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapZoomLevelChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { [weakSelf updateSize]; - [weakSelf delayedInvalidateDisplayForVisibleRange]; + [weakSelf delayedInvalidateMinimap]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightBreakpointsChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -203,12 +209,16 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [weakSelf invalidateHighligtedSymbols]; }]]; + [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightSearchResultsChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [weakSelf invalidateSearchResults]; + }]]; + [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightCommentsChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf delayedInvalidateDisplayForVisibleRange]; + [weakSelf delayedInvalidateMinimap]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightPreprocessorChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf delayedInvalidateDisplayForVisibleRange]; + [weakSelf delayedInvalidateMinimap]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHighlightEditorChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -220,7 +230,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [weakSelf.editorTextView.layoutManager setDelegate:(id)weakSelf.editorTextView]; } - [weakSelf delayedInvalidateDisplayForVisibleRange]; + [weakSelf delayedInvalidateMinimap]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapHideEditorScrollerChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -228,6 +238,10 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [weakSelf.editor.scrollView.verticalScroller setForcedHidden:shouldHideVerticalScroller]; }]]; + [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapAutohideChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { + [self tryShowing]; + }]]; + [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapThemeChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { [weakSelf updateTheme]; }]]; @@ -252,6 +266,20 @@ - (void)viewDidMoveToWindow return; } + [self tryShowing]; +} + +- (void)tryShowing +{ + BOOL shouldAutohide = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldAutohideKey] boolValue]; + + if(shouldAutohide) { + NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; + if(NSEqualRanges(visibleEditorRange, NSMakeRange(0, self.textView.string.length))) { + return; + } + } + dispatch_async(dispatch_get_main_queue(), ^{ [self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; }); @@ -284,7 +312,7 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager shouldUseTemporaryAttributes:(NSDictionary *)attrs forDrawingToScreen:(BOOL)toScreen atCharacterIndex:(NSUInteger)charIndex - effectiveRange:(NSRangePointer)effectiveCharRange + effectiveRange:(NSRangePointer)effectiveRange { if(!toScreen) { return nil; @@ -296,79 +324,97 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager SCXcodeMinimapTheme *theme = ([layoutManager isEqualTo:self.textView.layoutManager] ? self.minimapTheme : self.editorTheme); + if(self.searchResults.count) { + + NSRange closestRange = NSMakeRange(self.textView.string.length, 0); + for(NSDictionary *searchResultDictionary in self.searchResults) { + NSRange range = [searchResultDictionary[kAnnotationRangeKey] rangeValue]; + + if(NSLocationInRange(charIndex, range)) { + *effectiveRange = range; + return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor, + NSBackgroundColorAttributeName :theme.searchResultBackgroundColor}; + } + + if((closestRange.location - charIndex) > (range.location - charIndex)) { + closestRange = range; + } + } + + *effectiveRange = NSMakeRange(charIndex, closestRange.location - charIndex); + return @{NSForegroundColorAttributeName : theme.searchResultForegroundColor}; + } + // Delay invalidation for performance reasons and attempt a full range invalidation later if(!self.shouldAllowFullSyntaxHighlight && [layoutManager isEqual:self.textView.layoutManager]) { - [self delayedInvalidateDisplayForVisibleRange]; + [self delayedInvalidateMinimap]; return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor}; } if(self.shouldAllowFullSyntaxHighlight) { - if(self.highlightedSymbolDictionaries.count) { - for(NSDictionary *highlightSymbolDictionary in self.highlightedSymbolDictionaries) { - NSRange range = [highlightSymbolDictionary[kAnnotationRangeKey] rangeValue]; - - if(NSIntersectionRange(range, NSMakeRange(charIndex, 1)).length) { - *effectiveCharRange = range; - return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, - NSBackgroundColorAttributeName : theme.highlightedSymbolBackgroundColor}; - } + for(NSDictionary *highlightSymbolDictionary in self.highlightedSymbols) { + NSRange range = [highlightSymbolDictionary[kAnnotationRangeKey] rangeValue]; + + if(NSLocationInRange(charIndex, range)) { + *effectiveRange = range; + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, + NSBackgroundColorAttributeName : theme.highlightedSymbolBackgroundColor}; } } - if(self.breakpointsDictionaries.count) { - for(NSDictionary *breakpointDictionary in self.breakpointsDictionaries) { - NSRange range = [breakpointDictionary[kAnnotationRangeKey] rangeValue]; - BOOL enabled = [breakpointDictionary[kAnnotationEnabledKey] boolValue]; - - if(NSIntersectionRange(range, NSMakeRange(charIndex, 1)).length) { - *effectiveCharRange = range; - return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, - NSBackgroundColorAttributeName : (enabled ? theme.enabledBreakpointColor : theme.disabledBreakpointColor)}; - } + for(NSDictionary *breakpointDictionary in self.breakpoints) { + NSRange range = [breakpointDictionary[kAnnotationRangeKey] rangeValue]; + BOOL enabled = [breakpointDictionary[kAnnotationEnabledKey] boolValue]; + + if(NSLocationInRange(charIndex, range)) { + *effectiveRange = range; + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, + NSBackgroundColorAttributeName : (enabled ? theme.enabledBreakpointColor : theme.disabledBreakpointColor)}; } } - if(self.issuesDictionaries.count) { - for(NSDictionary *issueDictionary in self.issuesDictionaries) { - NSRange range = [issueDictionary[kAnnotationRangeKey] rangeValue]; - SCXcodeMinimapAnnotationType annotationType = [issueDictionary[kAnnotationTypeKey] unsignedIntegerValue]; - - NSColor *backgroundColor = [NSColor greenColor]; - if(annotationType == SCXcodeMinimapAnnotationTypeTypeError) { - backgroundColor = self.minimapTheme.buildIssueErrorBackgroundColor; - } else if(annotationType == SCXcodeMinimapAnnotationTypeTypeWarning) { - backgroundColor = self.minimapTheme.buildIssueWarningBackgroundColor; - } - - if(NSIntersectionRange(range, NSMakeRange(charIndex, 1)).length) { - *effectiveCharRange = range; - return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, - NSBackgroundColorAttributeName : backgroundColor}; - } + for(NSDictionary *issueDictionary in self.buildIssues) { + NSRange range = [issueDictionary[kAnnotationRangeKey] rangeValue]; + SCXcodeMinimapAnnotationType annotationType = [issueDictionary[kAnnotationTypeKey] unsignedIntegerValue]; + + NSColor *backgroundColor = [NSColor greenColor]; + if(annotationType == SCXcodeMinimapAnnotationTypeTypeError) { + backgroundColor = self.minimapTheme.buildIssueErrorBackgroundColor; + } else if(annotationType == SCXcodeMinimapAnnotationTypeTypeWarning) { + backgroundColor = self.minimapTheme.buildIssueWarningBackgroundColor; + } + + if(NSLocationInRange(charIndex, range)) { + *effectiveRange = range; + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, + NSBackgroundColorAttributeName : backgroundColor}; } } } - // Set background colors for comments and preprocessor directives short nodeType = [(DVTTextStorage *)[self.textView textStorage] nodeTypeAtCharacterIndex:charIndex - effectiveRange:effectiveCharRange + effectiveRange:effectiveRange context:self.editorTextView.syntaxColoringContext]; - BOOL shouldHighlightComments = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightCommentsKey] boolValue]; - if(shouldHighlightComments) { - if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || - nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || - nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) - { - return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : theme.commentBackgroundColor}; - } - } - BOOL shouldHighlightPreprocessor = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessorKey] boolValue]; - if(shouldHighlightPreprocessor) { - if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { - return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : theme.preprocessorBackgroundColor}; + + if(self.shouldAllowFullSyntaxHighlight) { + BOOL shouldHighlightComments = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightCommentsKey] boolValue]; + if(shouldHighlightComments) { + if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentNodeName] || + nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocNodeName] || + nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxCommentDocKeywordNodeName]) + { + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : theme.commentBackgroundColor}; + } + } + + BOOL shouldHighlightPreprocessor = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightPreprocessorKey] boolValue]; + if(shouldHighlightPreprocessor) { + if(nodeType == [DVTSourceNodeTypes registerNodeTypeNamed:kXcodeSyntaxPreprocessorNodeName]) { + return @{NSForegroundColorAttributeName : theme.sourceTextBackgroundColor, NSBackgroundColorAttributeName : theme.preprocessorBackgroundColor}; + } } } @@ -380,9 +426,11 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager return @{NSForegroundColorAttributeName : foregroundColor}; } -- (void)layoutManager:(NSLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag +- (void)layoutManager:(DVTLayoutManager *)layoutManager didCompleteLayoutForTextContainer:(NSTextContainer *)textContainer atEnd:(BOOL)layoutFinishedFlag { - self.shouldAllowFullSyntaxHighlight = NO; + if(layoutFinishedFlag) { + self.shouldAllowFullSyntaxHighlight = NO; + } } #pragma mark - DVTFoldingManagerDelegate @@ -428,12 +476,19 @@ - (void)layoutManagerDidRequestSelectedSymbolInstancesHighlight:(DVTLayoutManage [self invalidateHighligtedSymbols]; } +#pragma mark - IDESourceCodeEditorSearchResultsDelegate + +- (void)sourceCodeEditorDidUpdateSearchResults:(IDESourceCodeEditor *)editor +{ + [self invalidateSearchResults]; +} + #pragma mark - Annotations - (void)updateBreakpointsAndIssuesWithCompletion:(void(^)())completion { - self.breakpointsDictionaries = [NSMutableArray array]; - self.issuesDictionaries = [NSMutableArray array]; + self.breakpoints = [NSMutableArray array]; + self.buildIssues = [NSMutableArray array]; BOOL canHighlightBreakpoints = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightBreakpointsKey] boolValue]; BOOL canHighlightIssues = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightIssuesKey] boolValue]; @@ -454,9 +509,9 @@ - (void)updateBreakpointsAndIssuesWithCompletion:(void(^)())completion if(canHighlightBreakpoints) { for(DBGBreakpointAnnotation *breakpointAnnotation in weakSelf.breakpointAnnotationProvider.annotations) { if(breakpointAnnotation.paragraphRange.location == lineNumber) { - [weakSelf.breakpointsDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], - kAnnotationEnabledKey : @(breakpointAnnotation.enabled), - kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeBreakpoint)}]; + [weakSelf.breakpoints addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], + kAnnotationEnabledKey : @(breakpointAnnotation.enabled), + kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeBreakpoint)}]; } } } @@ -472,8 +527,8 @@ - (void)updateBreakpointsAndIssuesWithCompletion:(void(^)())completion annotationType = SCXcodeMinimapAnnotationTypeTypeWarning; } - [weakSelf.issuesDictionaries addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], - kAnnotationTypeKey : @(annotationType)}]; + [weakSelf.buildIssues addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:lineRange], + kAnnotationTypeKey : @(annotationType)}]; } } } @@ -493,7 +548,7 @@ - (void)updateHighlightedSymbols { BOOL canHighlightSelectedSymbol = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightSelectedSymbolKey] boolValue]; - self.highlightedSymbolDictionaries = [NSMutableArray array]; + self.highlightedSymbols = [NSMutableArray array]; if(canHighlightSelectedSymbol) { DVTLayoutManager *layoutManager = (DVTLayoutManager *)self.editorTextView.layoutManager; @@ -502,8 +557,24 @@ - (void)updateHighlightedSymbols } [layoutManager.autoHighlightTokenRanges enumerateObjectsUsingBlock:^(NSValue *rangeValue, NSUInteger idx, BOOL *stop) { - [self.highlightedSymbolDictionaries addObject:@{kAnnotationRangeKey : rangeValue, - kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeHighlightToken)}]; + [self.highlightedSymbols addObject:@{kAnnotationRangeKey : rangeValue, + kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeHighlightToken)}]; + }]; + } +} + +- (void)updateSearchResults +{ + BOOL canHighlightSearchResults = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightSearchResultsKey] boolValue]; + + self.searchResults = [NSMutableArray array]; + + if(canHighlightSearchResults) { + [self.editor.searchResults enumerateObjectsUsingBlock:^(DVTFindResult *result, NSUInteger idx, BOOL *stop) { + + DVTTextDocumentLocation *location = (DVTTextDocumentLocation *)[result location]; + [self.searchResults addObject:@{kAnnotationRangeKey : [NSValue valueWithRange:NSMakeRange(location.characterRange.location, location.characterRange.length)], + kAnnotationTypeKey : @(SCXcodeMinimapAnnotationTypeSearchResult)}]; }]; } } @@ -655,40 +726,55 @@ - (void)resizeWithOldSuperviewSize:(NSSize)oldSize - (void)invalidateBreakpointsAndIssues { self.shouldUpdateBreakpointsAndIssues = YES; - [self delayedInvalidateDisplayForVisibleRange]; + [self delayedInvalidateMinimap]; } - (void)invalidateHighligtedSymbols { [self updateHighlightedSymbols]; - [self delayedInvalidateDisplayForVisibleRange]; + [self delayedInvalidateMinimap]; +} + +- (void)invalidateSearchResults +{ + [self updateSearchResults]; + [self delayedInvalidateMinimap]; +} + +- (void)layoutManagerDidReceiveTextStorageUpdate:(DVTLayoutManager *)layoutManager +{ + [self delayedInvalidateMinimap]; } -- (void)delayedInvalidateDisplayForVisibleRange +- (void)delayedInvalidateMinimap { - [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateDisplayForVisibleRange) object:nil]; - [self performSelector:@selector(invalidateDisplayForVisibleRange) withObject:nil afterDelay:kDurationBetweenInvalidations]; + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(invalidateMinimap) object:nil]; + [self performSelector:@selector(invalidateMinimap) withObject:nil afterDelay:kDurationBetweenInvalidations]; } -- (void)invalidateDisplayForVisibleRange +- (void)invalidateMinimap { - void (^performVisibleRangeInvalidation)() = ^{ + void (^performFullRangeInvalidation)() = ^{ + self.shouldAllowFullSyntaxHighlight = YES; - NSRange visibleMinimapRange = [self.textView visibleCharacterRange]; - [self.textView.layoutManager invalidateDisplayForCharacterRange:visibleMinimapRange]; + NSRange fullTextRange = NSMakeRange(0, self.textView.string.length); - NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; - [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:visibleEditorRange]; + [self.textView.layoutManager invalidateDisplayForCharacterRange:fullTextRange]; + + BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; + if(editorHighlightingEnabled) { + [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:fullTextRange]; + } }; if(self.shouldUpdateBreakpointsAndIssues) { self.shouldUpdateBreakpointsAndIssues = NO; [self updateBreakpointsAndIssuesWithCompletion:^{ - performVisibleRangeInvalidation(); + performFullRangeInvalidation(); }]; } else { - performVisibleRangeInvalidation(); + performFullRangeInvalidation(); } } diff --git a/SCXcodeMinimap/Xcode Headers/DVTFindResult.h b/SCXcodeMinimap/Xcode Headers/DVTFindResult.h new file mode 100644 index 0000000..b973887 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTFindResult.h @@ -0,0 +1,43 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +@class DVTDocumentLocation, DVTFindDescriptor, NSDictionary, NSString; + +@interface DVTFindResult : NSObject +{ + DVTDocumentLocation *_location; + DVTFindDescriptor *_findDescriptor; + NSString *_contextString; + struct _NSRange _contextRange; + DVTDocumentLocation *_replacedLocation; + int _replaceState; + NSString *_replacedString; + NSDictionary *_userInfo; +} + ++ (struct _NSRange)lineRangeForFoundRange:(struct _NSRange)arg1 inString:(id)arg2; +@property(readonly, copy) NSDictionary *userInfo; // @synthesize userInfo=_userInfo; +@property(copy) DVTDocumentLocation *replacedLocation; // @synthesize replacedLocation=_replacedLocation; +@property int replaceState; // @synthesize replaceState=_replaceState; +@property(copy, nonatomic) NSString *replacedString; // @synthesize replacedString=_replacedString; +@property(readonly) struct _NSRange contextRange; // @synthesize contextRange=_contextRange; +@property(readonly) NSString *contextString; // @synthesize contextString=_contextString; +@property(readonly) DVTDocumentLocation *location; // @synthesize location=_location; +@property(readonly) DVTFindDescriptor *findDescriptor; // @synthesize findDescriptor=_findDescriptor; +- (id)copyWithContextString:(id)arg1 contextRange:(struct _NSRange)arg2 userInfo:(id)arg3; +- (id)copyWithUpdatedLocation:(id)arg1; +- (id)stringForReplacementString:(id)arg1; +@property(readonly) NSString *foundString; +- (BOOL)isEqual:(id)arg1; +- (unsigned long long)hash; +- (id)description; +- (id)initWithFoundLocation:(id)arg1 withRange:(struct _NSRange)arg2 inContext:(id)arg3 foundUsingDescriptor:(id)arg4; +- (void)encodeWithCoder:(id)arg1; +- (id)initWithCoder:(id)arg1; +- (id)copyWithZone:(struct _NSZone *)arg1; + +@end + From d0e5f3a52dc34f9770b3c52c791560c5f79db246 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 8 Jun 2015 22:30:59 +0100 Subject: [PATCH 73/96] Xcode 7 beta support. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 4 + SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + SCXcodeMinimap/SCXcodeMinimapView.m | 10 +- .../Xcode Headers/DVTAnnotationManager.h | 30 +++-- .../Xcode Headers/DVTCompletingTextView.h | 49 ++++---- .../Xcode Headers/DVTFoldingManager.h | 24 ++-- .../DVTFoldingManagerDelegate-Protocol.h | 13 +++ .../Xcode Headers/DVTSourceTextView.h | 107 +++++++++--------- SCXcodeMinimap/Xcode Headers/DVTTextView.h | 22 ++++ 9 files changed, 158 insertions(+), 102 deletions(-) create mode 100644 SCXcodeMinimap/Xcode Headers/DVTFoldingManagerDelegate-Protocol.h create mode 100644 SCXcodeMinimap/Xcode Headers/DVTTextView.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index f325c22..e84bcc8 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -30,6 +30,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 180790681B263C200026A519 /* DVTFoldingManagerDelegate-Protocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTFoldingManagerDelegate-Protocol.h"; sourceTree = ""; }; + 180790691B263CF60026A519 /* DVTTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTTextView.h; sourceTree = ""; }; 1809FF8D1AED1A730058D946 /* NSScroller+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSScroller+SCXcodeMinimap.h"; sourceTree = ""; }; 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSScroller+SCXcodeMinimap.m"; sourceTree = ""; }; 180F0C651A98AE1500E97254 /* DVTAnnotationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationManager.h; sourceTree = ""; }; @@ -141,6 +143,7 @@ 18DE6AFB1B203D070042615D /* DVTFindResult.h */, 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */, 18269AD51A8F2F4300953B3D /* DVTFoldingManager.h */, + 180790681B263C200026A519 /* DVTFoldingManagerDelegate-Protocol.h */, 184C11721A740F8A002A7C65 /* DVTFontAndColorTheme.h */, 184C11731A740F8A002A7C65 /* DVTInvalidation-Protocol.h */, 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */, @@ -156,6 +159,7 @@ 188D38771A98B3AC005C7F85 /* DVTTextAnnotation.h */, 184407641A8F7B1900C530CF /* DVTTextDocumentLocation.h */, 184C117B1A740F8A002A7C65 /* DVTTextStorage.h */, + 180790691B263CF60026A519 /* DVTTextView.h */, 184C117C1A740F8A002A7C65 /* DVTViewController.h */, 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */, 18E577F61B119BF200421483 /* IDEBuildIssueAnnotation.h */, diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 20bf43f..47e231d 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -37,6 +37,7 @@ 992275C1-432A-4CF7-B659-D84ED6D42D3F E969541F-E6F9-4D25-8158-72DC3545A6C6 8DC44374-2B35-4C57-A6FE-2AD66A36AAD9 + AABB7188-E14E-4433-AD3B-5CD791EAD9A3 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 9b5297f..49add31 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -120,7 +120,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self.editor setSearchResultsDelegate:self]; self.editorTextView = editor.textView; - + [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin | NSViewWidthSizable | NSViewHeightSizable]; @@ -145,7 +145,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self.textView setTextStorage:storage]; [storage addLayoutManager:self.editorTextView.layoutManager]; - [self.editorTextView.foldingManager setDelegate:self]; + [self.editorTextView.layoutManager.foldingManager setDelegate:self]; [self.textView setEditable:NO]; [self.textView setSelectable:NO]; @@ -157,7 +157,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self updateTheme]; - for(NSDictionary *providerDictionary in self.editorTextView.annotationManager.annotationProviders) { + for(NSDictionary *providerDictionary in [self.editorTextView.annotationManager valueForKeyPath:@"_annotationProviders"]) { id annotationProvider = providerDictionary[@"annotationProviderObject"]; if([annotationProvider isKindOfClass:[DBGBreakpointAnnotationProvider class]]) { @@ -439,7 +439,7 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didFoldRange:(NSRange { [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didFoldRange:range]; - [self.textView.foldingManager foldRange:range]; + [self.textView.layoutManager.foldingManager foldRange:range]; [self.textView.layoutManager ensureLayoutForTextContainer:self.textView.textContainer]; [self updateOffset]; @@ -449,7 +449,7 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRan { [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didUnfoldRange:range]; - [self.textView.foldingManager unfoldRange:range]; + [self.textView.layoutManager.foldingManager unfoldRange:range]; [self.textView.layoutManager ensureLayoutForTextContainer:self.textView.textContainer]; [self updateOffset]; diff --git a/SCXcodeMinimap/Xcode Headers/DVTAnnotationManager.h b/SCXcodeMinimap/Xcode Headers/DVTAnnotationManager.h index 2159f7a..bde5c06 100644 --- a/SCXcodeMinimap/Xcode Headers/DVTAnnotationManager.h +++ b/SCXcodeMinimap/Xcode Headers/DVTAnnotationManager.h @@ -1,22 +1,32 @@ -/* - * Generated by class-dump 3.3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. - */ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// - -@class DVTAnnotationContext, NSMutableArray; +@class DVTStackBacktrace, NSMutableArray, NSString; @interface DVTAnnotationManager : NSObject { NSMutableArray *_annotationProviders; - DVTAnnotationContext *_context; } -@property(retain) DVTAnnotationContext *context; // @synthesize context=_context; -@property(retain) NSMutableArray *annotationProviders; // @synthesize annotationProviders=_annotationProviders; ++ (unsigned long long)assertionBehaviorForKeyValueObservationsAtEndOfEvent; ++ (unsigned long long)assertionBehaviorAfterEndOfEventForSelector:(SEL)arg1; ++ (void)initialize; - (void)removeAllAnnotationProviders; - (void)setupAnnotationProvidersWithContext:(id)arg1; - (id)_installObservationBlockForAnnotationProvider:(id)arg1; +- (void)primitiveInvalidate; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly) Class superclass; +@property(readonly, nonatomic, getter=isValid) BOOL valid; @end + diff --git a/SCXcodeMinimap/Xcode Headers/DVTCompletingTextView.h b/SCXcodeMinimap/Xcode Headers/DVTCompletingTextView.h index 06b02d4..012fca6 100644 --- a/SCXcodeMinimap/Xcode Headers/DVTCompletingTextView.h +++ b/SCXcodeMinimap/Xcode Headers/DVTCompletingTextView.h @@ -1,19 +1,21 @@ -/* - * Generated by class-dump 3.3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. - */ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// -#import +#import "DVTTextView.h" +#import "DVTTextStorage.h" +#import "DVTLayoutManager.h" -@class DVTFoldingLayoutManager, DVTFoldingManager, DVTSourceCodeLanguage, DVTTextCompletionController, DVTTextCompletionDataSource, NSColor; +@class DVTLayoutManager, DVTSourceCodeLanguage, DVTTextCompletionController, DVTTextCompletionDataSource, DVTTextStorage, NSCharacterSet, NSColor, NSString; -@interface DVTCompletingTextView : NSTextView +@interface DVTCompletingTextView : DVTTextView { DVTTextCompletionController *_completionController; DVTTextCompletionDataSource *_completionsDataSource; NSColor *_secondarySelectedTextBackgroundColor; - unsigned long long _accessoryAnnotationWidth; + double _accessoryAnnotationWidth; unsigned long long _modifierFlagsAtLastSingleMouseDown; BOOL _tabSelectsNextPlaceholder; } @@ -21,7 +23,6 @@ + (id)readableTextPasteboardTypes; + (long long)scrollerKnobStyleForBackgroundColor:(id)arg1; + (id)_operatorChars; -+ (id)autoCompleteChars; + (id)identifierChars; + (id)_identifierCharsForImportStatements; + (BOOL)appSupportsActionMonitoring; @@ -29,7 +30,7 @@ @property BOOL tabSelectsNextPlaceholder; // @synthesize tabSelectsNextPlaceholder=_tabSelectsNextPlaceholder; @property(readonly) DVTTextCompletionController *completionController; // @synthesize completionController=_completionController; @property unsigned long long modifierFlagsAtLastSingleMouseDown; // @synthesize modifierFlagsAtLastSingleMouseDown=_modifierFlagsAtLastSingleMouseDown; -@property unsigned long long accessoryAnnotationWidth; // @synthesize accessoryAnnotationWidth=_accessoryAnnotationWidth; +@property double accessoryAnnotationWidth; // @synthesize accessoryAnnotationWidth=_accessoryAnnotationWidth; - (void)setMarkedText:(id)arg1 selectedRange:(struct _NSRange)arg2; - (void)becomeMainWindow; - (void)resignKeyWindow; @@ -54,14 +55,14 @@ - (void)drawRect:(struct CGRect)arg1; - (void)_drawRect:(struct CGRect)arg1 clip:(BOOL)arg2; - (void)_drawOverlayRect:(struct CGRect)arg1; +- (void)moveDown:(id)arg1; - (void)setSelectedRange:(struct _NSRange)arg1; - (void)setSelectedRanges:(id)arg1 affinity:(unsigned long long)arg2 stillSelecting:(BOOL)arg3; - (void)_replaceFoldWithContents:(id)arg1; -- (id)_formatBlockLiteralFromDeclaration:(id)arg1 lineCount:(unsigned long long *)arg2; - (void)textStorage:(id)arg1 didEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; - (void)textStorage:(id)arg1 willEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; -- (id)textStorage; -- (id)layoutManager; +@property(readonly) DVTTextStorage *textStorage; +@property(readonly) DVTLayoutManager *layoutManager; - (void)didInsertCompletionTextAtRange:(struct _NSRange)arg1; - (void)invalidateDisplayForRange:(struct _NSRange)arg1; - (unsigned long long)draggingEntered:(id)arg1; @@ -79,13 +80,15 @@ - (void)previousCompletion:(id)arg1; - (void)nextCompletion:(id)arg1; - (void)complete:(id)arg1; -- (BOOL)shouldChangeTextInRange:(struct _NSRange)arg1 replacementString:(id)arg2; +- (BOOL)shouldChangeTextInRanges:(id)arg1 replacementStrings:(id)arg2; - (void)deleteForward:(id)arg1; - (void)deleteBackward:(id)arg1; - (void)insertText:(id)arg1 replacementRange:(struct _NSRange)arg2; - (void)doCommandBySelector:(SEL)arg1; -- (void)foldingLayoutManagerFoldsChanged:(id)arg1; -- (id)layoutManager:(id)arg1 shouldUseTextBackgroundColor:(id)arg2 rectArray:(struct CGRect *)arg3 count:(unsigned long long)arg4 forCharacterRange:(struct _NSRange)arg5; +- (void)layoutManager:(id)arg1 didUnfoldRange:(struct _NSRange)arg2; +- (void)layoutManager:(id)arg1 didFoldRange:(struct _NSRange)arg2; +- (void)_foldingLayoutManagerFoldsChanged:(id)arg1; +- (id)layoutManager:(id)arg1 shouldUseTextBackgroundColor:(id)arg2 rectArray:(const struct CGRect *)arg3 count:(unsigned long long)arg4 forCharacterRange:(struct _NSRange)arg5; - (id)layoutManager:(id)arg1 shouldUseTemporaryAttributes:(id)arg2 forDrawingToScreen:(BOOL)arg3 atCharacterIndex:(unsigned long long)arg4 effectiveRange:(struct _NSRange *)arg5; - (void)showMatchingBraceAtLocation:(id)arg1; - (void)autoHighlightMatchingBracketAtLocationIfNecessary:(unsigned long long)arg1; @@ -95,29 +98,35 @@ - (BOOL)_moveToNextPlaceholderFromCharacterIndex:(unsigned long long)arg1 forward:(BOOL)arg2 onlyIfNearby:(BOOL)arg3; - (struct _NSRange)_findString:(id)arg1 inString:(id)arg2 fromRange:(struct _NSRange)arg3 limitRange:(struct _NSRange)arg4 forward:(BOOL)arg5 wrap:(BOOL)arg6; - (struct _NSRange)rangeOfPlaceholderFromCharacterIndex:(unsigned long long)arg1 forward:(BOOL)arg2 wrap:(BOOL)arg3 limit:(unsigned long long)arg4; +- (struct _NSRange)_rangeOfPlaeholderWithStartPrefix:(id)arg1 endSuffix:(id)arg2 inString:(id)arg3 fromRange:(struct _NSRange)arg4 limitRange:(struct _NSRange)arg5 forward:(BOOL)arg6 wrap:(BOOL)arg7; - (BOOL)selectFirstPlaceholderInCharacterRange:(struct _NSRange)arg1; - (BOOL)handleSelectPreviousPlaceholder; - (BOOL)handleSelectNextPlaceholder; - (id)ghostComplementTextColor; - (BOOL)shouldAutoCompleteAtLocation:(unsigned long long)arg1; - (BOOL)shouldSuppressTextCompletion; +@property(readonly, copy) NSCharacterSet *autoCompleteChars; @property(readonly) double autoCompletionDelay; - (id)contextForCompletionStrategiesAtWordStartLocation:(unsigned long long)arg1; @property(readonly) DVTTextCompletionDataSource *completionsDataSource; - (struct _NSRange)wordRangeAtLocation:(unsigned long long)arg1; @property(readonly) DVTSourceCodeLanguage *language; -- (struct CGRect)frameForRange:(struct _NSRange)arg1; - (void)dealloc; - (id)initWithCoder:(id)arg1; - (id)initWithFrame:(struct CGRect)arg1; - (id)initWithFrame:(struct CGRect)arg1 textContainer:(id)arg2; - (void)_dvtCommonInit; - (id)currentTheme; -@property(readonly) DVTFoldingManager *foldingManager; -@property(readonly) DVTFoldingLayoutManager *foldingLayoutManager; - (BOOL)removeMenusNotInWhiteList:(id)arg1 fromMenu:(id)arg2 removeSeparators:(BOOL)arg3; - (id)cell; - (id)selectedCell; - (id)accessibilityAttributeValue:(id)arg1; +// Remaining properties +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) Class superclass; + @end + diff --git a/SCXcodeMinimap/Xcode Headers/DVTFoldingManager.h b/SCXcodeMinimap/Xcode Headers/DVTFoldingManager.h index 91e987a..a25fbdc 100644 --- a/SCXcodeMinimap/Xcode Headers/DVTFoldingManager.h +++ b/SCXcodeMinimap/Xcode Headers/DVTFoldingManager.h @@ -1,11 +1,12 @@ -/* - * Generated by class-dump 3.3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. - */ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +#import "DVTFoldingManagerDelegate-Protocol.h" @class DVTTextFold; -@protocol DVTFoldingManagerDelegate; @interface DVTFoldingManager : NSObject { @@ -15,6 +16,7 @@ @property(retain, nonatomic) DVTTextFold *topLevelFold; // @synthesize topLevelFold=_topLevelFold; @property __weak id delegate; // @synthesize delegate; +- (id)fixedSelectionRangesForRanges:(id)arg1 affinity:(unsigned long long)arg2 inTextView:(id)arg3; - (id)adjustFoldsForRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; - (id)foldsEnclosingRange:(struct _NSRange)arg1; - (id)lastFoldTouchingCharacterIndex:(unsigned long long)arg1; @@ -25,9 +27,9 @@ - (BOOL)isCharacterRangeFolded:(struct _NSRange)arg1; - (BOOL)containsFoldWithRange:(struct _NSRange)arg1; - (BOOL)isCharacterFoldedAtIndex:(unsigned long long)arg1; -- (void)foldRecursiveItem:(id)arg1; -- (void)unfoldItems:(id)arg1; -- (void)foldItems:(id)arg1; +- (void)foldRangesRecursively:(id)arg1; +- (void)unfoldRanges:(id)arg1; +- (void)foldRanges:(id)arg1; - (void)unfoldRecursiveRange:(struct _NSRange)arg1; - (void)unfoldEnclosingRange:(struct _NSRange)arg1; - (void)unfoldRange:(struct _NSRange)arg1; @@ -42,7 +44,3 @@ @end -@protocol DVTFoldingManagerDelegate -- (void)foldingManager:(id)arg1 didUnfoldRange:(struct _NSRange)arg2; -- (void)foldingManager:(id)arg1 didFoldRange:(struct _NSRange)arg2; -@end diff --git a/SCXcodeMinimap/Xcode Headers/DVTFoldingManagerDelegate-Protocol.h b/SCXcodeMinimap/Xcode Headers/DVTFoldingManagerDelegate-Protocol.h new file mode 100644 index 0000000..b14ddc8 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTFoldingManagerDelegate-Protocol.h @@ -0,0 +1,13 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +@class DVTFoldingManager; + +@protocol DVTFoldingManagerDelegate +- (void)foldingManager:(DVTFoldingManager *)arg1 didUnfoldRange:(struct _NSRange)arg2; +- (void)foldingManager:(DVTFoldingManager *)arg1 didFoldRange:(struct _NSRange)arg2; +@end + diff --git a/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h b/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h index d2e32da..788d336 100644 --- a/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h +++ b/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h @@ -1,12 +1,12 @@ -/* - * Generated by class-dump 3.3.4 (64 bit). - * - * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. - */ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// #import "DVTCompletingTextView.h" -@class DVTAnnotationManager, DVTHashTable, DVTMutableRangeArray, DVTObservingToken, DVTTextAnnotationIndicatorAnimation, DVTTextDocumentLocation, DVTTextPageGuideVisualization, NSAnimation, NSArray, NSColor, NSDictionary, NSMutableArray, NSString, NSTimer, NSView, NSWindow; +@class DVTAnnotationManager, DVTMutableRangeArray, DVTObservingToken, DVTTextAnnotationIndicatorAnimation, DVTTextDocumentLocation, DVTTextPageGuideVisualization, NSAnimation, NSArray, NSDictionary, NSHashTable, NSMutableArray, NSString, NSTimer, NSView, NSWindow; @interface DVTSourceTextView : DVTCompletingTextView { @@ -15,26 +15,17 @@ struct CGPoint _lastMouseMovedLocation; struct _NSRange _foldingHoverRange; DVTTextAnnotationIndicatorAnimation *_annotationIndicatorAnimation; - NSArray *_temporaryLinkRanges; unsigned long long _temporaryLinkHoverModifierFlags; unsigned long long _temporaryLinkHoverAltModifierFlags; NSArray *_clickedTemporaryLinkRanges; NSMutableArray *_clickedLinkProgressIndicators; struct _NSRange _ghostStringRange; - NSTimer *_autoHighlightTokenTimer; - DVTObservingToken *_autoHighlightTextCompletionObserver; - DVTMutableRangeArray *_autoHighlightTokenRanges; NSTimer *_autoHighlightTokenMenuTimer; struct _NSRange _autoHighlightTokenMenuRange; double _autoHighlightTokenMenuAnimationDuration; NSTimer *_autoHighlightTokenMenuAnimationTimer; double _autoHighlightTokenMenuAnimationStartTime; NSWindow *_autoHighlightTokenWindow; - DVTMutableRangeArray *_tokenizedEditingTokenRanges; - unsigned long long _tokenizedEditingEditedTokenIndex; - unsigned long long _tokenizedEditingDeferedOffset; - struct _NSRange _tokenizedEditingSelectionRange; - NSColor *_tokenizedEditingTokenColors[4]; NSArray *_foundLocations; DVTTextDocumentLocation *_currentFoundLocation; NSMutableArray *_visualizations; @@ -44,7 +35,7 @@ unsigned long long _locationOfOpenBracePendingClose; NSTimer *_scrollbarMarkerUpdateTimer; DVTAnnotationManager *_annotationManager; - DVTHashTable *_visibleViewAnnotations; + NSHashTable *_preparedViewAnnotations; NSView *_staticVisualizationView; int _findResultStyle; DVTMutableRangeArray *_typeOverCompletionRanges; @@ -57,44 +48,41 @@ unsigned int dDidScroll:1; unsigned int dColoringContext:1; unsigned int delegateRespondsToWillReturnPrintJobTitle:1; - unsigned int temporaryLinkIsAlternate:1; unsigned int updatingInsertionPoint:1; unsigned int wasPostsFrameChangedNotifications:1; unsigned int doingDidChangeSelection:1; + unsigned int delegateRespondsToConstrainMinAccessoryAnnotationWidth:1; + unsigned int delegateRespondsToConstrainMaxAccessoryAnnotationWidth:1; + unsigned int delegateRespondsToConstrainAccessoryAnnotationWidth:1; } _sFlags; BOOL _isDoingBatchEdit; BOOL _allowsCodeFolding; BOOL _showingCodeFocus; BOOL _lastMouseEventWasClick; - BOOL _autoHighlightTokens; BOOL _tokenizedEditingEnabled; BOOL _animatesCurrentScroll; BOOL _disableUpdatingInsertionPointCount; BOOL _currentlyAutoCompletingBracket; - BOOL _addedSpaceWhenAutoOpeningCloseBracket; + BOOL _currentlyDoingNonUserEditing; BOOL _wrapsLines; BOOL _postsLayoutManagerNotifications; BOOL _scrollingInScrollView; - BOOL _annotationLayoutScheduled; + DVTObservingToken *_autoHighlightTokenRangesObservingToken; struct _NSRange _selectedRangeBeforeMouseDown; + BOOL _ensuringLayoutForScroll; } -+ (id)autoCompleteChars; ++ (BOOL)isCompatibleWithResponsiveScrolling; ++ (BOOL)_shouldEnableResponsiveScrolling; ++ (id)keyPathsForValuesAffectingAccessoryAnnotationCollapsed; + (id)performanceLogAspect; + (id)foldingLogAspect; + (id)drawingLogAspect; + (void)initialize; @property BOOL postsLayoutManagerNotifications; // @synthesize postsLayoutManagerNotifications=_postsLayoutManagerNotifications; -@property BOOL addedSpaceWhenAutoOpeningCloseBracket; // @synthesize addedSpaceWhenAutoOpeningCloseBracket=_addedSpaceWhenAutoOpeningCloseBracket; -@property unsigned long long locationOfAutoOpenedCloseBracket; // @synthesize locationOfAutoOpenedCloseBracket=_locationOfAutoOpenedCloseBracket; -@property(nonatomic, getter=isTokenizedEditingEnabled) BOOL tokenizedEditingEnabled; // @synthesize tokenizedEditingEnabled=_tokenizedEditingEnabled; -@property struct _NSRange tokenizedEditingSelectionRange; // @synthesize tokenizedEditingSelectionRange=_tokenizedEditingSelectionRange; -@property(readonly) NSArray *tokenizedEditingTokenRanges; // @synthesize tokenizedEditingTokenRanges=_tokenizedEditingTokenRanges; -@property(nonatomic) BOOL autoHighlightTokens; // @synthesize autoHighlightTokens=_autoHighlightTokens; @property int findResultStyle; // @synthesize findResultStyle=_findResultStyle; @property(nonatomic) unsigned long long pageGuideColumn; // @synthesize pageGuideColumn=_pageGuideColumn; @property(readonly) NSArray *visualizations; // @synthesize visualizations=_visualizations; -@property(retain) DVTAnnotationManager *annotationManager; // @synthesize annotationManager=_annotationManager; @property(nonatomic) struct _NSRange ghostStringRange; // @synthesize ghostStringRange=_ghostStringRange; @property unsigned long long temporaryLinkHoverAltModifierFlags; // @synthesize temporaryLinkHoverAltModifierFlags=_temporaryLinkHoverAltModifierFlags; @property unsigned long long temporaryLinkHoverModifierFlags; // @synthesize temporaryLinkHoverModifierFlags=_temporaryLinkHoverModifierFlags; @@ -137,6 +125,7 @@ - (struct _NSRange)_indentInsertedTextIfNecessaryAtRange:(struct _NSRange)arg1; - (void)indentSelectionIfIndentable:(id)arg1; - (void)indentSelection:(id)arg1; +- (struct _NSRange)_adjustedSelectedRange:(struct _NSRange)arg1 fromChangeIndex:(unsigned long long)arg2; - (void)commentAndUncommentCurrentLines:(id)arg1; - (void)moveCurrentLineDown:(id)arg1; - (void)moveCurrentLineUp:(id)arg1; @@ -148,6 +137,7 @@ - (BOOL)validateUserInterfaceItem:(id)arg1; - (void)layoutManager:(id)arg1 didCompleteLayoutForTextContainer:(id)arg2 atEnd:(BOOL)arg3; - (id)layoutManager:(id)arg1 shouldUseTemporaryAttributes:(id)arg2 forDrawingToScreen:(BOOL)arg3 atCharacterIndex:(unsigned long long)arg4 effectiveRange:(struct _NSRange *)arg5; +- (id)accessibilityAXAttributedStringForCharacterRange:(struct _NSRange)arg1 parent:(id)arg2; - (BOOL)scrollRectToVisible:(struct CGRect)arg1; - (void)scrollPoint:(struct CGPoint)arg1; - (void)setMarkedText:(id)arg1 selectedRange:(struct _NSRange)arg2; @@ -174,19 +164,11 @@ - (void)selectPreviousToken:(id)arg1; - (void)selectNextToken:(id)arg1; - (void)toggleTokenizedEditing:(id)arg1; -@property(retain) NSColor *tokenizedEditingSelectedTokenBackgroundColor; // @dynamic tokenizedEditingSelectedTokenBackgroundColor; -@property(retain) NSColor *tokenizedEditingSelectedTokenBorderColor; // @dynamic tokenizedEditingSelectedTokenBorderColor; -@property(retain) NSColor *tokenizedEditingTokenBackgroundColor; // @dynamic tokenizedEditingTokenBackgroundColor; -@property(retain) NSColor *tokenizedEditingTokenBorderColor; // @dynamic tokenizedEditingTokenBorderColor; -- (id)tokenizedEditingTokenPathsForCharacterRange:(struct _NSRange)arg1; -- (id)tokenPathsForCharacterRange:(struct _NSRange)arg1 displayOnly:(BOOL)arg2; - (void)textStorage:(id)arg1 didEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; - (void)textStorage:(id)arg1 willEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; -- (unsigned long long)_indexOfTokenizedEditingRange:(struct _NSRange)arg1; -- (void)updateTokenizedEditingRanges; -- (void)_scheduleAutoHighlightTokenTimerIfNeeded; -- (void)_autoHighlightTokenWithTimer:(id)arg1; -- (void)tokenizableItemsForItemAtRange:(struct _NSRange)arg1 completionBlock:(id)arg2; +- (void)didEndTokenizedEditingWithRanges:(id)arg1; +- (void)willStartTokenizedEditingWithRanges:(id)arg1; +- (void)tokenizableRangesWithRange:(struct _NSRange)arg1 completionBlock:(id)arg2; - (void)_scheduleAutoHighlightTokenMenuTimerIfNeeded; - (void)_showAutoHighlightTokenMenuWithTimer:(id)arg1; - (id)_autoHighlightTokenWindowWithTokenRect:(struct CGRect)arg1; @@ -198,8 +180,6 @@ - (void)_popUpTokenMenu:(id)arg1; - (id)_autoHighlightTokenMenu; - (void)_clearAutoHighlightTokenMenu; -- (void)_clearDisplayForAutoHighlightTokens; -- (void)_displayAutoHighlightTokens; - (void)removeStaticVisualizationView; - (void)addStaticVisualizationView:(id)arg1; - (void)removeVisualization:(id)arg1 fadeOut:(BOOL)arg2 completionBlock:(id)arg3; @@ -210,7 +190,6 @@ - (void)adjustTypeOverCompletionForEditedRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; - (void)addTypeOverCompletionForRange:(struct _NSRange)arg1 openRange:(struct _NSRange)arg2; - (struct _NSRange)lastTypeOverCompletionRange; -- (struct _NSRange)typeOverCompletionToSkipOverAtLocation:(unsigned long long)arg1 withInsertionText:(id)arg2; - (struct _NSRange)typeOverCompletionRangeFollowingLocation:(unsigned long long)arg1; - (void)didInsertCompletionTextAtRange:(struct _NSRange)arg1; - (struct _NSRange)_suggestedOpenRangeForTypeOverRange:(struct _NSRange)arg1; @@ -260,14 +239,15 @@ - (void)_finishedAnimatingScroll; - (void)mouseMoved:(id)arg1; - (void)_mouseInside:(id)arg1; +- (void)resetCursorRects; - (void)removeFromSuperview; - (void)viewDidMoveToWindow; -- (void)_updateScrollerMarkersWithAnnotations:(id)arg1 clearCurrent:(BOOL)arg2; - (void)_refreshScrollerMarkers; - (double)_markForLineNumber:(unsigned long long)arg1; - (void)setUsesMarkedScrollbar:(BOOL)arg1; - (id)attributedStringForCompletionPlaceholderCell:(id)arg1 atCharacterIndex:(unsigned long long)arg2 withDefaultAttributes:(id)arg3; - (void)clickedOnCell:(id)arg1 inRect:(struct CGRect)arg2 atIndexInToken:(unsigned long long)arg3; +- (void)_showTemporaryLinkForExpressionUnderMouse:(BOOL)arg1 isAlternate:(BOOL)arg2; - (void)_didClickOnTemporaryLinkWithEvent:(id)arg1; - (void)_updateTemporaryLinkUnderMouseForEvent:(id)arg1; - (unsigned long long)_nonBlankCharIndexUnderMouse; @@ -277,35 +257,34 @@ - (void)_showClickedLinkProgressIndicators; - (void)_invalidateClickedLinks; - (id)_clickedLinkProgressIndicatorWithRect:(struct CGRect)arg1; -- (void)_clearTemporaryLinkRanges; -- (void)_setTemporaryLinkRanges:(id)arg1 isAlternate:(BOOL)arg2; - (void)animation:(id)arg1 didReachProgressMark:(float)arg2; - (void)animationDidEnd:(id)arg1; - (void)animationDidStop:(id)arg1; - (BOOL)animationShouldStart:(id)arg1; - (void)stopBlockHighlighting; - (void)startBlockHighlighting; +- (id)codeFocusBlockAnimation; - (void)focusLocationMayHaveChanged:(id)arg1; - (void)toggleCodeFocus:(id)arg1; +- (BOOL)codeFocusFollowsSelection; - (void)_drawViewBackgroundInRect:(struct CGRect)arg1; -- (void)_drawTokensInRect:(struct CGRect)arg1; - (void)_drawCaretForTextAnnotationsInRect:(struct CGRect)arg1; - (void)drawTextAnnotationsInRect:(struct CGRect)arg1; -- (long long)_drawRoundedBackgroundForItem:(id)arg1 dynamicItem:(id)arg2; -- (id)_roundedRect:(struct CGRect)arg1 withRadius:(double)arg2; -- (unsigned long long)_drawBlockBackground:(struct CGRect)arg1 atLocation:(unsigned long long)arg2 forItem:(id)arg3 dynamicItem:(id)arg4; +- (long long)_drawRoundedBackgroundForFoldableBlockRangeAtLocation:(unsigned long long)arg1; - (double)_grayLevelForDepth:(long long)arg1; - (id)alternateColor; - (void)setFoldingHoverRange:(struct _NSRange)arg1; - (struct _NSRange)foldingHoverRange; - (void)_loadColorsFromCurrentTheme; - (void)_themeColorsChanged:(id)arg1; -- (void)_scheduleAnnotationLayoutAfterResize; +- (void)_scheduleAnnotationLayout; - (void)drawRect:(struct CGRect)arg1; +- (void)prepareContentInRect:(struct CGRect)arg1; - (unsigned long long)foldedCharacterIndexForPoint:(struct CGPoint)arg1; - (void)setSelectedRanges:(id)arg1 affinity:(unsigned long long)arg2 stillSelecting:(BOOL)arg3; - (void)_delayedTrimTrailingWhitespaceForLine:(id)arg1; - (void)trimTrailingWhitespaceOnLine:(unsigned long long)arg1; +- (void)_trimTrailingWhitespaceOnLineAfterIndent:(unsigned long long)arg1 trimWhitespaceOnlyLine:(BOOL)arg2; - (void)trimTrailingWhitespaceOnLine:(unsigned long long)arg1 trimWhitespaceOnlyLine:(BOOL)arg2; - (void)trimTrailingWhitespaceOnLineFromCharacterIndex:(unsigned long long)arg1 trimWhitespaceOnlyLine:(BOOL)arg2; - (BOOL)shouldTrimTrailingWhitespace; @@ -313,8 +292,13 @@ - (void)contextMenu_toggleMessageBubbleShown:(id)arg1; - (void)toggleMessageBubbleShown:(id)arg1; - (void)_enumerateMessageBubbleAnnotationsInSelection:(id)arg1; -- (void)setAccessoryAnnotationWidth:(unsigned long long)arg1; -- (void)_updateAccessoryAnnotationViews; +@property(readonly, getter=isAccessoryAnnotationCollapsed) BOOL accessoryAnnotationCollapsed; +- (void)setAccessoryAnnotationWidth:(double)arg1; +- (double)_maxAllowableAccessoryAnnotationWidth; +- (double)_minAllowableAccessoryAnnotationWidth; +@property(readonly) double maxPossibleAccessoryAnnotationWidth; +@property(readonly) double minPossibleAccessoryAnnotationWidth; +- (void)_updateAccessoryAnnotationViewsInRect:(struct CGRect)arg1; - (void)_adjustSizeOfAccessoryAnnotation:(id)arg1; - (void)showAnnotation:(id)arg1 animateIndicator:(BOOL)arg2; - (void)_animateBubbleView:(id)arg1; @@ -323,26 +307,41 @@ - (id)visibleAnnotationsForLineNumberRange:(struct _NSRange)arg1; - (id)annotationForRepresentedObject:(id)arg1; @property(readonly) NSArray *annotations; +@property(retain) DVTAnnotationManager *annotationManager; // @synthesize annotationManager=_annotationManager; - (void)setShowsFoldingSidebar:(BOOL)arg1; - (BOOL)showsFoldingSidebar; - (void)getParagraphRect:(struct CGRect *)arg1 firstLineRect:(struct CGRect *)arg2 forLineRange:(struct _NSRange)arg3 ensureLayout:(BOOL)arg4; - (struct _NSRange)lineNumberRangeForBoundingRect:(struct CGRect)arg1; - (unsigned long long)lineNumberForPoint:(struct CGPoint)arg1; - (id)printJobTitle; +- (void)setIsCurrentlyDoingNonUserEditing:(BOOL)arg1; +@property(readonly) BOOL isCurrentlyDoingNonUserEditing; @property(readonly) NSDictionary *syntaxColoringContext; - (id)language; - (BOOL)allowsCodeFolding; - (void)setAllowsCodeFolding:(BOOL)arg1; - (void)setTextStorage:(id)arg1; - (void)setTextStorage:(id)arg1 keepOldLayout:(BOOL)arg2; +- (void)setTextContainer:(id)arg1; - (id)initWithCoder:(id)arg1; - (id)initWithFrame:(struct CGRect)arg1 textContainer:(id)arg2; - (void)_commonInitDVTSourceTextView; - (id)menuForEvent:(id)arg1; +- (BOOL)shouldIndentPastedText:(id)arg1; +- (void)indentUserChangeBy:(long long)arg1; +- (id)accessibilityHitTest:(struct CGPoint)arg1; +- (id)accessibilityAttributeValue:(id)arg1; +- (id)accessibilityProxyForSelectedRange:(struct _NSRange)arg1; +- (id)_accessibilityProxiesByRange; - (double)fmc_maxY; - (double)fmc_startOfLine:(long long)arg1; - (long long)fmc_lineNumberForPosition:(double)arg1; -- (BOOL)shouldIndentPastedText:(id)arg1; -- (void)indentUserChangeBy:(long long)arg1; + +// Remaining properties +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) Class superclass; @end + diff --git a/SCXcodeMinimap/Xcode Headers/DVTTextView.h b/SCXcodeMinimap/Xcode Headers/DVTTextView.h new file mode 100644 index 0000000..2c3ee8b --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTTextView.h @@ -0,0 +1,22 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +@interface DVTTextView : NSTextView +{ + BOOL _settingMinSizeForClipView; + BOOL _minWidthTracksClipView; + BOOL _minHeightTracksClipView; +} + +@property BOOL minHeightTracksClipView; // @synthesize minHeightTracksClipView=_minHeightTracksClipView; +@property BOOL minWidthTracksClipView; // @synthesize minWidthTracksClipView=_minWidthTracksClipView; +- (void)setMinSize:(struct CGSize)arg1; +- (void)_superviewClipViewFrameChanged:(id)arg1; +- (id)initWithCoder:(id)arg1; +- (id)initWithFrame:(struct CGRect)arg1 textContainer:(id)arg2; + +@end + From 08d391691079dd9397aabcaa901393953b90c911 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 18 Jun 2015 09:31:05 +0100 Subject: [PATCH 74/96] Switched back to visible range invalidation. --- SCXcodeMinimap/SCXcodeMinimapView.m | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 49add31..e97a55f 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -327,7 +327,7 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager if(self.searchResults.count) { NSRange closestRange = NSMakeRange(self.textView.string.length, 0); - for(NSDictionary *searchResultDictionary in self.searchResults) { + for(NSDictionary *searchResultDictionary in self.searchResults.copy) { NSRange range = [searchResultDictionary[kAnnotationRangeKey] rangeValue]; if(NSLocationInRange(charIndex, range)) { @@ -754,27 +754,25 @@ - (void)delayedInvalidateMinimap - (void)invalidateMinimap { - void (^performFullRangeInvalidation)() = ^{ + void (^performRangeInvalidation)() = ^{ self.shouldAllowFullSyntaxHighlight = YES; - NSRange fullTextRange = NSMakeRange(0, self.textView.string.length); - - [self.textView.layoutManager invalidateDisplayForCharacterRange:fullTextRange]; + [self.textView.layoutManager invalidateDisplayForCharacterRange:[self.textView visibleCharacterRange]]; BOOL editorHighlightingEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldHighlightEditorKey] boolValue]; if(editorHighlightingEnabled) { - [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:fullTextRange]; + [self.editorTextView.layoutManager invalidateDisplayForCharacterRange:[self.editorTextView visibleCharacterRange]]; } }; if(self.shouldUpdateBreakpointsAndIssues) { self.shouldUpdateBreakpointsAndIssues = NO; [self updateBreakpointsAndIssuesWithCompletion:^{ - performFullRangeInvalidation(); + performRangeInvalidation(); }]; } else { - performFullRangeInvalidation(); + performRangeInvalidation(); } } From a9f59f491595c40886de6e1cdbca9aba36ce5959 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 2 Jul 2015 20:56:39 +0100 Subject: [PATCH 75/96] Added Xcode 6.4 compatibility UUID. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + SCXcodeMinimap/SCXcodeMinimapView.m | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 47e231d..10aa34e 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -37,6 +37,7 @@ 992275C1-432A-4CF7-B659-D84ED6D42D3F E969541F-E6F9-4D25-8158-72DC3545A6C6 8DC44374-2B35-4C57-A6FE-2AD66A36AAD9 + 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 AABB7188-E14E-4433-AD3B-5CD791EAD9A3 LSMinimumSystemVersion diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index e97a55f..fa0d73f 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -324,6 +324,12 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager SCXcodeMinimapTheme *theme = ([layoutManager isEqualTo:self.textView.layoutManager] ? self.minimapTheme : self.editorTheme); + // Delay invalidation for performance reasons and attempt a full range invalidation later + if(!self.shouldAllowFullSyntaxHighlight && [layoutManager isEqual:self.textView.layoutManager]) { + [self delayedInvalidateMinimap]; + return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor}; + } + if(self.searchResults.count) { NSRange closestRange = NSMakeRange(self.textView.string.length, 0); @@ -345,12 +351,6 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager return @{NSForegroundColorAttributeName : theme.searchResultForegroundColor}; } - // Delay invalidation for performance reasons and attempt a full range invalidation later - if(!self.shouldAllowFullSyntaxHighlight && [layoutManager isEqual:self.textView.layoutManager]) { - [self delayedInvalidateMinimap]; - return @{NSForegroundColorAttributeName : theme.sourcePlainTextColor}; - } - if(self.shouldAllowFullSyntaxHighlight) { for(NSDictionary *highlightSymbolDictionary in self.highlightedSymbols) { From 0790b257d299df2dd758e267fed501072ebdaecf Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 5 Jul 2015 09:13:11 +0100 Subject: [PATCH 76/96] Added on load parent application check. --- SCXcodeMinimap/SCXcodeMinimap.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap.m b/SCXcodeMinimap/SCXcodeMinimap.m index 26d4380..27053aa 100644 --- a/SCXcodeMinimap/SCXcodeMinimap.m +++ b/SCXcodeMinimap/SCXcodeMinimap.m @@ -78,11 +78,14 @@ @implementation SCXcodeMinimap + (void)pluginDidLoad:(NSBundle *)plugin { - static SCXcodeMinimap *sharedMinimap = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedMinimap = [[self alloc] init]; - }); + BOOL isApplicationXcode = [[[NSBundle mainBundle] infoDictionary][@"CFBundleName"] isEqual:@"Xcode"]; + if (isApplicationXcode) { + static SCXcodeMinimap *sharedMinimap = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedMinimap = [[self alloc] init]; + }); + } } - (id)init From 0bc3bc91a838a694aa9daac15fff5cc3c85f0579 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 20 Jul 2015 19:30:57 +0100 Subject: [PATCH 77/96] Fixes #61 and general content offset issues. --- SCXcodeMinimap/SCXcodeMinimapView.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index fa0d73f..ce12fa9 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -139,11 +139,13 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor self.textView = [[DVTSourceTextView alloc] init]; - // The editor's layout manager needs to be the last one, otherwise live issues don't work NSTextStorage *storage = self.editorTextView.textStorage; - [storage removeLayoutManager:self.editorTextView.layoutManager]; [self.textView setTextStorage:storage]; - [storage addLayoutManager:self.editorTextView.layoutManager]; + + // The editor's layout manager needs to be the last one, otherwise live issues don't work + DVTLayoutManager *layoutManager = self.editorTextView.layoutManager; + [(NSMutableArray *)storage.layoutManagers removeObject:layoutManager]; + [(NSMutableArray *)storage.layoutManagers addObject:layoutManager]; [self.editorTextView.layoutManager.foldingManager setDelegate:self]; From b3eef3f1dc7831fd3026f31afdcd7b70f8dcd2af Mon Sep 17 00:00:00 2001 From: "Edward B. Smith" Date: Sun, 2 Aug 2015 12:56:20 -0700 Subject: [PATCH 78/96] Fixed build settings for differently named Xcode.app set-ups. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 73 ++++++++++++------------ 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index e84bcc8..38d75df 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -11,21 +11,21 @@ 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1819E4281AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m */; }; 184C11861A740F97002A7C65 /* SCXcodeMinimapSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */; }; 184C11871A740F97002A7C65 /* SCXcodeMinimapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */; }; - 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 184C118E1A741136002A7C65 /* DVTFoundation.framework */; }; - 1876135F1A77A74300974BE1 /* IDEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1876135E1A77A74300974BE1 /* IDEKit.framework */; }; - 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 188308091A7411830005DF40 /* DVTKit.framework */; }; - 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 1883080F1A7411A70005DF40 /* IDESourceEditor */; }; 1889464D1B11DDEE0036175B /* SCXcodeMinimapTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 1889464C1B11DDEE0036175B /* SCXcodeMinimapTheme.m */; }; 188FCC8A1A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */; }; 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */; }; - 18C999FF1A98B04C0008AF54 /* DebuggerUI in Frameworks */ = {isa = PBXBuildFile; fileRef = 18C999FE1A98B04C0008AF54 /* DebuggerUI */; }; - 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */; }; 18DE25ED1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DE25EC1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m */; }; 18E577FC1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */; }; 18ECB80E1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECB80D1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m */; }; 18ECB8111B1322A300EE4D82 /* SCXcodeMinimapCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECB8101B1322A300EE4D82 /* SCXcodeMinimapCommon.m */; }; 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18FE09B51707639E00118FEB /* Cocoa.framework */; }; 18FE09C9170764E400118FEB /* SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */; }; + 2BDF45EF1B6EA50300EAC683 /* DVTFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF45EE1B6EA50300EAC683 /* DVTFoundation.framework */; }; + 2BDF45F11B6EA51000EAC683 /* DVTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF45F01B6EA51000EAC683 /* DVTKit.framework */; }; + 2BDF45F31B6EA54600EAC683 /* IDEFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF45F21B6EA54600EAC683 /* IDEFoundation.framework */; }; + 2BDF45F51B6EA54E00EAC683 /* IDEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF45F41B6EA54E00EAC683 /* IDEKit.framework */; }; + 2BDF45FB1B6EAB5600EAC683 /* IDESourceEditor in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF45FA1B6EAB5600EAC683 /* IDESourceEditor */; }; + 2BDF45FD1B6EAB8400EAC683 /* DebuggerUI in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDF45FC1B6EAB8400EAC683 /* DebuggerUI */; }; 8742532317307161001C947C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8742532217307161001C947C /* QuartzCore.framework */; }; /* End PBXBuildFile section */ @@ -62,12 +62,8 @@ 184C11821A740F97002A7C65 /* SCXcodeMinimapSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapSelectionView.m; sourceTree = ""; }; 184C11831A740F97002A7C65 /* SCXcodeMinimapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapView.h; sourceTree = ""; }; 184C11841A740F97002A7C65 /* SCXcodeMinimapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = SCXcodeMinimapView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 184C118E1A741136002A7C65 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework; sourceTree = ""; }; 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IDEEditorDocument.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 1876135E1A77A74300974BE1 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework; sourceTree = ""; }; 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEFileBreakpoint.h; sourceTree = ""; }; - 188308091A7411830005DF40 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = /Applications/Xcode.app/Contents/SharedFrameworks/DVTKit.framework; sourceTree = ""; }; - 1883080F1A7411A70005DF40 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = /Applications/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = ""; }; 1889464B1B11DDEE0036175B /* SCXcodeMinimapTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapTheme.h; sourceTree = ""; }; 1889464C1B11DDEE0036175B /* SCXcodeMinimapTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimapTheme.m; sourceTree = ""; }; 188D38761A98B26E005C7F85 /* DBGBreakpointAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotation.h; sourceTree = ""; }; @@ -82,9 +78,7 @@ 18C8F0341A7ECB1300C7A76F /* DVTLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTLayoutManager.h; sourceTree = ""; }; 18C999FC1A98AF370008AF54 /* DBGBreakpointAnnotationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotationProvider.h; sourceTree = ""; }; 18C999FD1A98AF580008AF54 /* DVTAnnotationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationProvider.h; sourceTree = ""; }; - 18C999FE1A98B04C0008AF54 /* DebuggerUI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = DebuggerUI; path = /Applications/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS/DebuggerUI; sourceTree = ""; }; 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpoint.h; sourceTree = ""; }; - 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = /Applications/Xcode.app/Contents/Frameworks/IDEFoundation.framework; sourceTree = ""; }; 18DE25EB1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDESourceCodeEditor+SCXcodeMinimap.h"; sourceTree = ""; }; 18DE25EC1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDESourceCodeEditor+SCXcodeMinimap.m"; sourceTree = ""; }; 18DE6AFB1B203D070042615D /* DVTFindResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFindResult.h; sourceTree = ""; }; @@ -108,6 +102,12 @@ 18FE09C7170764E400118FEB /* SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimap.h; sourceTree = ""; }; 18FE09C8170764E400118FEB /* SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SCXcodeMinimap.m; sourceTree = ""; }; 18FEFA8C1A782D8600DC98C5 /* IDEFileTextSettings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEFileTextSettings.h; sourceTree = ""; }; + 2BDF45EE1B6EA50300EAC683 /* DVTFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTFoundation.framework; path = ../SharedFrameworks/DVTFoundation.framework; sourceTree = DEVELOPER_DIR; }; + 2BDF45F01B6EA51000EAC683 /* DVTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DVTKit.framework; path = ../SharedFrameworks/DVTKit.framework; sourceTree = DEVELOPER_DIR; }; + 2BDF45F21B6EA54600EAC683 /* IDEFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEFoundation.framework; path = ../Frameworks/IDEFoundation.framework; sourceTree = DEVELOPER_DIR; }; + 2BDF45F41B6EA54E00EAC683 /* IDEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IDEKit.framework; path = ../Frameworks/IDEKit.framework; sourceTree = DEVELOPER_DIR; }; + 2BDF45FA1B6EAB5600EAC683 /* IDESourceEditor */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = IDESourceEditor; path = ../PlugIns/IDESourceEditor.ideplugin/Contents/MacOS/IDESourceEditor; sourceTree = DEVELOPER_DIR; }; + 2BDF45FC1B6EAB8400EAC683 /* DebuggerUI */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = DebuggerUI; path = ../PlugIns/DebuggerUI.ideplugin/Contents/MacOS/DebuggerUI; sourceTree = DEVELOPER_DIR; }; 8742532217307161001C947C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -116,14 +116,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 188308101A7411A70005DF40 /* IDESourceEditor in Frameworks */, - 184C118F1A741136002A7C65 /* DVTFoundation.framework in Frameworks */, + 2BDF45F51B6EA54E00EAC683 /* IDEKit.framework in Frameworks */, + 2BDF45F11B6EA51000EAC683 /* DVTKit.framework in Frameworks */, + 2BDF45EF1B6EA50300EAC683 /* DVTFoundation.framework in Frameworks */, 8742532317307161001C947C /* QuartzCore.framework in Frameworks */, - 1883080A1A7411830005DF40 /* DVTKit.framework in Frameworks */, - 1876135F1A77A74300974BE1 /* IDEKit.framework in Frameworks */, - 18C999FF1A98B04C0008AF54 /* DebuggerUI in Frameworks */, + 2BDF45F31B6EA54600EAC683 /* IDEFoundation.framework in Frameworks */, + 2BDF45FD1B6EAB8400EAC683 /* DebuggerUI in Frameworks */, + 2BDF45FB1B6EAB5600EAC683 /* IDESourceEditor in Frameworks */, 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */, - 18D6AD111A8F727B0082CB3F /* IDEFoundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -201,17 +201,18 @@ 18FE09B81707639E00118FEB /* AppKit.framework */, 18FE09B51707639E00118FEB /* Cocoa.framework */, 18FE09B91707639E00118FEB /* CoreData.framework */, - 18C999FE1A98B04C0008AF54 /* DebuggerUI */, - 184C118E1A741136002A7C65 /* DVTFoundation.framework */, - 188308091A7411830005DF40 /* DVTKit.framework */, + 2BDF45EE1B6EA50300EAC683 /* DVTFoundation.framework */, + 2BDF45F01B6EA51000EAC683 /* DVTKit.framework */, 18FE09BA1707639E00118FEB /* Foundation.framework */, - 18D6AD101A8F727B0082CB3F /* IDEFoundation.framework */, - 1876135E1A77A74300974BE1 /* IDEKit.framework */, - 1883080F1A7411A70005DF40 /* IDESourceEditor */, + 2BDF45FC1B6EAB8400EAC683 /* DebuggerUI */, + 2BDF45F21B6EA54600EAC683 /* IDEFoundation.framework */, + 2BDF45F41B6EA54E00EAC683 /* IDEKit.framework */, + 2BDF45FA1B6EAB5600EAC683 /* IDESourceEditor */, 8742532217307161001C947C /* QuartzCore.framework */, ); name = Frameworks; - sourceTree = ""; + path = "../../../../../../../../../Users/Edward/Library/Application Support/Alcatraz/Plug-ins/SCXcodeMinimap"; + sourceTree = SDKROOT; }; 18FE09BB1707639E00118FEB /* SCXcodeMinimap */ = { isa = PBXGroup; @@ -399,9 +400,9 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/OtherFrameworks", + "$(SYSTEM_DEVELOPER_DIR)/../SharedFrameworks", + "$(SYSTEM_DEVELOPER_DIR)/../Frameworks", + "$(SYSTEM_DEVELOPER_DIR)/../OtherFrameworks", ); GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -410,8 +411,9 @@ INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS", + "$(SYSTEM_DEVELOPER_DIR)/../Plugins/**", + "$(SYSTEM_APPS_DIR)/Xcode-6.4.0.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", + "$(SYSTEM_APPS_DIR)/Xcode-6.4.0.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; @@ -428,9 +430,9 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/SharedFrameworks", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Frameworks", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/OtherFrameworks", + "$(SYSTEM_DEVELOPER_DIR)/../SharedFrameworks", + "$(SYSTEM_DEVELOPER_DIR)/../Frameworks", + "$(SYSTEM_DEVELOPER_DIR)/../OtherFrameworks", ); GCC_ENABLE_OBJC_GC = ""; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -439,8 +441,9 @@ INSTALL_PATH = "/Library/Application Support/Developer/Shared/Xcode/Plug-ins"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", - "$(SYSTEM_APPS_DIR)/Xcode.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS", + "$(SYSTEM_DEVELOPER_DIR)/../Plugins/**", + "$(SYSTEM_APPS_DIR)/Xcode-6.4.0.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", + "$(SYSTEM_APPS_DIR)/Xcode-6.4.0.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; From 09f6bfd13fa3650c8a78edbdd5ef4af74507e825 Mon Sep 17 00:00:00 2001 From: "Edward B. Smith" Date: Sun, 2 Aug 2015 13:32:50 -0700 Subject: [PATCH 79/96] Fix for the last commit. I committed too soon. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 38d75df..14c312d 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -211,8 +211,7 @@ 8742532217307161001C947C /* QuartzCore.framework */, ); name = Frameworks; - path = "../../../../../../../../../Users/Edward/Library/Application Support/Alcatraz/Plug-ins/SCXcodeMinimap"; - sourceTree = SDKROOT; + sourceTree = ""; }; 18FE09BB1707639E00118FEB /* SCXcodeMinimap */ = { isa = PBXGroup; @@ -412,8 +411,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(SYSTEM_DEVELOPER_DIR)/../Plugins/**", - "$(SYSTEM_APPS_DIR)/Xcode-6.4.0.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", - "$(SYSTEM_APPS_DIR)/Xcode-6.4.0.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; @@ -442,8 +439,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(SYSTEM_DEVELOPER_DIR)/../Plugins/**", - "$(SYSTEM_APPS_DIR)/Xcode-6.4.0.app/Contents/PlugIns/IDESourceEditor.ideplugin/Contents/MacOS", - "$(SYSTEM_APPS_DIR)/Xcode-6.4.0.app/Contents/PlugIns/DebuggerUI.ideplugin/Contents/MacOS", ); PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; From 710728b77f3999acb5bbb93b69ae9cf9630f0553 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 15 Aug 2015 10:18:40 +0100 Subject: [PATCH 80/96] Prevents #67 - out of bounds color crashes. --- SCXcodeMinimap/SCXcodeMinimapView.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index ce12fa9..f6bc0f4 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -420,7 +420,13 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager } } - NSColor *foregroundColor = [[((DVTFontAndColorTheme *)theme.dvtTheme) syntaxColorsByNodeType] pointerAtIndex:nodeType]; + DVTPointerArray *colors = [((DVTFontAndColorTheme *)theme.dvtTheme) syntaxColorsByNodeType]; + + NSColor *foregroundColor = nil; + if(nodeType < colors.count) { + foregroundColor = [colors pointerAtIndex:nodeType]; + } + if(foregroundColor == nil) { foregroundColor = theme.sourcePlainTextColor; } From dc316f5e135c45310529b4c1a30f320a4ee0a35e Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 22 Aug 2015 17:01:26 +0100 Subject: [PATCH 81/96] Implemented #65 - autohiding for version and comparison editors --- SCXcodeMinimap.xcodeproj/project.pbxproj | 22 ++ SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.h | 23 ++ SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m | 55 +++ SCXcodeMinimap/SCXcodeMinimapView.m | 113 +++++- SCXcodeMinimap/Xcode Headers/DVTFilePath.h | 115 ++++++ .../Xcode Headers/IDEComparisonEditor.h | 194 ++++++++++ SCXcodeMinimap/Xcode Headers/IDEEditorArea.h | 144 ++++++++ .../Xcode Headers/IDEEditorContext.h | 339 ++++++++++++++++++ .../IDEEditorModeViewController.h | 67 ++++ .../IDESourceCodeComparisonEditor.h | 44 +++ .../Xcode Headers/IDEWorkspaceTabController.h | 338 +++++++++++++++++ .../IDEWorkspaceWindowController.h | 256 +++++++++++++ 12 files changed, 1694 insertions(+), 16 deletions(-) create mode 100644 SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.h create mode 100644 SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m create mode 100644 SCXcodeMinimap/Xcode Headers/DVTFilePath.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEComparisonEditor.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEEditorArea.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEEditorContext.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEEditorModeViewController.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDESourceCodeComparisonEditor.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEWorkspaceTabController.h create mode 100644 SCXcodeMinimap/Xcode Headers/IDEWorkspaceWindowController.h diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 14c312d..4b6d4ac 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 18C2EA5C1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */; }; 18DE25ED1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18DE25EC1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m */; }; 18E577FC1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */; }; + 18E75A261B80B3190082AA24 /* IDEEditorArea+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18E75A251B80B3190082AA24 /* IDEEditorArea+SCXcodeMinimap.m */; }; 18ECB80E1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECB80D1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m */; }; 18ECB8111B1322A300EE4D82 /* SCXcodeMinimapCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 18ECB8101B1322A300EE4D82 /* SCXcodeMinimapCommon.m */; }; 18FE09B61707639E00118FEB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18FE09B51707639E00118FEB /* Cocoa.framework */; }; @@ -71,7 +72,11 @@ 188D38781A98B3D8005C7F85 /* DVTAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotation.h; sourceTree = ""; }; 188FCC881A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h"; sourceTree = ""; }; 188FCC891A98B57A0026F529 /* DBGBreakpointAnnotationProvider+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DBGBreakpointAnnotationProvider+SCXcodeMinimap.m"; sourceTree = ""; }; + 18AFA6CE1B807E5F005D23E1 /* IDEWorkspaceWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEWorkspaceWindowController.h; sourceTree = ""; }; + 18AFA6CF1B8083BB005D23E1 /* IDEWorkspaceTabController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEWorkspaceTabController.h; sourceTree = ""; }; + 18AFA6D01B80852A005D23E1 /* IDEEditorArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEEditorArea.h; sourceTree = ""; }; 18B3CEE51A8AA52A00A0873D /* DVTPreferenceSetManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTPreferenceSetManager.h; sourceTree = ""; }; + 18B53B481B88C1A200120739 /* DVTFilePath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFilePath.h; sourceTree = ""; }; 18C2EA5A1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBGBreakpointAnnotation+SCXcodeMinimap.h"; sourceTree = ""; }; 18C2EA5B1A9C7F8A002CEB20 /* DBGBreakpointAnnotation+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DBGBreakpointAnnotation+SCXcodeMinimap.m"; sourceTree = ""; }; 18C8F0331A7ECB1300C7A76F /* DVTFoldingLayoutManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFoldingLayoutManager.h; sourceTree = ""; }; @@ -79,6 +84,10 @@ 18C999FC1A98AF370008AF54 /* DBGBreakpointAnnotationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBGBreakpointAnnotationProvider.h; sourceTree = ""; }; 18C999FD1A98AF580008AF54 /* DVTAnnotationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTAnnotationProvider.h; sourceTree = ""; }; 18CA02B61A9D0DF1001C5CE1 /* IDEBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IDEBreakpoint.h; sourceTree = ""; }; + 18D87F9C1B8899E800D27B29 /* IDESourceCodeComparisonEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDESourceCodeComparisonEditor.h; sourceTree = ""; }; + 18D87F9D1B889A3000D27B29 /* IDEComparisonEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEComparisonEditor.h; sourceTree = ""; }; + 18D87F9E1B88A57900D27B29 /* IDEEditorModeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEEditorModeViewController.h; sourceTree = ""; }; + 18DCC5BA1B80B11700596B6F /* IDEEditorContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDEEditorContext.h; sourceTree = ""; }; 18DE25EB1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDESourceCodeEditor+SCXcodeMinimap.h"; sourceTree = ""; }; 18DE25EC1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDESourceCodeEditor+SCXcodeMinimap.m"; sourceTree = ""; }; 18DE6AFB1B203D070042615D /* DVTFindResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVTFindResult.h; sourceTree = ""; }; @@ -88,6 +97,8 @@ 18E577F91B119C7200421483 /* DVTMessageBubbleAnnotation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DVTMessageBubbleAnnotation.h; sourceTree = ""; }; 18E577FA1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEIssueAnnotationProvider+SCXcodeMinimap.h"; sourceTree = ""; }; 18E577FB1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEIssueAnnotationProvider+SCXcodeMinimap.m"; sourceTree = ""; }; + 18E75A241B80B3190082AA24 /* IDEEditorArea+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "IDEEditorArea+SCXcodeMinimap.h"; sourceTree = ""; }; + 18E75A251B80B3190082AA24 /* IDEEditorArea+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "IDEEditorArea+SCXcodeMinimap.m"; sourceTree = ""; }; 18ECB80C1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DVTLayoutManager+SCXcodeMinimap.h"; sourceTree = ""; }; 18ECB80D1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DVTLayoutManager+SCXcodeMinimap.m"; sourceTree = ""; }; 18ECB80F1B1322A300EE4D82 /* SCXcodeMinimapCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SCXcodeMinimapCommon.h; sourceTree = ""; }; @@ -133,6 +144,8 @@ 184C11701A740F8A002A7C65 /* Xcode Headers */ = { isa = PBXGroup; children = ( + 18B53B481B88C1A200120739 /* DVTFilePath.h */, + 18D87F9E1B88A57900D27B29 /* IDEEditorModeViewController.h */, 188D38761A98B26E005C7F85 /* DBGBreakpointAnnotation.h */, 18C999FC1A98AF370008AF54 /* DBGBreakpointAnnotationProvider.h */, 188D38781A98B3D8005C7F85 /* DVTAnnotation.h */, @@ -165,15 +178,21 @@ 18E577F61B119BF200421483 /* IDEBuildIssueAnnotation.h */, 18E577F81B119C3F00421483 /* IDEBuildIssueErrorAnnotation.h */, 18E577F71B119C1000421483 /* IDEBuildIssueWarningAnnotation.h */, + 18D87F9D1B889A3000D27B29 /* IDEComparisonEditor.h */, 184C117D1A740F8A002A7C65 /* IDEEditor.h */, + 18AFA6D01B80852A005D23E1 /* IDEEditorArea.h */, + 18DCC5BA1B80B11700596B6F /* IDEEditorContext.h */, 1876135D1A77A69F00974BE1 /* IDEEditorDocument.h */, 187EEF6A1A8F78C400E4EF39 /* IDEFileBreakpoint.h */, 18FEFA8C1A782D8600DC98C5 /* IDEFileTextSettings.h */, 180F24D61B119866009ACE49 /* IDEIssueAnnotationProvider.h */, + 18D87F9C1B8899E800D27B29 /* IDESourceCodeComparisonEditor.h */, 1812C3911A77A7CF00E2CFB3 /* IDESourceCodeDocument.h */, 184C117E1A740F8A002A7C65 /* IDESourceCodeEditor.h */, 184C117F1A740F8A002A7C65 /* IDESourceCodeEditorContainerView.h */, 184C11801A740F8A002A7C65 /* IDEViewController.h */, + 18AFA6CF1B8083BB005D23E1 /* IDEWorkspaceTabController.h */, + 18AFA6CE1B807E5F005D23E1 /* IDEWorkspaceWindowController.h */, ); path = "Xcode Headers"; sourceTree = ""; @@ -240,6 +259,8 @@ 18DE25EC1B202ACA00F3D380 /* IDESourceCodeEditor+SCXcodeMinimap.m */, 1809FF8D1AED1A730058D946 /* NSScroller+SCXcodeMinimap.h */, 1809FF8E1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m */, + 18E75A241B80B3190082AA24 /* IDEEditorArea+SCXcodeMinimap.h */, + 18E75A251B80B3190082AA24 /* IDEEditorArea+SCXcodeMinimap.m */, 18FE09BC1707639E00118FEB /* Supporting Files */, 184C11701A740F8A002A7C65 /* Xcode Headers */, ); @@ -327,6 +348,7 @@ 18ECB80E1B13226500EE4D82 /* DVTLayoutManager+SCXcodeMinimap.m in Sources */, 1819E4291AA1FB5900C344F2 /* SCXcodeMinimapScrollView.m in Sources */, 18E577FC1B119F6600421483 /* IDEIssueAnnotationProvider+SCXcodeMinimap.m in Sources */, + 18E75A261B80B3190082AA24 /* IDEEditorArea+SCXcodeMinimap.m in Sources */, 1809FF8F1AED1A730058D946 /* NSScroller+SCXcodeMinimap.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.h b/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.h new file mode 100644 index 0000000..67fb1f2 --- /dev/null +++ b/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.h @@ -0,0 +1,23 @@ +// +// IDEEditorArea+SCXcodeMinimap.h +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 8/16/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "IDEEditorArea.h" + +@protocol IDEEditorAreaMinimapDelegate; + +@interface IDEEditorArea (SCXcodeMinimap) + +@property (nonatomic, weak) id minimapDelegate; + +@end + +@protocol IDEEditorAreaMinimapDelegate + +- (void)editorAreaDidChangeEditorMode:(IDEEditorArea *)editorArea; + +@end diff --git a/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m b/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m new file mode 100644 index 0000000..199f687 --- /dev/null +++ b/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m @@ -0,0 +1,55 @@ +// +// IDEEditorArea+SCXcodeMinimap.m +// SCXcodeMinimap +// +// Created by Stefan Ceriu on 8/16/15. +// Copyright (c) 2015 Stefan Ceriu. All rights reserved. +// + +#import "IDEEditorArea+SCXcodeMinimap.h" +#import "SCXcodeMinimapCommon.h" + +static void *IDEEditorAreaEditorModeObservingContext = &IDEEditorAreaEditorModeObservingContext; + +@implementation IDEEditorArea (SCXcodeMinimap) + ++ (void)load +{ + sc_swizzleInstanceMethod([self class], @selector(viewDidInstall), @selector(sc_viewDidInstall)); + sc_swizzleInstanceMethod([self class], @selector(viewWillUninstall), @selector(sc_viewWillUninstall)); +} + +- (id)minimapDelegate +{ + return objc_getAssociatedObject(self, @selector(minimapDelegate)); +} + +- (void)setMinimapDelegate:(id)minimapDelegate +{ + objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); +} + +- (void)sc_viewDidInstall +{ + [self addObserver:self forKeyPath:@"editorMode" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:IDEEditorAreaEditorModeObservingContext]; + + [self sc_viewDidInstall]; +} + +- (void)sc_viewWillUninstall +{ + [self removeObserver:self forKeyPath:@"editorMode"]; + + [self sc_viewWillUninstall]; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if(context == IDEEditorAreaEditorModeObservingContext) { + if([self.minimapDelegate respondsToSelector:@selector(editorAreaDidChangeEditorMode:)]) { + [self.minimapDelegate editorAreaDidChangeEditorMode:self]; + } + } +} + +@end diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index f6bc0f4..7f6ada5 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -12,7 +12,9 @@ #import "SCXcodeMinimapSelectionView.h" #import "IDESourceCodeEditor+SCXcodeMinimap.h" -#import "IDEEditorDocument.h" +#import "IDESourceCodeComparisonEditor.h" +#import "IDESourceCodeDocument.h" +#import "DVTFilePath.h" #import "DVTTextStorage.h" #import "DVTLayoutManager+SCXcodeMinimap.h" @@ -40,6 +42,12 @@ #import "NSScroller+SCXcodeMinimap.h" +#import "IDEWorkspaceWindowController.h" +#import "IDEWorkspaceTabController.h" +#import "IDEEditorArea+SCXcodeMinimap.h" +#import "IDEEditorModeViewController.h" +#import "IDEEditorContext.h" + typedef NS_ENUM(NSUInteger, SCXcodeMinimapAnnotationType) { SCXcodeMinimapAnnotationTypeUndefined, SCXcodeMinimapAnnotationTypeTypeWarning, @@ -70,9 +78,13 @@ @interface SCXcodeMinimapView () < NSLayoutManagerDelegate, DBGBreakpointAnnotationProviderDelegate, IDEIssueAnnotationProviderDelegate, DVTLayoutManagerMinimapDelegate, - IDESourceCodeEditorSearchResultsDelegate > + IDESourceCodeEditorSearchResultsDelegate, + IDEEditorAreaMinimapDelegate > @property (nonatomic, weak) IDESourceCodeEditor *editor; + +@property (nonatomic, weak) IDEEditorArea *editorArea; + @property (nonatomic, strong) DVTSourceTextView *editorTextView; @property (nonatomic, strong) SCXcodeMinimapScrollView *scrollView; @@ -120,7 +132,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self.editor setSearchResultsDelegate:self]; self.editorTextView = editor.textView; - + [self setWantsLayer:YES]; [self setAutoresizingMask:NSViewMinXMargin | NSViewMinYMargin | NSViewWidthSizable | NSViewHeightSizable]; @@ -137,7 +149,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [self.scrollView setVerticalScrollElasticity:NSScrollElasticityNone]; [self addSubview:self.scrollView]; - self.textView = [[DVTSourceTextView alloc] init]; + self.textView = [[DVTSourceTextView alloc] initWithFrame:CGRectZero]; NSTextStorage *storage = self.editorTextView.textStorage; [self.textView setTextStorage:storage]; @@ -191,7 +203,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor __weak typeof(self) weakSelf = self; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapShouldDisplayChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [weakSelf setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; + [weakSelf toggleVisibility]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapZoomLevelChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -241,7 +253,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapAutohideChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { - [self tryShowing]; + [self toggleVisibility]; }]]; [self.notificationObservers addObject:[[NSNotificationCenter defaultCenter] addObserverForName:SCXcodeMinimapThemeChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) { @@ -268,23 +280,29 @@ - (void)viewDidMoveToWindow return; } - [self tryShowing]; + self.editorArea = [self getEditorArea]; + [self.editorArea setMinimapDelegate:self]; + + [self toggleVisibility]; } -- (void)tryShowing +- (void)toggleVisibility { + BOOL visible = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]; BOOL shouldAutohide = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldAutohideKey] boolValue]; - if(shouldAutohide) { - NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; - if(NSEqualRanges(visibleEditorRange, NSMakeRange(0, self.textView.string.length))) { - return; + if(shouldAutohide && visible) { + if(self.editorArea == nil || self.editorArea.editorMode) { + visible = NO; + } else { + NSRange visibleEditorRange = [self.editorTextView visibleCharacterRange]; + if(NSEqualRanges(visibleEditorRange, NSMakeRange(0, self.textView.string.length))) { + visible = NO; + } } } - dispatch_async(dispatch_get_main_queue(), ^{ - [self setVisible:[[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapShouldDisplayKey] boolValue]]; - }); + [self setVisible:visible]; } #pragma mark - Show/Hide @@ -463,6 +481,13 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRan [self updateOffset]; } +#pragma mark - IDEEditorAreaMinimapDelegate + +- (void)editorAreaDidChangeEditorMode:(IDEEditorArea *)editorArea +{ + [self toggleVisibility]; +} + #pragma mark - DBGBreakpointAnnotationProviderDelegate - (void)breakpointAnnotationProviderDidChangeBreakpoints:(DBGBreakpointAnnotationProvider *)annotationProvider @@ -693,9 +718,12 @@ - (void)updateTheme - (void)updateSize { CGFloat zoomLevel = [[[NSUserDefaults standardUserDefaults] objectForKey:SCXcodeMinimapZoomLevelKey] doubleValue]; - CGFloat minimapWidth = (self.hidden ? 0.0f : self.editor.containerView.bounds.size.width * zoomLevel); + if(CGRectGetWidth(self.bounds) == minimapWidth) { + return; + } + NSRect editorScrollViewFrame = self.editor.scrollView.frame; editorScrollViewFrame.size.width = self.editor.scrollView.superview.frame.size.width - minimapWidth; self.editor.scrollView.frame = editorScrollViewFrame; @@ -784,4 +812,57 @@ - (void)invalidateMinimap } } +- (IDEEditorArea *)getEditorArea +{ + IDEWorkspaceWindowController *windowController = [IDEWorkspaceWindowController workspaceWindowControllerForWindow:self.window]; + if(!windowController) { + return nil; + } + IDEWorkspaceTabController *tabController = nil; + + for(IDEWorkspaceTabController *someTabController in windowController.workspaceTabControllers) { + + NSView *superview = self.superview; + while (superview) { + if([superview isEqual:someTabController.view]) { + tabController = someTabController; + break; + } + + superview = superview.superview; + } + + if(tabController) { + break; + } + } + + if(!tabController) { + return nil; + } + + if([tabController.editorArea.primaryEditorContext.editor isKindOfClass:[IDESourceCodeEditor class]]) { + + IDEEditorDocument *document = self.editor.sourceCodeDocument; + IDEEditorDocument *primaryDocument = tabController.editorArea.primaryEditorDocument; + IDEEditorDocument *alternateDocument = tabController.editorArea.editorModeViewController.selectedAlternateEditorContext.editor.document; + + if([document isEqualTo:primaryDocument] || [document isEqualTo:alternateDocument] || + [document.filePath.fileName isEqualToString:primaryDocument.filePath.fileName] || + [document.filePath.fileName isEqualToString:alternateDocument.filePath.fileName]) { + return tabController.editorArea; + } + + } else if([tabController.editorArea.primaryEditorContext.editor isKindOfClass:[IDESourceCodeComparisonEditor class]]) { + + IDESourceCodeComparisonEditor *editor = (IDESourceCodeComparisonEditor *)tabController.editorArea.primaryEditorContext.editor; + + if([editor.primaryDocument isEqualTo:self.editor.sourceCodeDocument] || [editor.secondaryDocument isEqualTo:self.editor.sourceCodeDocument]) { + return tabController.editorArea; + } + } + + return nil; +} + @end diff --git a/SCXcodeMinimap/Xcode Headers/DVTFilePath.h b/SCXcodeMinimap/Xcode Headers/DVTFilePath.h new file mode 100644 index 0000000..eecd82a --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/DVTFilePath.h @@ -0,0 +1,115 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +@class DVTFileDataType, DVTFileSystemVNode, NSArray, NSDate, NSDictionary, NSString, NSURL; + +@interface DVTFilePath : NSObject +{ + DVTFilePath *_parentPath; + struct fastsimplearray *_childfsaPaths; + DVTFileSystemVNode *_vnode; + unsigned long long _numAssociates; + unsigned long long _numObservers; + id _associates; + NSString *_pathString; + NSURL *_fileURL; + BOOL _hasResolvedVnode; + BOOL _cleanRemoveFromParent; + unsigned char _validationState; + unsigned short _fsrepLength; + int _childPathsLock; + int _associatesLock; + char _fsrep[0]; +} + ++ (void)_registerStandardCachedFileInfoDerivationFunctionsIfNeeded; + ++ (id)filePathForFileURL:(id)arg1; ++ (id)filePathForPathString:(id)arg1; ++ (id)filePathForFileSystemRepresentation:(const char *)arg1; ++ (id)filePathForFileSystemRepresentation:(const char *)arg1 length:(unsigned long long)arg2; ++ (id)_filePathForParent:(id)arg1 pathString:(id)arg2; ++ (id)_filePathForParent:(id)arg1 fileSystemRepresentation:(const char *)arg2 length:(unsigned long long)arg3 allowCreation:(BOOL)arg4; ++ (BOOL)supportsSecureCoding; ++ (id)_lookupOrCreateFilePathWithParentPath:(id)arg1 fileSystemRepresentation:(const char *)arg2 length:(unsigned long long)arg3 allowCreation:(BOOL)arg4; ++ (id)rootFilePath; + +- (id)_descriptionOfAssociates; +- (id)description; +- (void)dvt_provideFileSystemRepresentationToBlock:(dispatch_block_t)arg1; +- (void)removeAllAssociates; +- (void)removeAssociate:(id)arg1; +- (void)removeAssociatesWithRole:(id)arg1; +- (void)removeAssociate:(id)arg1 withRole:(id)arg2; +- (void)addAssociate:(id)arg1 withRole:(id)arg2 observingDidChangeRecursively:(BOOL)arg3 onOperationQueue:(id)arg4 block:(dispatch_block_t)arg5; +- (void)addAssociate:(id)arg1 withRole:(id)arg2 observingDidChangeRecursively:(BOOL)arg3 onDispatchQueue:(id)arg4 block:(dispatch_block_t)arg5; +- (void)addAssociate:(id)arg1 withRole:(id)arg2; +- (id)associatesWithRole:(id)arg1; +- (id)associatesWithRole:(id)arg1 forAllPathsToSameFile:(BOOL)arg2; +- (void)_addAssociatesWithRole:(id)arg1 toArray:(id *)arg2; +- (void)_notifyAssociatesOfChange; +- (BOOL)_hasChangeObservers; +- (BOOL)_addInfoForObserversOfChangedFilePath:(id)arg1 toObjects:(id)arg2 blocks:(id)arg3 dispatchQueues:(id)arg4 operationQueues:(id)arg5; +- (id)cachedValueForKey:(id)arg1; +- (id)machOArchitecturesWithError:(id *)arg1; +@property(readonly) DVTFileDataType *fileDataTypePresumed; +@property(readonly) DVTFileDataType *fileDataTypeFromFileContent; +@property(readonly) DVTFilePath *symbolicLinkDestinationFilePath; +@property(readonly) NSURL *fileReferenceURL; +@property(readonly) NSDictionary *fileSystemAttributes; +@property(readonly) NSDictionary *fileAttributes; +@property(readonly) NSString *fileTypeAttribute; +@property(readonly) BOOL isDirectory; +@property(readonly) NSArray *sortedDirectoryContents; +- (id)directoryContentsWithError:(id *)arg1; +@property(readonly) NSArray *directoryContents; +@property(readonly) NSDate *modificationDate; +@property(readonly) BOOL isExcludedFromBackup; +@property(readonly) BOOL isSymbolicLink; +@property(readonly) BOOL isExecutable; +@property(readonly) BOOL isDeletable; +@property(readonly) BOOL isWritable; +@property(readonly) BOOL isReadable; +@property(readonly) BOOL existsInFileSystem; +- (void)excludeFromBackup; +- (BOOL)_hasResolvedVnode; +- (id)_locked_vnode; +- (id)_locked_vnodeKnownDoesNotExist:(BOOL)arg1; +- (void)_invalidateFilePathAndChildrenIncludingEquivalents; +- (void)_invalidateFilePathAndChildren; +- (void)invalidateFilePath; +- (void)_invalidateKnownDoesNotExist:(BOOL)arg1 explicitlyInvalidateChildren:(BOOL)arg2; +- (void)_invalidateChildrenRecursivelyKnownDoesNotExist:(BOOL)arg1; +- (void)_locked_validateTentativelyInvalidatedChildrenRecursively; +- (void)_locked_tentativelyInvalidateChildrenRecursivelyWithChildrenShouldBeTentativelyInvalid:(BOOL)arg1; +- (BOOL)isSameFileAsFilePath:(id)arg1; +- (BOOL)isEqual:(id)arg1; +- (id)relativePathStringFromFilePath:(id)arg1; +- (id)relativePathStringFromAncestorFilePath:(id)arg1; +- (BOOL)getFullFileSystemRepresentationIntoBuffer:(char **)arg1 ofLength:(unsigned long long)arg2 allowAllocation:(BOOL)arg3; +- (BOOL)_getFSRepIntoBuffer:(char **)arg1 ofLength:(unsigned long long)arg2 requiredLength:(unsigned long long)arg3 endPtr:(char **)arg4 allowAllocation:(BOOL)arg5; +@property(readonly) NSString *fileName; +@property(readonly) NSURL *fileURL; +@property(readonly) NSArray *pathComponents; +@property(readonly) NSString *pathString; +- (id)filePathForUniqueRelativeDirectoryWithPrefix:(id)arg1 error:(id *)arg2; +- (id)filePathForUniqueRelativeFileWithPrefix:(id)arg1 error:(id *)arg2; +- (id)filePathForRelativePathString:(id)arg1; +- (id)filePathForRelativeFileSystemRepresentation:(const char *)arg1; +- (id)filePathForRelativeFileSystemRepresentation:(const char *)arg1 length:(unsigned long long)arg2; +- (BOOL)isAncestorOfFilePath:(id)arg1; +@property(readonly) DVTFilePath *volumeFilePath; +@property(readonly) DVTFilePath *parentFilePath; +- (void)encodeWithCoder:(id)arg1; +- (id)initWithCoder:(id)arg1; +- (id)copyWithZone:(struct _NSZone *)arg1; +- (id)init; +- (void)_invokeWithLockedAssociates:(dispatch_block_t)arg1; +- (void)_invokeWithLockedChildPaths:(dispatch_block_t)arg1; +- (void)dealloc; + +@end + diff --git a/SCXcodeMinimap/Xcode Headers/IDEComparisonEditor.h b/SCXcodeMinimap/Xcode Headers/IDEComparisonEditor.h new file mode 100644 index 0000000..dbf697b --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEComparisonEditor.h @@ -0,0 +1,194 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +#import "IDEEditor.h" + +@class DVTBindingToken, DVTComparisonDocumentLocation, DVTDispatchLock, DVTObservingToken, DVTPerformanceMetric, DVTReplacementView, IDEComparisonEditorAutoLayoutView, IDEComparisonEditorSubmode, IDEComparisonNavTimelineBar, IDEComparisonToolbar, IDEEditorDocument, IDENavigableItem, IDENavigableItemCoordinator, IDESourceControlConflictResolutionController, IDESourceControlInteractiveCommitController, NSArray, NSDictionary, NSMutableArray, NSMutableSet, NSSet, NSSplitView, NSString; + +@interface IDEComparisonEditor : IDEEditor +{ + IDEComparisonNavTimelineBar *_navTimelineBar; + IDEComparisonToolbar *_comparisonToolbar; + NSSplitView *_aboveView; + DVTReplacementView *_logReplacementView; + DVTReplacementView *_submodeReplacementView; + id _comparisonEditorDelegate; + id _dataSource; + DVTObservingToken *_frameResizeToken; + NSMutableArray *_navItemCoordinatorDidForgetItemsTokens; + IDENavigableItemCoordinator *_sharedNavigableItemCoordinator; + IDENavigableItemCoordinator *_primaryNavigableItemCoordinator; + IDENavigableItemCoordinator *_secondaryNavigableItemCoordinator; + IDENavigableItem *_primaryRootNavigableItem; + IDENavigableItem *_secondaryRootNavigableItem; + IDENavigableItem *_primarySubNavigableItem; + IDENavigableItem *_secondarySubNavigableItem; + NSMutableSet *_documentsToRelease; + NSMutableSet *_documentsToClose; + NSMutableSet *_documentsToDelete; + NSMutableSet *_readOnlyDocuments; + IDEEditorDocument *_primaryDocument; + id _primaryDocumentExportToken; + id _primaryPathControlUpdateToken; + IDEEditorDocument *_secondaryDocument; + id _secondaryDocumentExportToken; + id _secondaryPathControlUpdateToken; + IDEEditorDocument *_ancestorDocument; + id _ancestorDocumentExportToken; + DVTObservingToken *_diffSessionObservingToken; + int _editorSubmode; + IDEComparisonEditorAutoLayoutView *_layoutView; + DVTComparisonDocumentLocation *_internalComparisonDocumentLocation; + NSArray *_keyEditorDocumentLocations; + NSDictionary *_keyEditorAnnotationRepresentedObjectState; + unsigned long long _conflictCount; + IDESourceControlConflictResolutionController *_conflictResolutionController; + IDESourceControlInteractiveCommitController *_interactiveCommitController; + NSSet *_blacklistedAnnotationProviders; + BOOL _documentHasUnsavedChanges; + BOOL _hideToolBar; + BOOL _hideSubmodeSegmentedControl; + BOOL _hideNavTimelineBar; + BOOL _disableChangeSourceTree; + BOOL _disableChangeBranch; + BOOL _disableChangeRevision; + BOOL _ownsDataSource; + BOOL _shouldSelectFirstDiff; + BOOL _shouldTakeFocus; + BOOL _loadedSpecificRevision; + BOOL _hideDiffMenu; + BOOL _enableDiffToggles; + int _toggleAllDiffDescriptorsState; + unsigned long long _exportOperationsFinished; + unsigned long long _exportOperationsPending; + DVTObservingToken *_didScanToken; + DVTObservingToken *_localStatusUpdateToken; + id _refreshObservationToken; + id _refreshWhenSwitchingObservationToken; + DVTBindingToken *_logViewDocumentBindingToken; + DVTPerformanceMetric *_performanceMetric; + DVTDispatchLock *_performanceDispatchLock; + BOOL _nextFinishPerformanceTestFinishesTest; +} + ++ (id)keyPathsForValuesAffectingCurrentSelectedDocumentLocations; ++ (id)keyPathsForValuesAffectingPrimaryEditorInstance; ++ (id)keyPathsForValuesAffectingCurrentSelectedItems; ++ (id)keyPathsForValuesAffectingKeyEditor; ++ (BOOL)automaticallyNotifiesObserversOfInternalComparisonDocumentLocation; ++ (id)keyPathsForValuesAffectingSubmode; ++ (id)keyPathsForValuesAffectingIsThreeWayDiff; ++ (id)keyPathsForValuesAffectingSecondaryRootNavigableItem_arrayOfOne; ++ (id)keyPathsForValuesAffectingPrimaryRootNavigableItem_arrayOfOne; ++ (void)initialize; ++ (id)performanceLogAspect; ++ (id)comparisonEditorLogAspect; +@property(retain) IDENavigableItem *secondaryRootNavigableItem; // @synthesize secondaryRootNavigableItem=_secondaryRootNavigableItem; +@property(retain) IDENavigableItem *primaryRootNavigableItem; // @synthesize primaryRootNavigableItem=_primaryRootNavigableItem; +@property int toggleAllDiffDescriptorsState; // @synthesize toggleAllDiffDescriptorsState=_toggleAllDiffDescriptorsState; +@property BOOL enableDiffToggles; // @synthesize enableDiffToggles=_enableDiffToggles; +@property BOOL hideDiffMenu; // @synthesize hideDiffMenu=_hideDiffMenu; +@property(retain) NSSet *blacklistedAnnotationProviders; // @synthesize blacklistedAnnotationProviders=_blacklistedAnnotationProviders; +@property BOOL documentHasUnsavedChanges; // @synthesize documentHasUnsavedChanges=_documentHasUnsavedChanges; +@property unsigned long long conflictCount; // @synthesize conflictCount=_conflictCount; +@property BOOL shouldTakeFocus; // @synthesize shouldTakeFocus=_shouldTakeFocus; +@property(retain) NSDictionary *keyEditorAnnotationRepresentedObjectState; // @synthesize keyEditorAnnotationRepresentedObjectState=_keyEditorAnnotationRepresentedObjectState; +@property(copy) NSArray *keyEditorDocumentLocations; // @synthesize keyEditorDocumentLocations=_keyEditorDocumentLocations; +@property BOOL disableChangeRevision; // @synthesize disableChangeRevision=_disableChangeRevision; +@property BOOL disableChangeBranch; // @synthesize disableChangeBranch=_disableChangeBranch; +@property BOOL disableChangeSourceTree; // @synthesize disableChangeSourceTree=_disableChangeSourceTree; +@property(nonatomic) BOOL shouldSelectFirstDiff; // @synthesize shouldSelectFirstDiff=_shouldSelectFirstDiff; +@property(retain) DVTReplacementView *submodeReplacementView; // @synthesize submodeReplacementView=_submodeReplacementView; +@property(retain) DVTReplacementView *logReplacementView; // @synthesize logReplacementView=_logReplacementView; +@property(retain) IDEComparisonEditorAutoLayoutView *layoutView; // @synthesize layoutView=_layoutView; +@property(retain) NSSplitView *aboveView; // @synthesize aboveView=_aboveView; +@property(retain) IDEComparisonToolbar *comparisonToolbar; // @synthesize comparisonToolbar=_comparisonToolbar; +@property(retain) IDEComparisonNavTimelineBar *navTimelineBar; // @synthesize navTimelineBar=_navTimelineBar; +@property(retain) id comparisonEditorDelegate; // @synthesize comparisonEditorDelegate=_comparisonEditorDelegate; +@property(retain) IDEEditorDocument *ancestorDocument; // @synthesize ancestorDocument=_ancestorDocument; +@property(retain) IDEEditorDocument *secondaryDocument; // @synthesize secondaryDocument=_secondaryDocument; +@property(retain) IDEEditorDocument *primaryDocument; // @synthesize primaryDocument=_primaryDocument; +- (BOOL)pathCell:(id)arg1 shouldPopUpMenuForPathComponentCell:(id)arg2 item:(id)arg3; +- (BOOL)splitView:(id)arg1 shouldAdjustSizeOfSubview:(id)arg2; +- (BOOL)splitView:(id)arg1 shouldHideDividerAtIndex:(long long)arg2; +- (double)splitView:(id)arg1 constrainMaxCoordinate:(double)arg2 ofSubviewAt:(long long)arg3; +- (double)splitView:(id)arg1 constrainMinCoordinate:(double)arg2 ofSubviewAt:(long long)arg3; +- (BOOL)splitView:(id)arg1 canCollapseSubview:(id)arg2; +- (void)_setupEmptyEditors; +- (BOOL)isCurrentPrimaryRevisionInMemoryOrLocal; +- (void)takeFocus; +- (void)_unpackAndApplyAnnotationRepresentedObjectState; +- (void)navigateToAnnotationWithRepresentedObject:(id)arg1 wantsIndicatorAnimation:(BOOL)arg2 exploreAnnotationRepresentedObject:(id)arg3; +- (void)selectDocumentLocations:(id)arg1; +- (BOOL)_comparisonDocumentLocationContainsSourceControlDocumentLocations:(id)arg1; +- (id)currentSelectedDocumentLocations; +- (id)currentSelectedItems; +- (void)_exportAncestorDocument; +- (void)_exportSecondaryDocument; +- (void)_exportPrimaryDocument; +- (void)_disposeDocument:(id)arg1; +- (void)_trackDocument:(id)arg1 options:(int)arg2; +- (void)_updateSecondaryPathControl; +- (void)_updatePrimaryPathControl; +- (void)_updateBothPathControlsForcingReload:(BOOL)arg1; +- (id)_cleanupDocumentLocationFromStateSaving:(id)arg1; +- (void)_convertDocumentLocationToComparisonDocumentLocation:(id)arg1 completionBlock:(dispatch_block_t)arg2; +- (struct CGRect)overlayFrameForView:(id)arg1; +- (id)interactiveCommitController; +- (id)conflictResolutionController; +- (BOOL)disableBlame; +@property(readonly) BOOL isThreeWayDiff; +@property(readonly) NSArray *secondaryRootNavigableItem_arrayOfOne; +@property(readonly) NSArray *primaryRootNavigableItem_arrayOfOne; +- (id)secondaryEditorInstance; +- (id)primaryEditorInstance; +- (id)keyEditor; +@property(retain) IDENavigableItem *secondarySubNavigableItem; // @synthesize secondarySubNavigableItem=_secondarySubNavigableItem; +@property(retain) IDENavigableItem *primarySubNavigableItem; // @synthesize primarySubNavigableItem=_primarySubNavigableItem; +- (void)setInternalComparisonDocumentLocation:(id)arg1; +- (void)reloadComparisonEditorWithComparisonDocumentLocation:(id)arg1 force:(BOOL)arg2; +- (void)_finishPerformanceTest; +- (void)_exportOperationFinished; +- (void)_pendingExportOperations:(unsigned long long)arg1 withDocumentLocation:(id)arg2 force:(BOOL)arg3; +- (id)internalComparisonDocumentLocation; +@property(readonly) IDEComparisonEditorSubmode *submode; +@property int editorSubmode; +@property BOOL hideChangesStepperControl; +@property BOOL hideNavTimelineBar; +@property BOOL hideSubmodeSegmentedControl; // @synthesize hideSubmodeSegmentedControl=_hideSubmodeSegmentedControl; +@property BOOL hideToolBar; +- (void)_willOpenSpecifier:(id)arg1; +- (void)_validateAndUpdateOnSubmodeChange; +- (void)_updateOnSubmodeChange; +- (void)showRevision:(id)arg1; +- (void)compareCurrentRevisionToRevision:(id)arg1; +- (void)compareRevisionChange:(id)arg1; +- (void)setupFrameResizeObservation; +- (void)cancelFrameResizeToken; +- (void)_setupSupportViews; +- (void)_cleanupSupportViews; +- (void)_editorDocumentDirtyStatusDidChange:(id)arg1; +- (void)viewWillUninstall; +@property(retain) id dataSource; // @synthesize dataSource=_dataSource; +- (void)viewDidInstall; +- (void)loadView; +- (BOOL)secondaryEditorShowsDocumentPreview; +- (BOOL)primaryEditorShowsDocumentPreview; +- (BOOL)shouldShowAnnotationsFromProviderClass:(Class)arg1; +- (void)primitiveInvalidate; +- (id)initWithNibName:(id)arg1 bundle:(id)arg2 document:(id)arg3; +- (void)_setupNavItemCoordinators; +- (void)_cleanupNavItemCoordinators; +- (id)performanceMetric; + +// Remaining properties +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) Class superclass; + +@end + diff --git a/SCXcodeMinimap/Xcode Headers/IDEEditorArea.h b/SCXcodeMinimap/Xcode Headers/IDEEditorArea.h new file mode 100644 index 0000000..ec15b80 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEEditorArea.h @@ -0,0 +1,144 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +#import "IDEViewController.h" + +@class DVTBorderedView, DVTLayoutView_ML, DVTObservingToken, DVTReplacementView, DVTSplitView, DVTSplitViewItem, DVTStateToken, IDEDebugArea, IDEDebugBar, IDEEditorContext, IDEEditorDocument, IDEEditorModeViewController, IDENavigableItemArchivableRepresentation, IDEWorkspaceTabControllerLayoutTree, NSMutableDictionary, NSString, NSView; + +@interface IDEEditorArea : IDEViewController +{ + NSView *_editorModeHostView; + IDEEditorModeViewController *_editorModeViewController; + int _editorMode; + int _versionEditorSubmode; + DVTObservingToken *_workspaceActivityObserver; + IDEEditorContext *_lastActiveEditorContext; + IDEDebugBar *_activeDebuggerBar; + IDEDebugArea *_activeDebuggerArea; + NSMutableDictionary *_defaultPersistentRepresentations; + NSString *_currentDefaultDebugAreaExtensionID; + DVTLayoutView_ML *_editorAreaAutoLayoutView; + DVTLayoutView_ML *_debuggerAreaAutoLayoutView; + DVTBorderedView *_debuggerBarBorderedView; + DVTBorderedView *_debuggerAreaBorderedView; + DVTReplacementView *_debuggerBarReplacementView; + DVTReplacementView *_debuggerAreaReplacementView; + DVTSplitView *_debuggerSplitView; + DVTSplitViewItem *_debugAreaSplitViewItem; + double _heightToReturnToDebuggerArea; + id _launchSessionObserver; + IDEWorkspaceTabControllerLayoutTree *_layoutTreeForNavigationHUD; + IDEWorkspaceTabControllerLayoutTree *_oldLayoutTreeFromStateSaving; + BOOL _didInstall; + BOOL _needsToRefreshContexts; + BOOL _didRestoreState; + BOOL _userWantsEditorVisible; + BOOL _showDebuggerArea; + IDEEditorContext *_navigationTargetedEditorContext; +} + ++ (long long)version; ++ (void)configureStateSavingObjectPersistenceByName:(id)arg1; ++ (id)keyPathsForValuesAffectingShowEditor; ++ (id)keyPathsForValuesAffectingSelectedNavigableItemArchivedRepresentation; ++ (id)keyPathsForValuesAffectingNavigationTargetedEditorDocument; ++ (id)keyPathsForValuesAffectingPrimaryEditorDocument; ++ (id)keyPathsForValuesAffectingPrimaryEditorContext; ++ (int)defaultVersionEditorSubmode; ++ (int)defaultEditorMode; ++ (BOOL)automaticallyNotifiesObserversOfLastActiveEditorContext; ++ (void)initialize; +@property(retain) IDEEditorContext *navigationTargetedEditorContext; // @synthesize navigationTargetedEditorContext=_navigationTargetedEditorContext; +@property(nonatomic) int versionEditorSubmode; // @synthesize versionEditorSubmode=_versionEditorSubmode; +@property(nonatomic) int editorMode; // @synthesize editorMode=_editorMode; +@property(retain) IDEDebugArea *activeDebuggerArea; // @synthesize activeDebuggerArea=_activeDebuggerArea; +@property(retain) IDEDebugBar *activeDebuggerBar; // @synthesize activeDebuggerBar=_activeDebuggerBar; +@property(retain, nonatomic) IDEEditorContext *lastActiveEditorContext; // @synthesize lastActiveEditorContext=_lastActiveEditorContext; +@property(readonly) DVTReplacementView *debuggerAreaReplacementView; // @synthesize debuggerAreaReplacementView=_debuggerAreaReplacementView; +@property(nonatomic) BOOL userWantsEditorVisible; // @synthesize userWantsEditorVisible=_userWantsEditorVisible; +@property(retain) IDEEditorModeViewController *editorModeViewController; // @synthesize editorModeViewController=_editorModeViewController; +- (void)_clearLayoutTreeForNavigationHUD; +- (void)setLayoutTreeForNavigationHUD:(IDEWorkspaceTabControllerLayoutTree *)arg1; +@property(readonly) IDEWorkspaceTabControllerLayoutTree *layoutTreeForNavigationHUD; +- (id)_generateLayoutTreeForNavigationHUD; +- (void)discardEditing; +- (BOOL)commitEditingForAction:(int)arg1 errors:(id)arg2; +- (void)commitStateToDictionary:(id)arg1; +- (void)revertStateWithDictionary:(id)arg1; +@property(retain) DVTStateToken *stateToken; // @dynamic stateToken; +- (void)_updateStateSavingRegistrations; +- (void)splitView:(id)arg1 resizeSubviewsWithOldSize:(struct CGSize)arg2; +- (void)_resizeSubviewsForHeightIncrease:(double)arg1; +- (void)_resizeSubviewsForHeightDecrease:(double)arg1; +- (id)splitView:(id)arg1 additionalEffectiveRectsOfDividerAtIndex:(long long)arg2; +- (double)splitView:(id)arg1 constrainSplitPosition:(double)arg2 ofSubviewAt:(long long)arg3; +- (BOOL)splitView:(id)arg1 canCollapseSubview:(id)arg2; +- (double)splitView:(id)arg1 constrainMaxCoordinate:(double)arg2 ofSubviewAt:(long long)arg3; +- (double)splitView:(id)arg1 constrainMinCoordinate:(double)arg2 ofSubviewAt:(long long)arg3; +- (void)compareRevisionChange:(id)arg1; +- (void)showBlame; +- (BOOL)validateUserInterfaceItem:(id)arg1; +- (void)toggleDebuggerVisibility:(id)arg1; +- (void)activateConsole:(id)arg1; +@property BOOL showDebuggerArea; +- (void)_setShowDebuggerArea:(BOOL)arg1 animate:(BOOL)arg2; +- (void)showDebuggerArea:(id)arg1; +@property BOOL showEditor; +- (void)_updateDebuggerBarVisibility; +- (void)_addDebuggerBarToDebuggerArea; +- (void)_addDebuggerBarToEditorArea; +- (void)_moveDebuggerBarToDebuggerArea; +- (void)_moveDebuggerBarToEditorArea; +- (void)_hideDebuggerBarAndResetSplitViewFrames; +- (void)_resetSplitViewFrames; +@property(readonly) BOOL showDebuggerBar; +- (id)_defaultPersistentRepresentationForDocumentExtensionIdentifier:(id)arg1 documentURL:(id)arg2; +- (void)_clearDefaultPersistentRepresentationForDocumentExtensionIdentifier:(id)arg1 documentURL:(id)arg2; +- (void)_cacheDefaultPersistentRepresentation:(id)arg1 forDocumentExtensionIdentifier:(id)arg2 documentURL:(id)arg3; +- (void)setStateSavingDefaultPersistentRepresentations:(id)arg1; +- (id)stateSavingDefaultPersistentRepresentations; +- (id)_editorContexts; +- (void)_openEditorOpenSpecifier:(id)arg1 editorContext:(id)arg2 takeFocus:(BOOL)arg3; +- (void)_openEditorHistoryItem:(id)arg1 editorContext:(id)arg2 takeFocus:(BOOL)arg3; +@property(readonly) IDENavigableItemArchivableRepresentation *selectedNavigableItemArchivedRepresentation; +@property(readonly) IDEEditorDocument *navigationTargetedEditorDocument; +@property(readonly) IDEEditorDocument *primaryEditorDocument; +@property(readonly) IDEEditorContext *primaryEditorContext; +- (void)_installDebugAreaWithExtensionID:(id)arg1 revertDebugAreaState:(BOOL)arg2; +- (void)installDebugAreaWithExtensionID:(id)arg1; +- (void)installNewDefaultDebugAreaWithExtensionID:(id)arg1; +- (void)_installDefaultDebugAreaAndRevertDebugAreaState:(BOOL)arg1; +- (void)installDefaultDebugArea; +- (void)_setEditorMode:(int)arg1; +- (void)editorContextWasRemoved:(id)arg1; +- (void)editorContextDidBecomeLastActiveEditor:(id)arg1; +- (void)viewWillUninstall; +- (void)viewDidInstall; +- (void)_refreshEditorContextsAndPreserveCurrentEditorHistoryStack:(BOOL)arg1; +- (void)_resetEditor; +- (BOOL)_canResetEditor; +- (void)_removeAssistantEditor; +- (BOOL)_canRemoveAssistantEditor; +- (id)_addNewAssistantEditor; +- (BOOL)_canAddNewAssistantEditor; +- (void)_addAssistantEditor; +- (BOOL)_canAddAssistantEditor; +- (void)_setAssistantEditorsLayout:(int)arg1; +- (BOOL)_canChangeAssistantEditorsLayout; +- (void)primitiveInvalidate; +- (void)_updateDebugAreaAfterDocumentOpened; +- (void)_updateDebugBarAfterDocumentOpened; +- (void)loadView; +- (void)_setEditorModeViewControllerWithPrimaryEditorContext:(id)arg1; + +// Remaining properties +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) Class superclass; + +@end + diff --git a/SCXcodeMinimap/Xcode Headers/IDEEditorContext.h b/SCXcodeMinimap/Xcode Headers/IDEEditorContext.h new file mode 100644 index 0000000..f4033b7 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEEditorContext.h @@ -0,0 +1,339 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +#import "IDEViewController.h" + +@class CALayer, DVTBindingToken, DVTBorderedView, DVTFileDataType, DVTFindBar, DVTGradientImagePopUpButton, DVTNotificationToken, DVTObservingToken, DVTScopeBarsManager, DVTStackBacktrace, DVTStateRepository, IDEEditor, IDEEditorArea, IDEEditorGeniusResults, IDEEditorHistoryController, IDEEditorHistoryItem, IDEEditorIssueMenuController, IDEEditorMultipleContext, IDEEditorReadOnlyIndicatorController, IDEEditorSplittingController, IDEEditorStepperView, IDENavBar, IDENavigableItem, IDENavigableItemCoordinator, NSArray, NSArrayController, NSDictionary, NSIndexSet, NSMutableArray, NSScrollView, NSString, NSURL, NSView, _IDEGeniusResultsContext; + +@interface IDEEditorContext : IDEViewController +{ + NSView *_editorAndNavBarView; + IDENavBar *_navBar; + DVTBorderedView *_editorBorderedView; + DVTGradientImagePopUpButton *_relatedItemsPopUpButton; + IDEEditorStepperView *_stepperView; + DVTStateRepository *_stateRepository; + IDENavigableItem *_greatestDocumentAncestor; + DVTFileDataType *_cacheFromNavigation_greatestDocumentAncestorFileDataType; + NSArray *_documentSelectedItems; + DVTNotificationToken *_editorContextWillOpenNavigableItemNotificationToken; + DVTNotificationToken *_editorDocumentForNavBarStructureDidChangeNotificationToken; + DVTNotificationToken *_editorDocumentForNavBarStructureWillCloseNotificationToken; + DVTNotificationToken *_editorDocumentIsEditedStatusDidChangeNotificationToken; + DVTNotificationToken *_editorDocumentWillCloseNotificationToken; + DVTNotificationToken *_findStringChangedNotificationToken; + DVTNotificationToken *_navigableItemPropertyObserver; + DVTNotificationToken *_navigableItemCoordinatorDidForgetItemsNotificationToken; + DVTNotificationToken *_workspaceWillWriteNotificationToken; + DVTObservingToken *_editorDocumentForNavBarStructureChangedObservingToken; + DVTObservingToken *_windowMainViewControllerChangedObservingToken; + DVTNotificationToken *_windowDidBecomeKeyObserverToken; + DVTObservingToken *_lastActiveEditorContextChangedObservingToken; + DVTObservingToken *_currentSelectedItemsObservingToken; + id _deferredUpdateSubDocumentNavigableItemsCancellableToken; + DVTBindingToken *_navBarNavigableItemRootChildItemsBindingToken; + DVTBindingToken *_navBarNavigableItemBindingToken; + IDENavigableItem *_geniusResultsRootNavigableItem; + DVTObservingToken *_counterpartsObservingToken; + IDEEditorHistoryController *_historyController; + NSArrayController *_navigableItemSiblingsController; + IDEEditorReadOnlyIndicatorController *_readOnlyIndicatorController; + DVTObservingToken *_showReadOnlyIndicatorObserver; + DVTFindBar *_findBar; + NSDictionary *_editorStateDictionaryPreviousToFind; + IDEEditorIssueMenuController *_issueMenuController; + DVTObservingToken *_showIssueMenuControllerObserver; + IDEEditorSplittingController *_splittingController; + DVTObservingToken *_workspaceLoadingObservingToken; + IDEEditorHistoryItem *_beforeUninstallHistoryItem; + NSString *_emptyContentString; + NSMutableArray *_commandExtensions; + DVTStackBacktrace *_beganChangingNavigableItemBacktrace; + BOOL _changingNavBarNavigableItem; + BOOL _isPrimaryEditorContext; + BOOL _viewIsInstalled; + BOOL _shouldObserveDocumentChanges; + BOOL _editorProvidesPathCellMenuItems; + BOOL _isPerformingStateRestoration; + BOOL _isReplacingClosedDocument; + BOOL _isDraggingPathCell; + BOOL _isFetchingCurrentSelectedItems; + BOOL _shouldImmediatleyProcessCurrentSelectedItemsChange; + unsigned long long _currentSwipeAnimationGeneration; + char *_swipeAnimationAborted; + BOOL _disableGeniusResultUpdatesDuringSwipeAnimation; + NSView *_swipeLayerView; + CALayer *_swipeBackgroundLayer; + CALayer *_swipeForegroundLayer; + dispatch_block_t _swipeCompletionBlock; + NSDictionary *_editorStateDictionaryPreviousToSwipe; + BOOL _showRelatedItemsControl; + BOOL _showNavBarHistoryStepperControls; + BOOL _showSiblingStepperControl; + BOOL _showMiniIssueNavigator; + BOOL _showSplittingControls; + BOOL _canAddSplit; + BOOL _canRemoveSplit; + BOOL _hideWorkspaceLoadingProgressIndicator; + int _borderSides; + IDEEditorArea *_editorArea; + IDEEditor *_editor; + id _delegate; + IDENavigableItemCoordinator *_navigableItemCoordinator; + IDENavigableItem *_navigableItem; + NSArray *_defaultEditorCategories; + NSArray *_validEditorCategories; + DVTScopeBarsManager *_scopeBarsManager; + NSURL *_originalRequestedDocumentURL; + IDEEditorGeniusResults *_editorGeniusResults; + NSString *_documentExtensionIdentifier; + IDEEditorMultipleContext *_multipleContext; + _IDEGeniusResultsContext *_geniusResultsContext; + IDENavigableItem *_navBarNavigableItem; + IDENavigableItem *_navBarNavigableItemRoot; + NSArray *_navigableItemSiblings; + NSIndexSet *_navigableItemSiblingsSelectionIndexes; + dispatch_block_t _retryOpenOperationBlock; +} + ++ (id)_titleForNavigationUserInterfaceItem:(id)arg1 forEventBehavior:(int)arg2 fromPrimaryEditorContext:(BOOL)arg3; ++ (BOOL)_canEditEditorHistoryItem:(id)arg1 withEditorCategories:(id)arg2; ++ (BOOL)_canEditDocumentURL:(id)arg1 fileDataType:(id)arg2 documentExtensionIdentifier:(id)arg3 withEditorCategories:(id)arg4; ++ (id)_defaultDocumentExtensionForDocumentURL:(id)arg1 fileDataType:(id)arg2 withEditorCategories:(id)arg3; ++ (BOOL)automaticallyNotifiesObserversOfNavBarNavigableItem; ++ (BOOL)automaticallyNotifiesObserversOfNavigableItem; ++ (id)navigationLogAspect; ++ (void)initialize; ++ (BOOL)automaticallyNotifiesObserversOfGreatestDocumentAncestor; ++ (id)keyPathsForValuesAffectingIsLastActiveEditorContext; ++ (id)keyPathsForValuesAffectingValueForNavBarNavigableItemRootChildItems; ++ (id)keyPathsForValuesAffectingValueForOutputSelection; +@property(copy) dispatch_block_t retryOpenOperationBlock; // @synthesize retryOpenOperationBlock=_retryOpenOperationBlock; +@property(readonly) NSIndexSet *navigableItemSiblingsSelectionIndexes; // @synthesize navigableItemSiblingsSelectionIndexes=_navigableItemSiblingsSelectionIndexes; +@property(readonly) NSArray *navigableItemSiblings; // @synthesize navigableItemSiblings=_navigableItemSiblings; +@property(readonly) IDENavigableItem *navBarNavigableItemRoot; // @synthesize navBarNavigableItemRoot=_navBarNavigableItemRoot; +@property(readonly) IDENavigableItem *navBarNavigableItem; // @synthesize navBarNavigableItem=_navBarNavigableItem; +@property(retain) _IDEGeniusResultsContext *geniusResultsContext; // @synthesize geniusResultsContext=_geniusResultsContext; +@property(retain) IDEEditorMultipleContext *multipleContext; // @synthesize multipleContext=_multipleContext; +@property(readonly) NSString *documentExtensionIdentifier; // @synthesize documentExtensionIdentifier=_documentExtensionIdentifier; +@property(readonly) IDEEditorGeniusResults *editorGeniusResults; // @synthesize editorGeniusResults=_editorGeniusResults; +@property(retain) NSURL *originalRequestedDocumentURL; // @synthesize originalRequestedDocumentURL=_originalRequestedDocumentURL; +@property(readonly) DVTScopeBarsManager *scopeBarsManager; // @synthesize scopeBarsManager=_scopeBarsManager; +@property BOOL hideWorkspaceLoadingProgressIndicator; // @synthesize hideWorkspaceLoadingProgressIndicator=_hideWorkspaceLoadingProgressIndicator; +@property(nonatomic) BOOL canRemoveSplit; // @synthesize canRemoveSplit=_canRemoveSplit; +@property(nonatomic) BOOL canAddSplit; // @synthesize canAddSplit=_canAddSplit; +@property(nonatomic) BOOL showSplittingControls; // @synthesize showSplittingControls=_showSplittingControls; +@property(nonatomic) BOOL showMiniIssueNavigator; // @synthesize showMiniIssueNavigator=_showMiniIssueNavigator; +@property(nonatomic) BOOL showSiblingStepperControl; // @synthesize showSiblingStepperControl=_showSiblingStepperControl; +@property(nonatomic) BOOL showNavBarHistoryStepperControls; // @synthesize showNavBarHistoryStepperControls=_showNavBarHistoryStepperControls; +@property(nonatomic) BOOL showRelatedItemsControl; // @synthesize showRelatedItemsControl=_showRelatedItemsControl; +@property(nonatomic) int borderSides; // @synthesize borderSides=_borderSides; +@property(copy) NSArray *validEditorCategories; // @synthesize validEditorCategories=_validEditorCategories; +@property(copy) NSArray *defaultEditorCategories; // @synthesize defaultEditorCategories=_defaultEditorCategories; +@property(retain, nonatomic) IDENavigableItem *navigableItem; // @synthesize navigableItem=_navigableItem; +@property(readonly) IDENavigableItemCoordinator *navigableItemCoordinator; // @synthesize navigableItemCoordinator=_navigableItemCoordinator; +@property(retain) id delegate; // @synthesize delegate=_delegate; +@property(retain, nonatomic) IDEEditor *editor; // @synthesize editor=_editor; +@property(retain, nonatomic) IDEEditorArea *editorArea; // @synthesize editorArea=_editorArea; +- (void)stateRepositoryDidChange:(id)arg1; +- (id)_navigableItemForEditingFromArchivedRepresentation:(id)arg1 error:(id *)arg2; +- (void)discardEditing; +- (BOOL)commitEditingForAction:(int)arg1 errors:(id)arg2; +- (id)scopeBarsManagerForEditor:(id)arg1; +- (void)goBackInHistoryByCommandWithShiftPlusAlternate:(id)arg1; +- (void)goForwardInHistoryByCommandWithShiftPlusAlternate:(id)arg1; +- (void)goBackInHistoryByCommandWithAlternate:(id)arg1; +- (void)goForwardInHistoryByCommandWithAlternate:(id)arg1; +- (void)goBackInHistoryByCommand:(id)arg1; +- (void)goForwardInHistoryByCommand:(id)arg1; +- (void)_setShowNavBarHistoryStepperControls:(BOOL)arg1; +- (void)_setShowRelatedItemsControl:(BOOL)arg1; +- (void)_rebuildRightControlGroup; +- (void)_rebuildLeftControlGroup; +- (void)updateWithHistoryStack:(id)arg1; +- (id)currentHistoryStack; +- (void)_openEditorHistoryItemFromStateSaving:(id)arg1; +- (void)_giveEditorFocusIfNeeded; +- (BOOL)_editorHasFocus; +- (BOOL)_findBarHasFocus; +- (BOOL)_viewHasFocus:(id)arg1; +- (void)takeFocus; +- (id)supplementalMainViewController; +- (BOOL)canBecomeMainViewController; +- (id)viewToShowWrapOrEndOfFileBezelOn:(id)arg1; +- (struct _NSRange)selectedRangeForFindBar:(id)arg1; +- (id)startingLocationForFindBar:(id)arg1 findingBackwards:(BOOL)arg2; +- (void)dvtFindBar:(id)arg1 didUpdateCurrentResult:(id)arg2; +- (void)dvtFindBar:(id)arg1 didUpdateResults:(id)arg2; +- (void)dismissFindBar:(id)arg1 andRestoreSelection:(BOOL)arg2; +- (void)hideFindBar:(id)arg1; +- (void)_hideFindBarAndRestoreSelection:(BOOL)arg1 animate:(BOOL)arg2; +- (void)replaceAndFindPrevious:(id)arg1; +- (void)replaceAndFindNext:(id)arg1; +- (void)replaceAll:(id)arg1; +- (void)replace:(id)arg1; +- (void)findPrevious:(id)arg1; +- (void)findNext:(id)arg1; +- (void)findAndReplace:(id)arg1; +- (void)find:(id)arg1; +- (void)_uninstallFindBar; +- (void)_installFindBar; +- (id)_findScopeBar; +- (id)_findBar; +- (BOOL)dvtFindBar:(id)arg1 validateUserInterfaceItem:(id)arg2; +@property(readonly) NSScrollView *scopeBarsAdjustableScrollView; +@property(readonly) NSView *scopeBarsBaseView; +- (void)primitiveInvalidate; +- (BOOL)validateUserInterfaceItem:(id)arg1; +- (BOOL)_validateOpenInAdjacentEditorCommandForUserInterfaceItem:(id)arg1 forEventBehavior:(int)arg2; +- (void)showMiniIssuesNavigatorMenu:(id)arg1; +- (void)showDocumentItemsMenu:(id)arg1; +- (void)showGroupFilesMenu:(id)arg1; +- (void)showTopLevelItemsMenu:(id)arg1; +- (void)showNextFilesHistoryMenu:(id)arg1; +- (void)showNextHistoryMenu:(id)arg1; +- (void)showPreviousFilesHistoryMenu:(id)arg1; +- (void)showPreviousHistoryMenu:(id)arg1; +- (void)showRelatedItemsMenu:(id)arg1; +- (void)ide_unlockDocument:(id)arg1; +- (void)_popUpMenuForNavigableItem:(id)arg1; +- (void)closeDocument:(id)arg1; +- (BOOL)_canAskDocumentToClose; +- (void)openInAdjacentEditorWithShiftPlusAlternate:(id)arg1; +- (void)openInAdjacentEditorWithAlternate:(id)arg1; +- (void)_openInAdjacentEditorWithEventBehavior:(int)arg1; +- (void)scrollWheel:(id)arg1; +- (void)_moveOverlayToMatchGestureAmount:(double)arg1 imageOfCurrentEditorOnTop:(BOOL)arg2; +- (void)_hideSwipeOverlay; +- (BOOL)_showSwipeOverlayForDirection:(BOOL)arg1 imageOfCurrentEditorOnTop:(char *)arg2; +- (id)_imageOfCurrentEditor; +- (void)_preloadSwipeInfrastructure; +- (struct CGRect)_swipeLayerViewFrame; +- (BOOL)wantsScrollEventsForSwipeTrackingOnAxis:(long long)arg1; +- (void)swipeWithEvent:(id)arg1; +- (void)_swipeToGoForward:(BOOL)arg1; +- (void)jumpToInstructionPointer:(id)arg1; +- (void)fixPreviousIssue:(id)arg1; +- (void)fixNextIssue:(id)arg1; +- (void)jumpToPreviousIssue:(id)arg1; +- (void)jumpToNextIssue:(id)arg1; +- (void)jumpToPreviousCounterpartWithShiftPlusAlternate:(id)arg1; +- (void)jumpToPreviousCounterpartWithAlternate:(id)arg1; +- (void)jumpToPreviousCounterpart:(id)arg1; +- (void)jumpToNextCounterpartWithShiftPlusAlternate:(id)arg1; +- (void)jumpToNextCounterpartWithAlternate:(id)arg1; +- (void)jumpToNextCounterpart:(id)arg1; +- (void)_jumpToCounterpartUp:(BOOL)arg1; +- (BOOL)pathControl:(id)arg1 acceptDrop:(id)arg2; +- (unsigned long long)pathControl:(id)arg1 validateDrop:(id)arg2; +- (id)pathControlPasteboardReadingOptions; +- (unsigned long long)draggingSourceOperationMaskForLocal:(BOOL)arg1; +- (void)pathCell:(id)arg1 didEndDragForComponentCell:(id)arg2; +- (BOOL)pathCell:(id)arg1 beginDragForComponentCell:(id)arg2; +- (id)pathCell:(id)arg1 menuItemForNavigableItem:(id)arg2 defaultMenuItem:(id)arg3; +- (BOOL)pathCell:(id)arg1 shouldEnableSelection:(id)arg2; +- (id)pathCell:(id)arg1 childItemsForItem:(id)arg2; +- (void)pathCell:(id)arg1 didUpdateMenu:(id)arg2; +- (id)_hiddenMenuItemForCommandExtension:(id)arg1; +- (BOOL)pathCell:(id)arg1 shouldInitiallyShowMenuSearch:(id)arg2; +- (BOOL)pathCell:(id)arg1 shouldSeparateDisplayOfChildItemsForItem:(id)arg2; +- (void)_currentSelectedItemsChanged; +- (void)_checkShouldCoalesceUpdatesForCurrentSelectedItemsChanged; +- (BOOL)_isCurrentEventARepeatKeyDownEvent; +- (void)_updateSubDocumentNavigableItems; +- (void)_selectNavigableItem:(id)arg1 updateOutputSelection:(id)arg2; +- (void)removeSplitForSplittingController:(id)arg1; +- (void)addSplitForSplittingController:(id)arg1; +- (void)setEmptyContentString:(id)arg1; +- (struct CGRect)grabRect; +- (void)_setSupportsReadOnlyIndicator:(BOOL)arg1; +- (void)_setCanRemoveSplit:(BOOL)arg1; +- (void)_setCanAddSplit:(BOOL)arg1; +- (void)_setShowSplittingControls:(BOOL)arg1; +- (void)_setShowMiniIssueNavigator:(BOOL)arg1; +- (void)_setShowSiblingStepperControl:(BOOL)arg1; +- (void)_updateSiblingStepperControlVisibility; +- (void)menuNeedsUpdate:(id)arg1; +- (void)_clearRecentEditorDocumentsList:(id)arg1; +- (void)_changeMaximumRecentFilesLimit:(id)arg1; +- (id)_recentEditorDocumentsCapacityPreferenceMenuItem; +- (void)_navigateToRelatedNavigableItem:(id)arg1; +- (void)setNavigableItemSiblingsSelectionIndexes:(NSIndexSet *)arg1; +- (void)_importNavigableItem:(id)arg1; +- (BOOL)_notifyDelegateAndOpenEditorHistoryItem:(id)arg1 previousHistoryItemOrNil:(id)arg2 alwaysReplaceExistingNavigableItem:(BOOL)arg3 skipSubDocumentNavigationUnlessEditorIsReplaced:(BOOL)arg4; +- (BOOL)_notifyDelegateAndOpenEditorHistoryItem:(id)arg1 updateHistory:(BOOL)arg2 skipSubDocumentNavigationUnlessEditorIsReplaced:(BOOL)arg3; +- (BOOL)_notifyDelegateAndOpenEditorOpenSpecifier:(id)arg1 updateHistory:(BOOL)arg2; +- (BOOL)_notifyDelegateAndOpenNavigableItem:(id)arg1 withContentsURL:(id)arg2 documentExtensionIdentifier:(id)arg3 locationToSelect:(id)arg4 annotationRepresentedObject:(id)arg5 stateDictionary:(id)arg6 annotationWantsIndicatorAnimation:(BOOL)arg7 exploreAnnotationRepresentedObject:(id)arg8 highlightSelection:(BOOL)arg9 alwaysReplaceExistingNavigableItem:(BOOL)arg10 skipSubDocumentNavigationUnlessEditorIsReplaced:(BOOL)arg11; +- (BOOL)_canEditEditorHistoryItem:(id)arg1; +- (BOOL)_canEditEditorOpenSpecifier:(id)arg1; +- (BOOL)_canEditEditorOpenSpecifier:(id)arg1 withEditorCategories:(id)arg2; +- (void)_applyEditorStateDictionary:(id)arg1 forDocumentExtensionIdentifier:(id)arg2 atDocumentURLToCurrentEditor:(id)arg3; +- (int)_openNavigableItem:(id)arg1 documentExtension:(id)arg2 document:(id)arg3 shouldInstallEditorBlock:(dispatch_block_t)arg4; +- (int)_openNavigableItem:(id)arg1 withContentsOfURL:(id)arg2 documentExtension:(id)arg3 shouldInstallEditorBlock:(dispatch_block_t)arg4; +- (id)_newEditorDocumentWithClass:(Class)arg1 forURL:(id)arg2 withContentsOfURL:(id)arg3 ofType:(id)arg4 extension:(id)arg5 error:(id *)arg6; +- (int)_openNavigableItem:(id)arg1 withContentsOfURL:(id)arg2 shouldInstallEditorBlock:(dispatch_block_t)arg3; +- (id)_defaultDocumentExtensionForNavigableItem:(id)arg1; +- (void)_navigateAwayFromCurrentDocumentWithURL:(id)arg1; +- (BOOL)openEditorHistoryItem:(id)arg1; +- (BOOL)openEditorOpenSpecifier:(id)arg1; +- (BOOL)_openEditorOpenSpecifier:(id)arg1 updateHistory:(BOOL)arg2; +- (BOOL)_openEditorHistoryItem:(id)arg1 previousHistoryItemOrNil:(id)arg2 alwaysReplaceExistingNavigableItem:(BOOL)arg3 skipSubDocumentNavigationUnlessEditorIsReplaced:(BOOL)arg4; +- (void)_navigableItemChanged; +- (BOOL)_openEditorHistoryItem:(id)arg1 updateHistory:(BOOL)arg2; +- (BOOL)_openEmptyEditor; +- (void)_teardownDocumentNotifications; +- (void)_registerForDocumentNotificationsForDocument:(id)arg1; +- (void)_navigateAwayFromDocument:(id)arg1 historyItem:(id)arg2; +- (void)_updateNavBarNavigableItemForNavItem:(id)arg1; +- (void)_setEmptyRootNavigableItem; +- (void)_clearWorkspaceloadingObservation; +- (void)_primitiveSetNavBarRootNavigableItem:(id)arg1 selectedNavigableItem:(id)arg2; +- (void)setNavBarNavigableItem:(IDENavigableItem *)arg1; +- (id)currentHistoryItemWithImageOfCurrentEditor; +- (id)currentHistoryItem; +- (id)_currentSelectedDocumentLocations; +- (void)_updateSiblingInfoFromNavigableItem; +- (void)_performBlockInsideReentrantGuard:(dispatch_block_t)arg1; +- (BOOL)_canChangeNavigableItem; +- (void)setupNewEditor:(id)arg1; +- (void)_mainViewControllerChanged; +- (void)_removeFromLastActiveEditorContexts; +- (void)_syncGradientStyleForJumpBarControls; +@property(readonly, getter=isPrimaryEditorContext) BOOL primaryEditorContext; +- (BOOL)isLastActiveEditorContext; +- (void)viewWillUninstall; +- (void)viewDidInstall; +- (BOOL)_enableJumpToCounterpartMenuItems; +- (id)_jumpToCounterpartsCategoryNavigableItem; +- (void)_setEditorGeniusResultsGenerationEnabled:(BOOL)arg1; +- (BOOL)_editorGeniusResultsGenerationEnabled; +- (void)_writeCurrentStateToLastUsedDictionaryIfNeeded; +- (id)_defaultEditorStateDictionaryForDocumentExtensionIdentifier:(id)arg1 forDocumentURL:(id)arg2; +- (id)navigableItemCoordinator:(id)arg1 editorDocumentForNavigableItem:(id)arg2; +- (void)_greatestDocumentAncestorWasForgotten; +- (id)willPresentError:(id)arg1; +- (BOOL)presentError:(id)arg1; +- (void)presentError:(id)arg1 modalForWindow:(id)arg2 delegate:(id)arg3 didPresentSelector:(SEL)arg4 contextInfo:(void *)arg5; +- (id)workspace; +- (void)loadView; +- (void)_setEditorView; +- (id)initWithNibName:(id)arg1 bundle:(id)arg2; +- (void)_adjustSubviewBorders; +- (void)setGreatestDocumentAncestor:(IDENavigableItem *)arg1; +@property(readonly) IDENavigableItem *greatestDocumentAncestor; +- (id)navBarNavigableItemRootChildItems; +- (void)setOutputSelection:(id)arg1; +- (id)outputSelection; +- (id)_generateNodeAndAddMappingToWorkspaceTabControllerLayoutTree:(id)arg1; + +// Remaining properties +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) Class superclass; + +@end + diff --git a/SCXcodeMinimap/Xcode Headers/IDEEditorModeViewController.h b/SCXcodeMinimap/Xcode Headers/IDEEditorModeViewController.h new file mode 100644 index 0000000..95fc391 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEEditorModeViewController.h @@ -0,0 +1,67 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +#import "IDEViewController.h" + +@class DVTStateToken, IDEEditorArea, IDEEditorContext, NSDictionary; + +@interface IDEEditorModeViewController : IDEViewController +{ + IDEEditorContext *_primaryEditorContext; + IDEEditorContext *_selectedAlternateEditorContext; + NSDictionary *_lastSetEditorLayoutConfiguration; + NSDictionary *_lastSetPersistentRepresentation; + IDEEditorArea *_editorArea; +} + ++ (long long)version; ++ (void)configureStateSavingObjectPersistenceByName:(id)arg1; ++ (id)stateSavingIdentifiers; +@property(retain) IDEEditorContext *selectedAlternateEditorContext; // @synthesize selectedAlternateEditorContext=_selectedAlternateEditorContext; +@property(retain, nonatomic) IDEEditorContext *primaryEditorContext; // @synthesize primaryEditorContext=_primaryEditorContext; +@property(retain, nonatomic) IDEEditorArea *editorArea; // @synthesize editorArea=_editorArea; + +- (void)editorContext:(id)arg1 editorStateRepositoryDidChange:(id)arg2; +- (void)commitStateToDictionary:(id)arg1; +- (void)revertStateWithDictionary:(id)arg1; +- (void)_setPersistentRepresentation:(id)arg1 forIdentifier:(id)arg2; +- (id)_persistentRepresentationForIdentifier:(id)arg1; +- (void)_setPersistentRepresentation:(id)arg1; +- (id)_persistentRepresentation; +- (void)_stampEditorLayoutConfiguration:(id)arg1 forIdentifier:(id)arg2; +- (id)_liftEditorLayoutConfigurationForIdentifier:(id)arg1; +- (void)_stampEditorLayoutConfiguration:(id)arg1; +- (id)_liftEditorLayoutConfiguration; +- (BOOL)_getStateSavingStateDictionaries:(id *)arg1 selected:(id *)arg2 geometry:(id *)arg3 forPersistentRepresentation:(id)arg4; +- (id)_persistentRepresentationForStateSavingStateDictionaries:(id)arg1 selected:(id)arg2 geometry:(id)arg3; +- (BOOL)_getEditorHistoryStacks:(id *)arg1 selected:(id *)arg2 geometry:(id *)arg3 forEditorLayoutConfiguration:(id)arg4; +- (id)_editorLayoutConfigurationForEditorHistoryStacks:(id)arg1 selected:(id)arg2 geometry:(id)arg3; +- (BOOL)_getItems:(id *)arg1 itemsKey:(id)arg2 selected:(id *)arg3 geometry:(id *)arg4 inConfigurationDictionary:(id)arg5; +- (id)_configurationDictionaryWithItems:(id)arg1 itemsKey:(id)arg2 selected:(id)arg3 geometry:(id)arg4; +- (void)primitiveInvalidate; +- (id)_stealPrimaryEditorContext; +- (id)editorContexts; +- (BOOL)openEditorOpenSpecifier:(id)arg1 editorContext:(id)arg2; +- (BOOL)openEditorHistoryItem:(id)arg1 editorContext:(id)arg2; +@property(readonly) struct CGSize minimumContentViewFrameSize; +- (BOOL)canCreateSplitForNavigationHUD; +- (void)resetEditor; +- (BOOL)canResetEditor; +- (void)removeAssistantEditor; +- (id)addNewAssistantEditor; +- (BOOL)canAddNewAssistantEditor; +- (BOOL)canRemoveAssistantEditor; +- (void)addAssistantEditor; +- (BOOL)canAddAssistantEditor; +- (void)setAssistantEditorsLayout:(int)arg1; +- (BOOL)canChangeAssistantEditorsLayout; +- (id)_initWithPrimaryEditorContext:(id)arg1; + +// Remaining properties +@property(retain) DVTStateToken *stateToken; // @dynamic stateToken; + +@end + diff --git a/SCXcodeMinimap/Xcode Headers/IDESourceCodeComparisonEditor.h b/SCXcodeMinimap/Xcode Headers/IDESourceCodeComparisonEditor.h new file mode 100644 index 0000000..b3230c4 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDESourceCodeComparisonEditor.h @@ -0,0 +1,44 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +#import "IDEComparisonEditor.h" + +@class DVTSourceTextView, NSDictionary, NSString; + +@interface IDESourceCodeComparisonEditor : IDEComparisonEditor +{ + NSDictionary *_previouslyRestoredStateDictionary; +} + ++ (long long)version; ++ (void)configureStateSavingObjectPersistenceByName:(id)arg1; ++ (id)keyPathsForValuesAffectingKeyTextView; ++ (unsigned long long)assertionBehaviorAfterEndOfEventForSelector:(SEL)arg1; +- (void)find:(id)arg1; +- (id)currentEditorContext; +- (id)documentLocationForOpenQuicklyQuery:(id)arg1; +- (id)startingLocationForFindBar:(id)arg1 findingBackwards:(BOOL)arg2; +- (void)dvtFindBar:(id)arg1 didUpdateCurrentResult:(id)arg2; +- (void)dvtFindBar:(id)arg1 didUpdateResults:(id)arg2; +- (void)revertStateWithDictionary:(id)arg1; +- (void)restoreInternalComparisonDocumentLocationWithStateDictionary:(id)arg1; +- (void)commitStateToDictionary:(id)arg1; +- (void)setEditorSubmode:(int)arg1; +@property(readonly) DVTSourceTextView *keyTextView; +- (void)_updateViewBasedOnSubmode; +- (struct CGRect)overlayFrameForView:(id)arg1; +- (id)pathCell:(id)arg1 menuItemForNavigableItem:(id)arg2 defaultMenuItem:(id)arg3; +- (BOOL)pathCell:(id)arg1 shouldInitiallyShowMenuSearch:(id)arg2; +- (BOOL)pathCell:(id)arg1 shouldSeparateDisplayOfChildItemsForItem:(id)arg2; + +// Remaining properties +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) Class superclass; + +@end + diff --git a/SCXcodeMinimap/Xcode Headers/IDEWorkspaceTabController.h b/SCXcodeMinimap/Xcode Headers/IDEWorkspaceTabController.h new file mode 100644 index 0000000..e495f18 --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEWorkspaceTabController.h @@ -0,0 +1,338 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +#import "IDEViewController.h" + +@class DVTFilePath, DVTMutableOrderedSet, DVTNotificationToken, DVTObservingToken, DVTReplacementView, DVTSplitView, DVTSplitViewItem, IDEARCConversionAssistantContext, IDEAppChooserWindowController, IDEBuildAlertMonitor, IDEEditorArea, IDEExecutionHoldAlertHelper, IDELaunchSession, IDENavigatorArea, IDEObjCModernizationAssistantContext, IDERunAlertMonitor, IDESwiftMigrationAssistantContext, IDEUnitTestsModernizationAssistantContext, IDEWorkspace, IDEWorkspaceDocument, IDEWorkspaceWindowController, NSAlert, NSDocument, NSMapTable, NSMutableArray, NSString; + +@interface IDEWorkspaceTabController : IDEViewController +{ + DVTSplitView *_designAreaSplitView; + DVTReplacementView *_navReplacementView; + DVTSplitView *_utilityAreaSplitView; + DVTSplitViewItem *_navigatorAreaSplitViewItem; + DVTSplitViewItem *_utilitiesAreaSplitViewItem; + DVTReplacementView *_inspectorReplacementView; + DVTReplacementView *_libraryReplacementView; + DVTMutableOrderedSet *_cursorRectInterceptors; + NSMapTable *_additionControllersForLaunchSessionTable; + NSMutableArray *_debuggingUIControllerLifeCycleObservers; + NSString *_userDefinedTabLabel; + NSString *_lastValidUserDefinedName; + NSMapTable *_observerTokenForLaunchSessionTable; + NSMapTable *_observerTokenForLaunchSessionsDebuggingAdditionsTable; + NSMutableArray *_uiControllerObserverEntries; + DVTObservingToken *_mainCurrentLaunchSessionObserverToken; + DVTObservingToken *_currentLaunchSessionStateObserverToken; + DVTObservingToken *_launchSessionAlertErrorObservingToken; + DVTObservingToken *_debugSessionObserverToken; + DVTObservingToken *_debugSessionCoalescedStateObservingToken; + DVTObservingToken *_firstTimeSnapshotObserverToken; + DVTNotificationToken *_codesignFailureObserver; + NSAlert *_stoppingExecutionAlert; + id _pendingExecutionNotificationToken; + IDEBuildAlertMonitor *_buildAlertMonitor; + IDERunAlertMonitor *_runAlertMonitor; + IDEARCConversionAssistantContext *_conversionAssistantContext; + IDEObjCModernizationAssistantContext *_objcModernizationAssistantContext; + IDEUnitTestsModernizationAssistantContext *_unitTestsModernizationAssistantContext; + IDESwiftMigrationAssistantContext *_swiftMigrationAssistantContext; + BOOL _userWantsUtilitiesVisible; + BOOL _userWantsNavigatorVisible; + BOOL _isAnimatingUtilities; + BOOL _tabLoadingCompleted; + BOOL _stateRestoreCompleted; + int _assistantEditorsLayout; + IDEWorkspaceDocument *_workspaceDocument; + NSString *_name; + IDELaunchSession *_currentLaunchSession; + DVTReplacementView *_editorReplacementView; + DVTObservingToken *_documentLoadingObservationToken; + DVTObservingToken *_firstIssueObservationToken; + DVTObservingToken *_buildCompleteObservationToken; + NSString *_savedTabLabel; + DVTFilePath *_savedTabFilePath; + IDEAppChooserWindowController *_appChooserWindowController; + IDEExecutionHoldAlertHelper *_executionHoldAlertHelper; +} + ++ (id)keyPathsForValuesAffectingTabLabel; ++ (void)initialize; ++ (id)keyPathsForValuesAffectingEditorArea; ++ (id)keyPathsForValuesAffectingNavigatorArea; ++ (id)keyPathsForValuesAffectingWindowController; ++ (id)keyPathsForValuesAffectingShowNavigator; ++ (id)keyPathsForValuesAffectingShowUtilities; ++ (id)keyPathsForValuesAffectingWorkspace; ++ (BOOL)automaticallyNotifiesObserversOfCurrentLaunchSession; ++ (long long)version; ++ (void)configureStateSavingObjectPersistenceByName:(id)arg1; ++ (int)defaultAssistantEditorsLayout; ++ (void)setDefaultAssistantEditorsLayout:(int)arg1; ++ (BOOL)automaticallyNotifiesObserversOfSavedTabFilePath; ++ (BOOL)automaticallyNotifiesObserversOfSavedTabLabel; +@property(retain) IDEExecutionHoldAlertHelper *executionHoldAlertHelper; // @synthesize executionHoldAlertHelper=_executionHoldAlertHelper; +@property(retain) IDEAppChooserWindowController *appChooserWindowController; // @synthesize appChooserWindowController=_appChooserWindowController; +@property(retain, nonatomic) DVTFilePath *savedTabFilePath; // @synthesize savedTabFilePath=_savedTabFilePath; +@property(copy, nonatomic) NSString *savedTabLabel; // @synthesize savedTabLabel=_savedTabLabel; +@property(retain) DVTObservingToken *buildCompleteObservationToken; // @synthesize buildCompleteObservationToken=_buildCompleteObservationToken; +@property(retain) DVTObservingToken *firstIssueObservationToken; // @synthesize firstIssueObservationToken=_firstIssueObservationToken; +@property(retain) DVTObservingToken *documentLoadingObservationToken; // @synthesize documentLoadingObservationToken=_documentLoadingObservationToken; +@property BOOL stateRestoreCompleted; // @synthesize stateRestoreCompleted=_stateRestoreCompleted; +@property(retain) DVTReplacementView *editorReplacementView; // @synthesize editorReplacementView=_editorReplacementView; +@property(nonatomic) BOOL tabLoadingCompleted; // @synthesize tabLoadingCompleted=_tabLoadingCompleted; +@property(nonatomic) int assistantEditorsLayout; // @synthesize assistantEditorsLayout=_assistantEditorsLayout; +@property(retain, nonatomic) IDELaunchSession *currentLaunchSession; // @synthesize currentLaunchSession=_currentLaunchSession; +@property(copy) NSString *name; // @synthesize name=_name; +@property BOOL isAnimatingUtilities; // @synthesize isAnimatingUtilities=_isAnimatingUtilities; +@property(nonatomic) BOOL userWantsNavigatorVisible; // @synthesize userWantsNavigatorVisible=_userWantsNavigatorVisible; +@property(nonatomic) BOOL userWantsUtilitiesVisible; // @synthesize userWantsUtilitiesVisible=_userWantsUtilitiesVisible; +@property(retain) DVTReplacementView *navigatorReplacementView; // @synthesize navigatorReplacementView=_navReplacementView; +@property(copy) NSString *userDefinedTabLabel; // @synthesize userDefinedTabLabel=_userDefinedTabLabel; +@property(retain) IDEWorkspaceDocument *workspaceDocument; // @synthesize workspaceDocument=_workspaceDocument; +- (void)discardEditing; +- (BOOL)commitEditingForAction:(int)arg1 errors:(id)arg2; +@property(readonly) DVTFilePath *tabFilePath; +@property(readonly) NSString *tabLabel; +@property(retain) NSDocument *document; +- (void)codesignFailureNotification:(id)arg1 continuationBlock:(dispatch_block_t)arg2; +- (id)_codesigningInfoDelegateProvider; +- (void)moveKeyboardFocusToPreviousArea:(id)arg1; +- (void)moveKeyboardFocusToNextArea:(id)arg1; +- (void)_moveKeyboardFocusToNextAreaForward:(BOOL)arg1; +- (id)_keyboardFocusAreas; +- (id)_currentFirstResponderArea; +- (void)performCloseWorkspace:(id)arg1; +- (void)_workspaceDocument:(id)arg1 shouldClose:(BOOL)arg2 contextInfo:(void *)arg3; +- (void)setShowDisassemblyWhenDebugging:(id)arg1; +- (void)reloadConsole:(id)arg1; +- (void)clearConsole:(id)arg1; +- (void)viewMemory:(id)arg1; +- (void)_swiftMigrationFoundErrorsAlertDidEnd:(id)arg1 returnCode:(long long)arg2 contextInfo:(void *)arg3; +- (void)showSwiftMigrationAssistant:(id)arg1; +- (void)_unitTestsModernizationFoundErrorsAlertDidEnd:(id)arg1 returnCode:(long long)arg2 contextInfo:(void *)arg3; +- (void)showModernUnitTestsConversionAssistant:(id)arg1; +- (void)_objCModernizationFoundErrorsAlertDidEnd:(id)arg1 returnCode:(long long)arg2 contextInfo:(void *)arg3; +- (void)showModernObjectiveCConversionAssistant:(id)arg1; +- (void)showARCConversionAssistant:(id)arg1; +- (void)showSharedLibrariesPopUp:(id)arg1; +- (void)attachByPIDOrName:(id)arg1; +- (void)attachToProcess:(id)arg1; +- (void)backgroundFetchEvent:(id)arg1; +- (void)stepOut:(id)arg1; +- (void)stepOverInstruction:(id)arg1; +- (void)stepOverThread:(id)arg1; +- (void)stepOver:(id)arg1; +- (void)stepIntoInstruction:(id)arg1; +- (void)stepIntoThread:(id)arg1; +- (void)stepInto:(id)arg1; +- (void)detach:(id)arg1; +- (void)pauseOrContinue:(id)arg1; +- (void)toggleBreakpoints:(id)arg1; +- (void)createTestFailureBreakpoint:(id)arg1; +- (void)createSymbolicBreakpoint:(id)arg1; +- (void)createExceptionBreakpoint:(id)arg1; +- (void)restoreSnapshot:(id)arg1; +- (void)createSnapshot:(id)arg1; +- (void)editWorkspaceUserSettings:(id)arg1; +- (void)newRunContext:(id)arg1; +- (void)takeScreenshot:(id)arg1; +- (void)createBot:(id)arg1; +- (void)manageRunContexts:(id)arg1; +- (void)selectPreviousDestination:(id)arg1; +- (void)selectNextDestination:(id)arg1; +- (void)selectPreviousRunContext:(id)arg1; +- (void)selectNextRunContext:(id)arg1; +- (dispatch_block_t)_prevIndex; +- (dispatch_block_t)_nextIndex; +- (void)_selectDestination:(dispatch_block_t)arg1; +- (void)_selectRunContext:(dispatch_block_t)arg1; +- (void)editActiveRunContext:(id)arg1; +- (void)editAndAnalyzeActiveRunContext:(id)arg1; +- (void)editBuildAndIntegrateActiveRunContext:(id)arg1; +- (void)editBuildAndArchiveActiveRunContext:(id)arg1; +- (void)editAndBuildForTestingActiveRunContext:(id)arg1; +- (void)editAndTestActiveRunContext:(id)arg1; +- (void)editAndBuildForProfilingActiveScheme:(id)arg1; +- (void)editAndProfileActiveScheme:(id)arg1; +- (void)editAndBuildForRunningActiveRunContext:(id)arg1; +- (void)editAndRunActiveRunContext:(id)arg1; +- (void)_doCommandForEditAndSchemeCommand:(id)arg1; +- (void)_doCommandForEditAndSchemeCommand:(id)arg1 schemeTask:(int)arg2; +- (void)showAppChooserIfNecessaryForScheme:(id)arg1 runDestination:(id)arg2 command:(id)arg3 onCompletion:(dispatch_block_t)arg4; +- (BOOL)_shouldShowAppChooserForScheme:(id)arg1 command:(id)arg2; +- (void)_showAppChooserForCurrentSchemeIfNecessaryForCommand:(id)arg1 launch:(dispatch_block_t)arg2; +- (void)showModalAlertForScheme:(id)arg1; +- (void)runWithoutBuildingForSchemeIdentifier:(id)arg1 runDestination:(id)arg2 invocationRecord:(id)arg3; +- (void)compileFileAtPath:(id)arg1 forSchemeCommand:(id)arg2; +- (void)analyzeFileAtPath:(id)arg1; +- (void)generateAssemblyCodeForFilePath:(id)arg1 forSchemeCommand:(id)arg2; +- (void)generatePreprocessedFileForFilePath:(id)arg1 forSchemeCommand:(id)arg2; +- (void)cleanBuildFolder:(id)arg1; +- (void)reallyCleanBuildFolder; +- (void)cleanActiveRunContext:(id)arg1; +- (void)installActiveRunContext:(id)arg1; +- (void)analyzeActiveRunContext:(id)arg1; +- (void)buildAndRunToGenerateOptimizationProfileActiveRunContext:(id)arg1; +- (void)buildForInstallActiveRunContext:(id)arg1; +- (void)buildAndIntegrateActiveRunContext:(id)arg1; +- (void)buildAndArchiveActiveRunContext:(id)arg1; +- (void)buildActiveRunContext:(id)arg1; +- (void)testActiveRunContextWithoutBuilding:(id)arg1; +- (void)buildForTestActiveRunContext:(id)arg1; +- (void)profileUsingActiveRunContextWithOverridingTestingSpecifiers:(id)arg1; +- (void)testUsingActiveRunContextWithOverridingTestingSpecifiers:(id)arg1; +- (void)testActiveRunContext:(id)arg1; +- (void)profileActiveSchemeWithoutBuilding:(id)arg1; +- (void)buildForProfileActiveRunContext:(id)arg1; +- (void)profileActiveScheme:(id)arg1; +- (void)runActiveRunContextWithoutBuilding:(id)arg1; +- (void)_runWithoutBuildingForScheme:(id)arg1 runDestination:(id)arg2 invocationRecord:(id)arg3; +- (void)buildForRunActiveRunContext:(id)arg1; +- (void)_alertNonExistentWorkingDirectoryBeforeRunOrProfileForContext:(id)arg1 workingDirectory:(id)arg2 title:(id)arg3 defaultButton:(id)arg4 usingBlock:(dispatch_block_t)arg5; +- (void)_alertNonExistentWorkingDirectoryBeforeProfileForContext:(id)arg1 usingBlock:(dispatch_block_t)arg2; +- (void)_alertNonExistentWorkingDirectoryBeforeRunForContext:(id)arg1 usingBlock:(dispatch_block_t)arg2; +- (void)_askShouldBuildBeforeRunOrProfileForContext:(id)arg1 title:(id)arg2 defaultButton:(id)arg3 usingBlock:(dispatch_block_t)arg4; +- (void)runActiveRunContext:(id)arg1; +- (void)_runScheme:(id)arg1 runDestination:(id)arg2 invocationRecord:(id)arg3; +- (BOOL)_needToSwitchSchemeActionToLLDB:(id)arg1; +- (BOOL)textView:(id)arg1 clickedOnLink:(id)arg2 atIndex:(unsigned long long)arg3; +- (void)_silentlySwitchToLLDBIfNecessary:(id)arg1; +- (void)_performDebuggableSchemeTask:(int)arg1 onScheme:(id)arg2 runDestination:(id)arg3 command:(id)arg4 commandName:(id)arg5 buildCommand:(int)arg6 filePath:(id)arg7 overridingTestingSpecifiers:(id)arg8 invocationRecord:(id)arg9 completionBlock:(dispatch_block_t)arg10; +- (void)_debugSessionCoalescedStateChanged:(id)arg1 forDebugSession:(id)arg2; +- (BOOL)isActiveWorkspaceTabController; +- (id)debuggingAdditionUIControllersForLaunchSession:(id)arg1; +- (id)currentDebuggingAdditionUIControllers; +- (id)debugSessionController; +- (BOOL)_contentSizeCanBeZeroSize; +- (void)_performContextTask:(int)arg1 command:(id)arg2 commandName:(id)arg3 buildCommand:(int)arg4 filePath:(id)arg5 invocationRecord:(id)arg6 completionBlock:(dispatch_block_t)arg7; +- (void)_performSchemeTask:(int)arg1 onScheme:(id)arg2 runDestination:(id)arg3 command:(id)arg4 commandName:(id)arg5 buildCommand:(int)arg6 filePath:(id)arg7 overridingTestingSpecifiers:(id)arg8 invocationRecord:(id)arg9 completionBlock:(dispatch_block_t)arg10; +- (BOOL)_launchingOrProfiling:(int)arg1 withNonExistentWorkingDirectory:(id)arg2; +- (void)_showWarningForBuild:(BOOL)arg1 forTest:(BOOL)arg2 forOtherExecution:(BOOL)arg3 trackersToStop:(id)arg4 taskActionBlock:(dispatch_block_t)arg5; +- (void)_runAnotherInstance:(id)arg1; +- (void)_acceptStoppingExecutionAlert:(id)arg1; +- (void)_rejectStoppingExecutionAlert:(id)arg1; +- (void)_cleanupAfterStoppingExecutionAlert; +- (void)_actuallyPerformSchemeTask:(int)arg1 onScheme:(id)arg2 runDestination:(id)arg3 command:(id)arg4 commandName:(id)arg5 buildCommand:(int)arg6 filePath:(id)arg7 overridingTestingSpecifiers:(id)arg8 invocationRecord:(id)arg9 completionBlock:(dispatch_block_t)arg10; +- (void)invalidateAllBuildAlertMonitors; +- (BOOL)_cleanBuildFolderWithExecutionContext:(id)arg1 commandName:(id)arg2 error:(id *)arg3; +- (void)observeBuildOperationForRestoringState:(id)arg1; +- (void)switchNavigatorOnBuild; +- (void)_newWindow:(id)arg1; +- (void)hideUtilitiesArea:(id)arg1; +- (void)showUtilitiesArea:(id)arg1; +- (BOOL)isUtilitiesAreaVisible; +- (void)toggleUtilitiesVisibilityAlternate:(id)arg1; +- (void)toggleUtilitiesVisibility:(id)arg1; +- (void)hideNavigator:(id)arg1; +- (BOOL)isNavigatorVisible; +- (void)toggleNavigatorsVisibility:(id)arg1; +- (void)changeToBreakpointsNavigator:(id)arg1; +- (void)changeToDebuggerNavigator:(id)arg1; +- (void)changeToFindNavigator:(id)arg1; +- (void)changeToTestNavigator:(id)arg1; +- (void)changeToIssuesNavigator:(id)arg1; +- (void)changeToLogsNavigator:(id)arg1; +- (void)changeToSymbolsNavigator:(id)arg1; +- (void)changeToStructureNavigator:(id)arg1; +- (void)showNavigatorWithIdentifier:(id)arg1; +- (void)changeToNavigatorWithIdentifier:(id)arg1 sender:(id)arg2; +- (void)_splitViewDidToggleClosed; +- (BOOL)performKeyEquivalent:(id)arg1; +- (id)_choiceWithKeyEquivalent:(id)arg1 modifierFlags:(unsigned long long)arg2 inUtilityArea:(id)arg3; +- (void)showLibraryWithChoiceFromSender:(id)arg1; +- (void)showInspectorWithChoiceFromSender:(id)arg1; +- (void)showInspectorCategoryWithExtensionIdentifier:(id)arg1; +- (void)showLibraryWithChoice:(id)arg1; +- (void)showInspectorWithChoice:(id)arg1; +- (id)libraryArea; +- (id)inspectorArea; +- (void)filterInNavigator:(id)arg1; +- (void)filterInLibrary:(id)arg1; +- (void)focusOnLibraryFilter; +- (void)changeToAssistantLayout_BH:(id)arg1; +- (void)changeToAssistantLayout_BV:(id)arg1; +- (void)changeToAssistantLayout_TH:(id)arg1; +- (void)changeToAssistantLayout_TV:(id)arg1; +- (void)changeToAssistantLayout_LH:(id)arg1; +- (void)changeToAssistantLayout_LV:(id)arg1; +- (void)changeToAssistantLayout_RH:(id)arg1; +- (void)changeToAssistantLayout_RV:(id)arg1; +- (void)_changeToAssistantLayoutForActionSelector:(SEL)arg1; +- (void)changeToVersionEditorLogView:(id)arg1; +- (void)changeToVersionEditorBlameView:(id)arg1; +- (void)changeToVersionEditorComparisonView:(id)arg1; +- (void)_changeToVersionEditorSubmode:(int)arg1; +- (void)changeToVersionEditor:(id)arg1; +- (void)changeToGeniusEditor:(id)arg1; +- (void)changeToStandardEditor:(id)arg1; +- (void)_changeToEditorMode:(int)arg1; +- (void)cancelCurrentExecution:(id)arg1; +- (void)resetEditor:(id)arg1; +- (void)removeAssistantEditor:(id)arg1; +- (void)addAssistantEditor:(id)arg1; +@property(readonly) IDEWorkspaceTabController *structureEditWorkspaceTabController; +@property(readonly) IDEWorkspace *structureEditWorkspace; +- (BOOL)validateUserInterfaceItem:(id)arg1; +- (BOOL)_validateEditorLayoutUserInterfaceItem:(id)arg1 forActionSelector:(SEL)arg2; +- (id)supplementalTargetForAction:(SEL)arg1 sender:(id)arg2; +@property(readonly) IDEEditorArea *editorArea; +@property(readonly) IDENavigatorArea *navigatorArea; +@property(readonly) IDEWorkspaceWindowController *windowController; +- (id)splitView:(id)arg1 needsRectanglesForViewsWithState:(id)arg2 forSize:(struct CGSize)arg3; +- (void)splitView:(id)arg1 resizeSubviewsWithOldSize:(struct CGSize)arg2; +- (void)_adjustUtilityAreaSplitViewWithOldSize:(struct CGSize)arg1; +- (void)_adjustDesignAreaSplitViewWithOldSize:(struct CGSize)arg1; +- (id)_framesForDesignAreaWithNavigatorState:(int)arg1 editorAreaState:(int)arg2 utilityAreaState:(int)arg3 forSize:(struct CGSize)arg4; +- (id)splitView:(id)arg1 additionalEffectiveRectsOfDividerAtIndex:(long long)arg2; +- (double)splitView:(id)arg1 constrainSplitPosition:(double)arg2 ofSubviewAt:(long long)arg3; +- (BOOL)splitView:(id)arg1 canCollapseSubview:(id)arg2; +- (double)splitView:(id)arg1 constrainMaxCoordinate:(double)arg2 ofSubviewAt:(long long)arg3; +- (double)splitView:(id)arg1 constrainMinCoordinate:(double)arg2 ofSubviewAt:(long long)arg3; +- (struct CGSize)minimumSizeForView:(id)arg1; +- (void)updateMinimumWindowSize:(BOOL)arg1; +- (struct CGSize)minimumSizeForDesignArea; +- (struct CGSize)minimumSizeForDesignAreaIfNavigatorVisible:(BOOL)arg1 editorVisisble:(BOOL)arg2 andUtilityAreaVisible:(BOOL)arg3; +- (void)_removeCursorRectInterceptor:(id)arg1; +- (void)_addCursorRectInterceptor:(id)arg1; +- (void)_interceptWillInvalidateCursorRectsForViewsWithNoTrackingAreas; +- (void)_interceptWillInvalidateCursorRectsForView:(id)arg1; +- (BOOL)_interceptAddCursorRect:(struct CGRect)arg1 cursor:(id)arg2 forView:(id)arg3 inWindow:(id)arg4; +- (BOOL)_interceptSetCursorForMouseLocation:(struct CGPoint)arg1 inWindow:(id)arg2; +- (void)_pushDefaultPrimaryEditorFrameSize; +@property BOOL showNavigator; +@property BOOL showUtilities; +- (id)workspace; +- (void)_removePendingDebuggingAdditionUIControllerObserversForLaunchSession:(id)arg1; +- (void)_notifyAndRemoveObserversForCreatedUIController:(id)arg1 inLaunchSession:(id)arg2; +- (id)debuggingAdditionUIControllerMatchingID:(id)arg1 forLaunchSession:(id)arg2 handler:(dispatch_block_t)arg3; +- (id)_createDebuggingAdditionUIControllersForDebuggingAddition:(id)arg1; +- (void)_createDebuggingAdditionUIControllersForLaunchSession:(id)arg1; +- (void)dismissExecutionHoldAlert; +- (void)showExecutionHoldAlertWithError:(id)arg1; +- (void)showAlertModallyInWorkspaceForError:(id)arg1; +- (void)replacementView:(id)arg1 willInstallViewController:(id)arg2; +- (void)primitiveInvalidate; +- (void)viewWillUninstall; +- (void)workspaceWindowIsClosing; +- (void)viewDidInstall; +- (void)_performExtraViewDidInstallWork; +- (void)commitStateToDictionary:(id)arg1; +- (void)revertStateWithDictionary:(id)arg1; +- (void)_revertStateForNewWindowWithDictionary:(id)arg1 simpleEditorWindowLayout:(BOOL)arg2; +- (void)_primitiveSetAssistantEditorsLayout:(int)arg1; +- (void)loadView; +- (void)setSplitGroupAccessibility; +- (id)initWithNibName:(id)arg1 bundle:(id)arg2; + +// Remaining properties +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) Class superclass; + +@end + diff --git a/SCXcodeMinimap/Xcode Headers/IDEWorkspaceWindowController.h b/SCXcodeMinimap/Xcode Headers/IDEWorkspaceWindowController.h new file mode 100644 index 0000000..5ffc59d --- /dev/null +++ b/SCXcodeMinimap/Xcode Headers/IDEWorkspaceWindowController.h @@ -0,0 +1,256 @@ +// +// Generated by class-dump 3.5 (64 bit). +// +// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. +// + +#import + +@class DVTBarBackground, DVTNotificationToken, DVTObservingToken, DVTStackBacktrace, DVTStateToken, DVTTabBarEnclosureView, DVTWeakInterposer, IDEEditorArea, IDEEditorDocument, IDEToolbarDelegate, IDEWorkspace, IDEWorkspaceTabController, IDEWorkspaceWindow, NSMapTable, NSMutableArray, NSString, NSTabView, NSTimer, _IDEWindowFullScreenSavedDebuggerTransitionValues; + +@interface IDEWorkspaceWindowController : NSWindowController +{ + NSTimer *_springToFrontTimer; + int _debugSessionState; + NSMutableArray *_windowsOrderedOutForMiniDebugging; + struct CGRect _restoreFrame; + struct CGSize _originalMinSize; + struct CGPoint _miniRestoreOrigin; + struct CGSize _collapsedRestoreSize; + struct CGSize _mediumRestoreSize; + double _miniWindowBarHeight; + double _toolbarHeightDelta; + struct CGSize _contentViewFrozenSize; + NSMutableArray *_topLevelViewOrder; + NSMapTable *_viewHeightsForResizing; + NSMutableArray *_stateChangeObservingTokens; + IDEEditorDocument *_lastObservedEditorDocument; + IDEWorkspaceTabController *_activeWorkspaceTabController; + DVTObservingToken *_toolbarVisibleToken; + IDEToolbarDelegate *_toolbarDelegate; + BOOL _showToolbar; + DVTObservingToken *_workspaceSimpleFilesFocusedObservingToken; + DVTObservingToken *_workspaceRepresentingFilePathObservingToken; + DVTObservingToken *_workspaceFinishedLoadingObservingToken; + DVTObservingToken *_navigationTargetedEditorDocumentObservingToken; + DVTNotificationToken *_editorDocumentIsEditedNotificationToken; + DVTObservingToken *_userWantsMiniDebuggingConsoleObservingToken; + DVTObservingToken *_userWantsAppFocusInMiniDebuggingObservingToken; + IDEWorkspace *_workspace; + _IDEWindowFullScreenSavedDebuggerTransitionValues *_fullScreenSavedDebuggerTransitionValues; + unsigned int _coalescedUpdateMask; + int _contentViewFrozenMode; + BOOL _performingCoalescedUpdates; + BOOL _readyToUpdateKeyboardLoop; + BOOL _tabBarInTransition; + BOOL _tabBarShownForTabDrag; + BOOL _keepTabBarHiddenWhenCreatingTab; + BOOL _isInMorphingToDebugging; + BOOL _createdCollapsedRestoreFrame; + BOOL _createdMediumRestoreFrame; + BOOL _inTotalCollapsedFrame; + BOOL _tabBarForcedClosed; + BOOL _capturedStatesBeforeMiniDebugging; + BOOL _wasShowingNavigatorBeforeMiniDebugging; + BOOL _wasShowingUtilitiesBeforeMiniDebugging; + BOOL _wasShowingEditorBeforeMiniDebugging; + BOOL _isClosing; + BOOL _enteringFullScreenMode; + BOOL _exitingFullScreenMode; + BOOL _fullScreenTabBarAlwaysVisible; + BOOL _inMiniDebuggingMode; + BOOL _createNewTabUponLoadIfNoTabsExist; + BOOL _didSetupFirstResponderInterposer; + BOOL _shouldPerformWindowClose; + DVTTabBarEnclosureView *_tabBarEnclosureView; + NSTabView *_tabView; + NSString *_uniqueIdentifier; + DVTWeakInterposer *_firstResponderInterposer; + DVTBarBackground *_tabBarView; + DVTStateToken *_stateToken; +} + ++ (id)keyPathsForValuesAffectingUserWantsBreakpointsActivated; ++ (void)initialize; ++ (id)workspaceWindowControllerForWindow:(id)arg1; ++ (long long)version; ++ (void)configureStateSavingObjectPersistenceByName:(id)arg1; ++ (id)workspaceWindowControllers; +@property BOOL shouldPerformWindowClose; // @synthesize shouldPerformWindowClose=_shouldPerformWindowClose; +@property(retain) DVTStateToken *stateToken; // @synthesize stateToken=_stateToken; +@property(retain, nonatomic) DVTBarBackground *tabBarView; // @synthesize tabBarView=_tabBarView; +@property BOOL didSetupFirstResponderInterposer; // @synthesize didSetupFirstResponderInterposer=_didSetupFirstResponderInterposer; +@property(retain) DVTWeakInterposer *firstResponderInterposer; // @synthesize firstResponderInterposer=_firstResponderInterposer; +@property(nonatomic) BOOL showToolbar; // @synthesize showToolbar=_showToolbar; +@property BOOL createNewTabUponLoadIfNoTabsExist; // @synthesize createNewTabUponLoadIfNoTabsExist=_createNewTabUponLoadIfNoTabsExist; +@property(copy, nonatomic) NSString *uniqueIdentifier; // @synthesize uniqueIdentifier=_uniqueIdentifier; +@property(readonly, getter=isInMiniDebuggingMode) BOOL inMiniDebuggingMode; // @synthesize inMiniDebuggingMode=_inMiniDebuggingMode; +@property(retain, nonatomic) NSTabView *tabView; // @synthesize tabView=_tabView; +@property(retain, nonatomic) DVTTabBarEnclosureView *tabBarEnclosureView; // @synthesize tabBarEnclosureView=_tabBarEnclosureView; +- (void)moveFocusToEditor:(id)arg1; +- (void)dicardEditing; +- (BOOL)commitEditingForAction:(int)arg1 errors:(id)arg2; +- (void)_updateWindowTitle; +- (void)_userWantsMiniDebuggingConsoleChanged; +- (void)_userWantsAppFocusInMiniDebuggingChanged; +- (void)_updateTitleRepresentedPath; +@property BOOL userWantsBreakpointsActivated; +- (void)changeFromDebugSessionState:(int)arg1 to:(int)arg2 fromDebuggingWindowBehavior:(int)arg3 to:(int)arg4; +- (void)_makeWindowLookKeyWhenKey; +- (void)windowDidExitFullScreen:(id)arg1; +- (void)windowWillExitFullScreen:(id)arg1; +- (void)windowWillEnterFullScreen:(id)arg1; +- (void)windowDidEnterFullScreen:(id)arg1; +- (void)_workaround8217584; +- (BOOL)_isTargetApplicationActive; +- (void)_changeWindowsLevelFrom:(int)arg1 to:(int)arg2; +- (void)_changeFrom:(int)arg1 toNormalOrXcodeBehindDebugging:(int)arg2; +- (void)_changeToMiniDebugging:(int)arg1; +- (void)_morphToMedium:(int)arg1; +- (struct CGRect)_mediumFrame; +- (void)_morphToNonCollapsed:(struct CGRect)arg1 frozenMode:(int)arg2 toolbarHeightDelta:(double)arg3; +- (void)_morphToCollapsed; +- (void)_setInTotalCollapsed:(BOOL)arg1; +- (void)_reSnapshotContentViewToNewFrame:(struct CGRect)arg1 hideTabBarBeforeSnapshot:(BOOL)arg2 toolbarHeightDelta:(double)arg3; +- (void)_createCollapsedRestoreFrame; +- (void)_performSpringToFront; +- (void)_cancelSpringToFront; +- (void)_scheduleSpringToFront; +- (id)_screenForWindow; +- (void)morphingDragImage:(id)arg1 exitedWindow:(id)arg2; +- (void)morphingDragImage:(id)arg1 enteredWindow:(id)arg2; +- (BOOL)morphingDragImage:(id)arg1 performDragOperation:(id)arg2; +- (void)morphingDragImage:(id)arg1 draggingExited:(id)arg2; +- (unsigned long long)morphingDragImage:(id)arg1 draggingUpdated:(id)arg2; +- (unsigned long long)morphingDragImage:(id)arg1 draggingEntered:(id)arg2; +- (void)workspaceWindowWillInvalidateCursorRectsForViewsWithNoTrackingAreas:(id)arg1; +- (void)workspaceWindow:(id)arg1 willInvalidateCursorRectsForView:(id)arg2; +- (BOOL)workspaceWindow:(id)arg1 interceptAddCursorRect:(struct CGRect)arg2 cursor:(id)arg3 forView:(id)arg4; +- (BOOL)workspaceWindow:(id)arg1 interceptSetCursorForMouseLocation:(struct CGPoint)arg2; +- (void)workspaceWindowDidRecalculateKeyViewLoop:(id)arg1; +- (void)windowWillClose:(id)arg1; +- (void)windowDidMove:(id)arg1; +- (void)windowDidResize:(id)arg1; +- (struct CGSize)windowWillResize:(id)arg1 toSize:(struct CGSize)arg2; +- (BOOL)windowShouldZoom:(id)arg1 toFrame:(struct CGRect)arg2; +- (void)_recordRestoreFrame; +- (struct CGRect)window:(id)arg1 willPositionSheet:(id)arg2 usingRect:(struct CGRect)arg3; +- (void)workspaceWindowIsClosing:(id)arg1; +- (void)_pushDefaultPrimaryEditorFrameSizes; +- (BOOL)_isLastWindowControllerOfDocument; +- (void)primitiveInvalidate; +- (void)_prepareBarsToExitFullScreen; +- (void)_prepareBarsToEnterFullScreen; +- (BOOL)isEnteringOrInFullScreenMode; +- (BOOL)isInFullScreenMode; +- (void)synchronizeWindowTitleWithDocumentName; +- (void)_performCloseAll; +- (BOOL)_shouldCloseWindowEvaluatingOtherWindows; +- (void)_closeWindowIfNoTabs; +- (double)tabBarHeight; +- (void)moveTabFromOtherWindow:(id)arg1 toIndex:(unsigned long long)arg2 andSelect:(BOOL)arg3; +- (void)replaceEmptyTabWithTabs:(id)arg1; +- (void)_closeOtherTabsWithoutConfirming:(id)arg1; +- (void)closeTabOrWindow:(id)arg1; +- (void)_closeTabWithoutConfirming:(id)arg1; +- (void)_closeTabWithoutConfirming:(id)arg1 andInvalidate:(BOOL)arg2; +- (void)closeTab:(id)arg1; +- (id)_findTabForView:(id)arg1; +- (void)selectTab:(id)arg1; +- (BOOL)_moreThanOneTabShowing; +- (BOOL)closeKeyEquivalentClosesTab; +- (id)_createTabWithViewController:(id)arg1 atIndex:(unsigned long long)arg2 andShow:(BOOL)arg3; +- (void)_toggleTabBarWithAnimation:(BOOL)arg1 isShowing:(BOOL)arg2 forceMaintainFullHeight:(BOOL)arg3; +- (void)_toggleTabBarWithAnimation:(BOOL)arg1 isShowing:(BOOL)arg2; +- (id)_setAutoresizingMasksForOrderedViews:(id)arg1 toResizeOnly:(id)arg2; +- (void)_collectViewInfoForResizing; +- (void)_updateAuxiliaryToolbarViewSizes; +- (double)_originalHeightForView:(id)arg1; +- (id)showTabNamed:(id)arg1; +- (id)_showTab:(id)arg1; +- (void)_moveTabToNewWindow:(id)arg1; +- (id)_setUpTabForViewController:(id)arg1 atIndex:(unsigned long long)arg2; +- (id)_setUpTabForViewController:(id)arg1 addToRightSide:(BOOL)arg2; +- (id)_setUpTabForViewController:(id)arg1; +- (id)createTabWithViewController:(id)arg1 andShow:(BOOL)arg2 addToRightSide:(BOOL)arg3; +- (id)createInactiveTabWithFrameName:(id)arg1; +- (id)createInactiveTab; +- (id)createTabWithFrameName:(id)arg1 andShow:(BOOL)arg2 addToRightSide:(BOOL)arg3; +- (id)instantiateTabControllerAndRegisterForStateSavingWithName:(id)arg1 inDocument:(id)arg2; +- (id)createTabWithFrameName:(id)arg1; +- (id)createTab; +- (unsigned long long)selectedTabIndex; +- (void)closeTabFromMenu:(id)arg1; +- (id)selectedTab; +- (id)orderedTabViewItems; +- (void)cancelUpdateTabTitlesSoon; +- (void)_performCoalescedUpdates; +- (void)_cancelCoalescedUpdate:(int)arg1; +- (void)_performCoalescedUpdateSoon:(int)arg1; +- (void)tabBarViewUpdateTabTitlesNow; +- (void)tabBarViewUpdateTabTitlesSoon; +- (BOOL)canCreateNewTab; +- (void)_showTabBarIfNeeded; +- (void)_automaticallyHideTabBarForTabDrag; +- (void)_automaticallyShowTabBarForTabDrag; +- (void)_setTabBarVisible:(BOOL)arg1; +- (BOOL)_alwaysShowTabBar; +- (BOOL)canCloseSelectedTab; +- (BOOL)_canCloseTab:(id)arg1; +- (void)toggleTabBar:(id)arg1; +- (void)selectPreviousTab:(id)arg1; +- (void)selectNextTab:(id)arg1; +- (void)_selectNextTabGoingForward:(BOOL)arg1; +- (void)moveTabToNewWindowFromMenu:(id)arg1; +- (void)closeOtherTabs:(id)arg1; +- (void)closeOtherTabsFromMenu:(id)arg1; +- (void)closeCurrentTab:(id)arg1; +- (id)newTabWithName:(id)arg1 cloneExisting:(BOOL)arg2; +- (void)newTabWithinWindow:(id)arg1; +- (void)newTab:(id)arg1; +- (BOOL)validateMenuItem:(id)arg1; +- (BOOL)canCloseOtherTabs; +- (struct CGRect)adjustedFrameForCascade:(struct CGRect)arg1 fromWindow:(id)arg2; +- (struct CGRect)adjustedFrameForSaving:(struct CGRect)arg1; +- (BOOL)_windowIsFullHeight; +- (void)setTabBarVisible:(BOOL)arg1; +- (BOOL)isTabBarVisible; +- (void)_toggleTabBarWithAnimation:(BOOL)arg1; +- (BOOL)_shouldShowTabBar; +- (BOOL)canReceiveDragFromTabbedWindowControlling:(id)arg1; +- (void)_setUpTabBar; +- (void)autocreateContexts:(id)arg1; +- (id)supplementalTargetForAction:(SEL)arg1 sender:(id)arg2; +- (BOOL)window:(id)arg1 shouldRestoreStateForResponder:(id)arg2; +@property(readonly) IDEWorkspaceWindow *workspaceWindow; +- (id)_uniqueNameForNewWorkspaceTabController; +@property(readonly) IDEEditorArea *editorArea; +- (void)activateWorkspaceTabController:(id)arg1; +@property(readonly) IDEWorkspaceTabController *activeWorkspaceTabController; +- (void)_didChangeActiveWorkspaceTabController; +- (id)workspaceTabControllers; +- (void)setStateSavingWindowFrame:(id)arg1; +- (id)stateSavingWindowFrame; +- (void)commitStateToDictionary:(id)arg1; +- (void)_configureStateSavingObservers; +- (void)revertStateWithDictionary:(id)arg1; +- (void)_revertForNewWindowWithTabStateContext:(id)arg1 documentURL:(id)arg2 simpleEditorWindowLayout:(BOOL)arg3; +- (void)_changeSizeForSimpleEditorWindowLayoutWithEditorDocumentURLOrNil:(id)arg1 forSingleFile:(BOOL)arg2 workspaceTabController:(id)arg3; +- (void)_updateToolbarIsVisible; +- (void)toggleToolbarShown:(id)arg1; +- (void)windowDidLoad; +- (void)_showWindowBehindWorkspaceWindow:(id)arg1; +- (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; +- (id)init; + +// Remaining properties +@property(retain) DVTStackBacktrace *creationBacktrace; +@property(readonly, copy) NSString *debugDescription; +@property(readonly, copy) NSString *description; +@property(readonly) unsigned long long hash; +@property(readonly) DVTStackBacktrace *invalidationBacktrace; +@property(readonly) Class superclass; +@property(readonly, nonatomic, getter=isValid) BOOL valid; + +@end + From e1f3bc8de299ce4856dbefa9bd8d6f7ee09b9a1b Mon Sep 17 00:00:00 2001 From: "Edward B. Smith" Date: Tue, 15 Sep 2015 12:18:00 -0700 Subject: [PATCH 82/96] * Added the DVTPlugInCompatibilityUUID for Xcode 7.1.0 beta. * Added the - (id) foldingTokenTypesForLayoutManager:(DVTLayoutManager*)layoutManager method to prevent crash. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + SCXcodeMinimap/SCXcodeMinimapView.m | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 10aa34e..9fe98e2 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -39,6 +39,7 @@ 8DC44374-2B35-4C57-A6FE-2AD66A36AAD9 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 AABB7188-E14E-4433-AD3B-5CD791EAD9A3 + CC0D0F4F-05B3-431A-8F33-F84AFCB2C651 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index f6bc0f4..90fb14c 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -484,6 +484,11 @@ - (void)layoutManagerDidRequestSelectedSymbolInstancesHighlight:(DVTLayoutManage [self invalidateHighligtedSymbols]; } +- (id) foldingTokenTypesForLayoutManager:(DVTLayoutManager *)layoutManager +{ + return nil; +} + #pragma mark - IDESourceCodeEditorSearchResultsDelegate - (void)sourceCodeEditorDidUpdateSearchResults:(IDESourceCodeEditor *)editor From a1b0768754d136048bbbebdcd153d9c6b416a093 Mon Sep 17 00:00:00 2001 From: "Edward B. Smith" Date: Wed, 16 Sep 2015 18:43:47 -0700 Subject: [PATCH 83/96] Added the DVTPlugInCompatibilityUUID for Xcode 7.0. --- SCXcodeMinimap.xcodeproj/project.pbxproj | 5 ++++- .../xcshareddata/xcschemes/SCXcodeMinimap.xcscheme | 13 ++++++++----- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 3 ++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/SCXcodeMinimap.xcodeproj/project.pbxproj b/SCXcodeMinimap.xcodeproj/project.pbxproj index 14c312d..cbf34a9 100644 --- a/SCXcodeMinimap.xcodeproj/project.pbxproj +++ b/SCXcodeMinimap.xcodeproj/project.pbxproj @@ -281,7 +281,7 @@ 18FE09AA1707639E00118FEB /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0700; ORGANIZATIONNAME = "Stefan Ceriu"; }; buildConfigurationList = 18FE09AD1707639E00118FEB /* Build configuration list for PBXProject "SCXcodeMinimap" */; @@ -346,6 +346,7 @@ CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -412,6 +413,7 @@ "$(inherited)", "$(SYSTEM_DEVELOPER_DIR)/../Plugins/**", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.stefanceriu.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; }; @@ -440,6 +442,7 @@ "$(inherited)", "$(SYSTEM_DEVELOPER_DIR)/../Plugins/**", ); + PRODUCT_BUNDLE_IDENTIFIER = "com.stefanceriu.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = xcplugin; }; diff --git a/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme b/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme index a2103d7..2a3238a 100644 --- a/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme +++ b/SCXcodeMinimap.xcodeproj/xcshareddata/xcschemes/SCXcodeMinimap.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> + + CFBundleIconFile CFBundleIdentifier - com.stefanceriu.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -40,6 +40,7 @@ 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 AABB7188-E14E-4433-AD3B-5CD791EAD9A3 CC0D0F4F-05B3-431A-8F33-F84AFCB2C651 + 0420B86A-AA43-4792-9ED0-6FE0F2B16A13 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) From deb5083a954b1d695b94b55023cc32c5a977523e Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 22 Oct 2015 08:09:56 +0100 Subject: [PATCH 84/96] Added Xcode 7.1 compatibility UUID, fixed editor offset jumps when the minimap is hidden (#68) --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + SCXcodeMinimap/SCXcodeMinimapView.m | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index e91e52d..16ca449 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -41,6 +41,7 @@ AABB7188-E14E-4433-AD3B-5CD791EAD9A3 CC0D0F4F-05B3-431A-8F33-F84AFCB2C651 0420B86A-AA43-4792-9ED0-6FE0F2B16A13 + 7265231C-39B4-402C-89E1-16167C4CC990 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 58527d8..93a856c 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -621,10 +621,6 @@ - (void)updateSearchResults - (void)updateOffset { - if (self.isHidden) { - return; - } - [self.editorTextView.layoutManager ensureLayoutForTextContainer:self.editorTextView.textContainer]; CGFloat editorTextHeight = CGRectGetHeight([self.editorTextView.layoutManager usedRectForTextContainer:self.editorTextView.textContainer]); From 676e9fe207a6addebc5049c513455dc702511c3b Mon Sep 17 00:00:00 2001 From: ReadmeCritic Date: Tue, 10 Nov 2015 14:41:56 -0800 Subject: [PATCH 85/96] Readme: Update redirects --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b752cf..35a30a1 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Without editor highlighting | With editor highlighting ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/selectedSymbolInstancesHighlighting.gif) #### Installation -- Through [Alcatraz](https://github.com/supermarin/Alcatraz) +- Through [Alcatraz](https://github.com/alcatraz/Alcatraz) - or download the sources, build the project and restart Xcode From 330edd3d9720aa55b724917acf497cb5ebbd33ba Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 9 Dec 2015 10:16:04 +0000 Subject: [PATCH 86/96] Added the Xcode 7.2 compatibility uuid. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 16ca449..621e989 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -42,6 +42,7 @@ CC0D0F4F-05B3-431A-8F33-F84AFCB2C651 0420B86A-AA43-4792-9ED0-6FE0F2B16A13 7265231C-39B4-402C-89E1-16167C4CC990 + F41BD31E-2683-44B8-AE7F-5F09E919790E LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) From 768ed66da068853f83d6117403125bc89a7a38e0 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sat, 26 Dec 2015 09:12:55 +0000 Subject: [PATCH 87/96] Added safety checks when removing editorMode KVO observers (#71) --- SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m | 48 ++++++++++++++----- ...DEIssueAnnotationProvider+SCXcodeMinimap.m | 19 ++++---- 2 files changed, 45 insertions(+), 22 deletions(-) diff --git a/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m b/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m index 199f687..01a2c30 100644 --- a/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m +++ b/SCXcodeMinimap/IDEEditorArea+SCXcodeMinimap.m @@ -11,6 +11,12 @@ static void *IDEEditorAreaEditorModeObservingContext = &IDEEditorAreaEditorModeObservingContext; +@interface IDEEditorArea (SCXcodeMinimap_Private) + +@property (nonatomic, assign) BOOL observersInstalled; + +@end + @implementation IDEEditorArea (SCXcodeMinimap) + (void)load @@ -19,26 +25,22 @@ + (void)load sc_swizzleInstanceMethod([self class], @selector(viewWillUninstall), @selector(sc_viewWillUninstall)); } -- (id)minimapDelegate -{ - return objc_getAssociatedObject(self, @selector(minimapDelegate)); -} - -- (void)setMinimapDelegate:(id)minimapDelegate -{ - objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); -} - - (void)sc_viewDidInstall { - [self addObserver:self forKeyPath:@"editorMode" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:IDEEditorAreaEditorModeObservingContext]; - + if(!self.observersInstalled) { + [self addObserver:self forKeyPath:@"editorMode" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:IDEEditorAreaEditorModeObservingContext]; + [self setObserversInstalled:YES]; + } + [self sc_viewDidInstall]; } - (void)sc_viewWillUninstall { - [self removeObserver:self forKeyPath:@"editorMode"]; + if(self.observersInstalled) { + [self removeObserver:self forKeyPath:@"editorMode"]; + [self setObserversInstalled:NO]; + } [self sc_viewWillUninstall]; } @@ -52,4 +54,24 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N } } +- (BOOL)observersInstalled +{ + return [objc_getAssociatedObject(self, @selector(observersInstalled)) boolValue]; +} + +- (void)setObserversInstalled:(BOOL)observersInstalled +{ + objc_setAssociatedObject(self, @selector(observersInstalled), @(observersInstalled), OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (id)minimapDelegate +{ + return objc_getAssociatedObject(self, @selector(minimapDelegate)); +} + +- (void)setMinimapDelegate:(id)minimapDelegate +{ + objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); +} + @end diff --git a/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m b/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m index 158bf64..c7d7443 100644 --- a/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m +++ b/SCXcodeMinimap/IDEIssueAnnotationProvider+SCXcodeMinimap.m @@ -13,7 +13,7 @@ @interface IDEIssueAnnotationProvider (SCXcodeMinimap_Private) -@property (nonatomic, assign) BOOL isObservingAnnotations; +@property (nonatomic, assign) BOOL observersInstalled; @end @@ -30,9 +30,10 @@ - (void)sc_providerWillUninstall { [self sc_providerWillUninstall]; - if(self.isObservingAnnotations) { - [self removeObserver:self forKeyPath:@"annotations"]; - } + if(self.observersInstalled) { + [self removeObserver:self forKeyPath:@"annotations"]; + [self setObserversInstalled:NO]; + } } - (void)_didDeleteOrReplaceParagraphForAnnotation:(id)annotation @@ -54,8 +55,8 @@ - (void)setMinimapDelegate:(id)minimapDelega objc_setAssociatedObject(self, @selector(minimapDelegate), minimapDelegate, OBJC_ASSOCIATION_ASSIGN); if(minimapDelegate) { - self.isObservingAnnotations = YES; [self addObserver:self forKeyPath:@"annotations" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:IDEIssueAnnotationProviderIssuesObservingContext]; + [self setObserversInstalled:YES]; } } @@ -68,14 +69,14 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N } } -- (BOOL)isObservingAnnotations +- (BOOL)observersInstalled { - return [objc_getAssociatedObject(self, @selector(isObservingAnnotations)) boolValue]; + return [objc_getAssociatedObject(self, @selector(observersInstalled)) boolValue]; } -- (void)setIsObservingAnnotations:(BOOL)isObservingAnnotations +- (void)setObserversInstalled:(BOOL)observersInstalled { - objc_setAssociatedObject(self, @selector(isObservingAnnotations), @(isObservingAnnotations), OBJC_ASSOCIATION_RETAIN_NONATOMIC); + objc_setAssociatedObject(self, @selector(observersInstalled), @(observersInstalled), OBJC_ASSOCIATION_RETAIN_NONATOMIC); } @end From b356870ba908bf21f29d8c755c94d4b3634d76d5 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 31 Jan 2016 18:59:18 +0000 Subject: [PATCH 88/96] Preventing content offset changes while the textStorage is editing (#76) --- SCXcodeMinimap/SCXcodeMinimapView.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 93a856c..c1d9e92 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -633,7 +633,11 @@ - (void)updateOffset [self.selectionView setFrame:selectionViewFrame]; return; } - + + if(self.editorTextView.textStorage.editedMask) { + return; + } + CGFloat editorYOffset = CGRectGetMinY(self.editor.scrollView.contentView.bounds) + ABS(CGRectGetMinY(self.editorTextView.frame)); CGFloat ratio = (adjustedMinimapContentHeight / adjustedEditorContentHeight) * (1 / self.scrollView.magnification); From 639cd7d73a9fd23486095ae6cad72bb5befa5966 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Tue, 22 Mar 2016 22:21:05 +0000 Subject: [PATCH 89/96] Added Xcode 7.3 support (fixes #81) --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 621e989..f58d29b 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -43,6 +43,7 @@ 0420B86A-AA43-4792-9ED0-6FE0F2B16A13 7265231C-39B4-402C-89E1-16167C4CC990 F41BD31E-2683-44B8-AE7F-5F09E919790E + ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) From 1e5858d332c8d2626c306c40b05a9032cbbaebc3 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 23 Jun 2016 11:23:38 +0300 Subject: [PATCH 90/96] Added Xcode 8.0 support (more info https://github.com/alcatraz/Alcatraz/issues/475) --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index f58d29b..d7d5594 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -44,6 +44,7 @@ 7265231C-39B4-402C-89E1-16167C4CC990 F41BD31E-2683-44B8-AE7F-5F09E919790E ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C + 1637F4D5-0B27-416B-A78D-498965D64877 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) From bf960edb5cc0d12a11256c92a25d6e20e0d5538f Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 23 Jun 2016 11:40:40 +0300 Subject: [PATCH 91/96] Remove unnecessary ensyreLayoutForTextContainer calls and prevented calling it while the text storage is modified. --- SCXcodeMinimap/SCXcodeMinimapView.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index c1d9e92..8393acf 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -466,8 +466,7 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didFoldRange:(NSRange [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didFoldRange:range]; [self.textView.layoutManager.foldingManager foldRange:range]; - - [self.textView.layoutManager ensureLayoutForTextContainer:self.textView.textContainer]; + [self updateOffset]; } @@ -476,8 +475,7 @@ - (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRan [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didUnfoldRange:range]; [self.textView.layoutManager.foldingManager unfoldRange:range]; - - [self.textView.layoutManager ensureLayoutForTextContainer:self.textView.textContainer]; + [self updateOffset]; } @@ -621,7 +619,9 @@ - (void)updateSearchResults - (void)updateOffset { - [self.editorTextView.layoutManager ensureLayoutForTextContainer:self.editorTextView.textContainer]; + if(!self.editorTextView.textStorage.editedMask) { + [self.editorTextView.layoutManager ensureLayoutForTextContainer:self.editorTextView.textContainer]; + } CGFloat editorTextHeight = CGRectGetHeight([self.editorTextView.layoutManager usedRectForTextContainer:self.editorTextView.textContainer]); CGFloat adjustedEditorContentHeight = editorTextHeight - CGRectGetHeight(self.editor.scrollView.bounds); From 70988742e2d32050653cc69554ff2aee28a1264e Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 28 Oct 2016 11:27:14 +0300 Subject: [PATCH 92/96] Added Xcode 8.1 support. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 1 + 1 file changed, 1 insertion(+) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index d7d5594..5a44ab9 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -45,6 +45,7 @@ F41BD31E-2683-44B8-AE7F-5F09E919790E ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C 1637F4D5-0B27-416B-A78D-498965D64877 + DA4FDFD8-C509-4D8B-8B55-84A7B66AE701 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) From 92357cbed2fc225b84c2e52639afaeb9eea4fe87 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 6 Mar 2017 10:23:41 +0200 Subject: [PATCH 93/96] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 35a30a1..6b4efc2 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,12 @@ All options are configurable through the View/Minimap menu item #### Screenshots Without editor highlighting | With editor highlighting :--------------------------:|:--------------------------: -![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-01.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-03.png) | -![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-02.png) | ![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/SCXcodeMinimap%20v2.0-04.png) | +![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoakt2SGFVendkLTg) | ![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoSnBuS2R3SDNHM3M) | +![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltodHUwS3U1ZlV4NFU) | ![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoZWYtdnhRVFRDeU0) | -![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/searchResultsHighlighting.png) +![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoN3Z1bl9aMS1zd1E) -![](https://dl.dropboxusercontent.com/u/12748201/Recordings/SCXcodeMinimap/v2.2/selectedSymbolInstancesHighlighting.gif) +![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoMnQ0c3h3djZWU00) #### Installation - Through [Alcatraz](https://github.com/alcatraz/Alcatraz) @@ -40,4 +40,4 @@ Without editor highlighting | With editor highlighting SCXcodeMiniMap is released under the GNU GENERAL PUBLIC LICENSE (see the LICENSE file) #### Contact -Any suggestions or improvements are more than welcome. Feel free to contact me at [stefan.ceriu@yahoo.com](mailto:stefan.ceriu@yahoo.com) or [@stefanceriu](https://twitter.com/stefanceriu). \ No newline at end of file +Any suggestions or improvements are more than welcome. Feel free to contact me at [stefan.ceriu@yahoo.com](mailto:stefan.ceriu@yahoo.com) or [@stefanceriu](https://twitter.com/stefanceriu). From 1005a451f3a9b5ef79e995f997d860fdb55546ec Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Sun, 9 Apr 2017 21:22:25 +0300 Subject: [PATCH 94/96] Add Xcode 8.3 support and prevent folding manager related crashes. --- SCXcodeMinimap/SCXcodeMinimap-Info.plist | 2 + SCXcodeMinimap/SCXcodeMinimapView.m | 54 +++--- .../Xcode Headers/DVTSourceTextView.h | 173 ++++++++++-------- 3 files changed, 127 insertions(+), 102 deletions(-) diff --git a/SCXcodeMinimap/SCXcodeMinimap-Info.plist b/SCXcodeMinimap/SCXcodeMinimap-Info.plist index 5a44ab9..e5950a1 100644 --- a/SCXcodeMinimap/SCXcodeMinimap-Info.plist +++ b/SCXcodeMinimap/SCXcodeMinimap-Info.plist @@ -46,6 +46,8 @@ ACA8656B-FEA8-4B6D-8E4A-93F4C95C362C 1637F4D5-0B27-416B-A78D-498965D64877 DA4FDFD8-C509-4D8B-8B55-84A7B66AE701 + E0A62D1F-3C18-4D74-BFE5-A4167D643966 + DFFB3951-EB0A-4C09-9DAC-5F2D28CC839C LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) diff --git a/SCXcodeMinimap/SCXcodeMinimapView.m b/SCXcodeMinimap/SCXcodeMinimapView.m index 8393acf..224035d 100644 --- a/SCXcodeMinimap/SCXcodeMinimapView.m +++ b/SCXcodeMinimap/SCXcodeMinimapView.m @@ -29,7 +29,7 @@ #import "SCXcodeMinimapTheme.h" #import "DVTPreferenceSetManager.h" -#import "DVTFoldingManager.h" +//#import "DVTFoldingManager.h" #import "DVTAnnotationManager.h" #import "DBGBreakpointAnnotationProvider+SCXcodeMinimap.h" @@ -74,7 +74,7 @@ typedef NS_ENUM(NSUInteger, SCXcodeMinimapAnnotationType) { @interface SCXcodeMinimapView () < NSLayoutManagerDelegate, - DVTFoldingManagerDelegate, + //DVTFoldingManagerDelegate, DBGBreakpointAnnotationProviderDelegate, IDEIssueAnnotationProviderDelegate, DVTLayoutManagerMinimapDelegate, @@ -159,7 +159,7 @@ - (instancetype)initWithEditor:(IDESourceCodeEditor *)editor [(NSMutableArray *)storage.layoutManagers removeObject:layoutManager]; [(NSMutableArray *)storage.layoutManagers addObject:layoutManager]; - [self.editorTextView.layoutManager.foldingManager setDelegate:self]; + //[self.editorTextView.layoutManager.foldingManager setDelegate:self]; [self.textView setEditable:NO]; [self.textView setSelectable:NO]; @@ -413,9 +413,9 @@ - (NSDictionary *)layoutManager:(NSLayoutManager *)layoutManager } } - short nodeType = [(DVTTextStorage *)[self.textView textStorage] nodeTypeAtCharacterIndex:charIndex - effectiveRange:effectiveRange - context:self.editorTextView.syntaxColoringContext]; + short nodeType = [(DVTTextStorage *)[self.editorTextView textStorage] nodeTypeAtCharacterIndex:charIndex + effectiveRange:effectiveRange + context:[self.editor syntaxColoringContextForTextView:self.editorTextView]]; @@ -459,24 +459,29 @@ - (void)layoutManager:(DVTLayoutManager *)layoutManager didCompleteLayoutForText } } -#pragma mark - DVTFoldingManagerDelegate - -- (void)foldingManager:(DVTFoldingManager *)foldingManager didFoldRange:(NSRange)range -{ - [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didFoldRange:range]; - - [self.textView.layoutManager.foldingManager foldRange:range]; - - [self updateOffset]; -} +//#pragma mark - DVTFoldingManagerDelegate +// +//- (void)foldingManager:(DVTFoldingManager *)foldingManager didFoldRange:(NSRange)range +//{ +// [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didFoldRange:range]; +// +// [self.textView.layoutManager.foldingManager foldRange:range]; +// +// [self updateOffset]; +//} +// +//- (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRange)range +//{ +// [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didUnfoldRange:range]; +// +// [self.textView.layoutManager.foldingManager unfoldRange:range]; +// +// [self updateOffset]; +//} -- (void)foldingManager:(DVTFoldingManager *)foldingManager didUnfoldRange:(NSRange)range +- (id)foldingTokenTypesForLayoutManager:(DVTLayoutManager *)layoutManager { - [(DVTLayoutManager *)self.editorTextView.layoutManager foldingManager:foldingManager didUnfoldRange:range]; - - [self.textView.layoutManager.foldingManager unfoldRange:range]; - - [self updateOffset]; + return [self.editorTextView foldingTokenTypesForLayoutManager:layoutManager]; } #pragma mark - IDEEditorAreaMinimapDelegate @@ -507,11 +512,6 @@ - (void)layoutManagerDidRequestSelectedSymbolInstancesHighlight:(DVTLayoutManage [self invalidateHighligtedSymbols]; } -- (id) foldingTokenTypesForLayoutManager:(DVTLayoutManager *)layoutManager -{ - return nil; -} - #pragma mark - IDESourceCodeEditorSearchResultsDelegate - (void)sourceCodeEditorDidUpdateSearchResults:(IDESourceCodeEditor *)editor diff --git a/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h b/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h index 788d336..d40085d 100644 --- a/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h +++ b/SCXcodeMinimap/Xcode Headers/DVTSourceTextView.h @@ -6,70 +6,73 @@ #import "DVTCompletingTextView.h" -@class DVTAnnotationManager, DVTMutableRangeArray, DVTObservingToken, DVTTextAnnotationIndicatorAnimation, DVTTextDocumentLocation, DVTTextPageGuideVisualization, NSAnimation, NSArray, NSDictionary, NSHashTable, NSMutableArray, NSString, NSTimer, NSView, NSWindow; +@class DVTAnnotationManager, DVTMutableRangeArray, DVTObservingToken, DVTTextAnnotationIndicatorAnimation, DVTTextDocumentLocation, DVTTextPageGuideVisualization, NSAnimation, NSArray, NSColor, NSHashTable, NSMutableArray, NSMutableIndexSet, NSString, NSTimer, NSView, NSWindow; @interface DVTSourceTextView : DVTCompletingTextView { - unsigned long long _oldFocusLocation; - NSAnimation *_blockAnimation; - struct CGPoint _lastMouseMovedLocation; - struct _NSRange _foldingHoverRange; - DVTTextAnnotationIndicatorAnimation *_annotationIndicatorAnimation; - unsigned long long _temporaryLinkHoverModifierFlags; - unsigned long long _temporaryLinkHoverAltModifierFlags; - NSArray *_clickedTemporaryLinkRanges; - NSMutableArray *_clickedLinkProgressIndicators; - struct _NSRange _ghostStringRange; - NSTimer *_autoHighlightTokenMenuTimer; - struct _NSRange _autoHighlightTokenMenuRange; - double _autoHighlightTokenMenuAnimationDuration; - NSTimer *_autoHighlightTokenMenuAnimationTimer; - double _autoHighlightTokenMenuAnimationStartTime; - NSWindow *_autoHighlightTokenWindow; - NSArray *_foundLocations; - DVTTextDocumentLocation *_currentFoundLocation; - NSMutableArray *_visualizations; - unsigned long long _pageGuideColumn; - DVTTextPageGuideVisualization *_pageGuideVisualization; - unsigned long long _locationOfAutoOpenedCloseBracket; - unsigned long long _locationOfOpenBracePendingClose; - NSTimer *_scrollbarMarkerUpdateTimer; - DVTAnnotationManager *_annotationManager; - NSHashTable *_preparedViewAnnotations; - NSView *_staticVisualizationView; - int _findResultStyle; - DVTMutableRangeArray *_typeOverCompletionRanges; - DVTMutableRangeArray *_typeOverCompletionOpenRanges; - NSString *_pendingTypeOverCompletion; - struct _NSRange _pendingTypeOverCompletionOpenRange; - BOOL _didChangeText; - struct { - unsigned int dDidFinishAnimatingScroll:1; - unsigned int dDidScroll:1; - unsigned int dColoringContext:1; - unsigned int delegateRespondsToWillReturnPrintJobTitle:1; - unsigned int updatingInsertionPoint:1; - unsigned int wasPostsFrameChangedNotifications:1; - unsigned int doingDidChangeSelection:1; - unsigned int delegateRespondsToConstrainMinAccessoryAnnotationWidth:1; - unsigned int delegateRespondsToConstrainMaxAccessoryAnnotationWidth:1; - unsigned int delegateRespondsToConstrainAccessoryAnnotationWidth:1; - } _sFlags; - BOOL _isDoingBatchEdit; - BOOL _allowsCodeFolding; - BOOL _showingCodeFocus; - BOOL _lastMouseEventWasClick; - BOOL _tokenizedEditingEnabled; - BOOL _animatesCurrentScroll; - BOOL _disableUpdatingInsertionPointCount; - BOOL _currentlyAutoCompletingBracket; - BOOL _currentlyDoingNonUserEditing; - BOOL _wrapsLines; - BOOL _postsLayoutManagerNotifications; - BOOL _scrollingInScrollView; - DVTObservingToken *_autoHighlightTokenRangesObservingToken; - struct _NSRange _selectedRangeBeforeMouseDown; - BOOL _ensuringLayoutForScroll; + unsigned long long _oldFocusLocation; + NSAnimation *_blockAnimation; + struct CGPoint _lastMouseMovedLocation; + struct _NSRange _foldingHoverRange; + DVTTextAnnotationIndicatorAnimation *_annotationIndicatorAnimation; + unsigned long long _temporaryLinkHoverModifierFlags; + unsigned long long _temporaryLinkHoverAltModifierFlags; + NSArray *_clickedTemporaryLinkRanges; + NSMutableArray *_clickedLinkProgressIndicators; + struct _NSRange _ghostStringRange; + NSTimer *_autoHighlightTokenMenuTimer; + struct _NSRange _autoHighlightTokenMenuRange; + double _autoHighlightTokenMenuAnimationDuration; + NSTimer *_autoHighlightTokenMenuAnimationTimer; + double _autoHighlightTokenMenuAnimationStartTime; + NSWindow *_autoHighlightTokenWindow; + NSArray *_foundLocations; + DVTTextDocumentLocation *_currentFoundLocation; + NSMutableArray *_visualizations; + unsigned long long _pageGuideColumn; + DVTTextPageGuideVisualization *_pageGuideVisualization; + unsigned long long _locationOfAutoOpenedCloseBracket; + unsigned long long _locationOfOpenBracePendingClose; + NSTimer *_scrollbarMarkerUpdateTimer; + DVTAnnotationManager *_annotationManager; + NSHashTable *_preparedViewAnnotations; + NSView *_staticVisualizationView; + int _findResultStyle; + DVTMutableRangeArray *_typeOverCompletionRanges; + DVTMutableRangeArray *_typeOverCompletionOpenRanges; + NSString *_pendingTypeOverCompletion; + struct _NSRange _pendingTypeOverCompletionOpenRange; + NSMutableIndexSet *_linesNeedingToTrimTrailingShitespace; + BOOL _didChangeText; + struct { + unsigned int dDidFinishAnimatingScroll:1; + unsigned int dDidScroll:1; + unsigned int delegateRespondsToWillReturnPrintJobTitle:1; + unsigned int updatingInsertionPoint:1; + unsigned int wasPostsFrameChangedNotifications:1; + unsigned int doingDidChangeSelection:1; + unsigned int disableDrawingCurrentLineHighlight:1; + unsigned int delegateRespondsToConstrainMinAccessoryAnnotationWidth:1; + unsigned int delegateRespondsToConstrainMaxAccessoryAnnotationWidth:1; + unsigned int delegateRespondsToConstrainAccessoryAnnotationWidth:1; + } _sFlags; + BOOL _isDoingBatchEdit; + BOOL _allowsCodeFolding; + BOOL _showingCodeFocus; + BOOL _lastMouseEventWasClick; + BOOL _tokenizedEditingEnabled; + BOOL _animatesCurrentScroll; + BOOL _disableUpdatingInsertionPointCount; + BOOL _currentlyAutoCompletingBracket; + BOOL _wrapsLines; + BOOL _postsLayoutManagerNotifications; + BOOL _scrollingInScrollView; + DVTObservingToken *_autoHighlightTokenRangesObservingToken; + struct _NSRange _selectedRangeBeforeMouseDown; + BOOL _ensuringLayoutForScroll; + BOOL _suppressRecentColorTracking; + NSColor *_recentlySelectedColorToTrack; + struct _NSRange _recentlySelectedColorLiteralRange; } + (BOOL)isCompatibleWithResponsiveScrolling; @@ -79,6 +82,7 @@ + (id)foldingLogAspect; + (id)drawingLogAspect; + (void)initialize; + @property BOOL postsLayoutManagerNotifications; // @synthesize postsLayoutManagerNotifications=_postsLayoutManagerNotifications; @property int findResultStyle; // @synthesize findResultStyle=_findResultStyle; @property(nonatomic) unsigned long long pageGuideColumn; // @synthesize pageGuideColumn=_pageGuideColumn; @@ -87,6 +91,30 @@ @property unsigned long long temporaryLinkHoverAltModifierFlags; // @synthesize temporaryLinkHoverAltModifierFlags=_temporaryLinkHoverAltModifierFlags; @property unsigned long long temporaryLinkHoverModifierFlags; // @synthesize temporaryLinkHoverModifierFlags=_temporaryLinkHoverModifierFlags; @property(nonatomic) BOOL wrapsLines; // @synthesize wrapsLines=_wrapsLines; + +- (id)mediaResourceProviderForLiteralInLayoutManager:(id)arg1; +- (id)directoriesForLiteralInLayoutManager:(id)arg1; +- (id)foldingTokenTypesForLayoutManager:(id)arg1; +- (void)doubleClickedOnCell:(id)arg1 inRect:(struct CGRect)arg2 atIndexInToken:(unsigned long long)arg3; +- (void)colorQuickEdit:(id)arg1 didSelectMoreColorOptions:(id)arg2; +- (void)colorQuickEdit:(id)arg1 didSelectColor:(id)arg2; +- (void)colorQuickEdit:(id)arg1 didHighlightColor:(id)arg2; +- (void)imageQuickEdit:(id)arg1 didClickMoreButtonForFilePath:(id)arg2; +- (void)imageQuickEdit:(id)arg1 didSelectFilePath:(id)arg2; +- (void)fileQuickEdit:(id)arg1 didClickMoreButtonForFilePath:(id)arg2; +- (void)fileQuickEdit:(id)arg1 didSelectFilePath:(id)arg2; +- (void)changeColor:(id)arg1; +- (void)updateSelectedColorLiteralWithColor:(id)arg1; +- (void)presentOpenPanelForObjectLiteralAtFilePath:(id)arg1; +- (void)presentPopoverRelativeToSelection:(id)arg1; +- (void)insertObjectLiteralSyntaxForObjects:(id)arg1 selectLastObjectLiteral:(BOOL)arg2; +- (BOOL)readObjectLiteralFromPasteboard:(id)arg1 type:(id)arg2; +- (BOOL)readSelectionFromPasteboard:(id)arg1 type:(id)arg2; +- (id)readablePasteboardTypes; +- (BOOL)performDragOperation:(id)arg1; +- (unsigned long long)dragOperationForDraggingInfo:(id)arg1 type:(id)arg2; +- (id)acceptableDragTypes; +- (id)_addingRedablePasteboardTypesForObjectLiterals:(id)arg1; - (void)viewDidEndLiveResize; - (void)viewWillStartLiveResize; - (void)updateInsertionPointStateAndRestartTimer:(BOOL)arg1; @@ -116,7 +144,6 @@ - (void)foldRecursive:(id)arg1; - (void)fold:(id)arg1; - (BOOL)writeSelectionToPasteboard:(id)arg1 type:(id)arg2; -- (BOOL)writeRTFSelectionToPasteboard:(id)arg1; - (id)writablePasteboardTypes; - (void)balance:(id)arg1; - (void)shiftLeft:(id)arg1; @@ -126,7 +153,6 @@ - (void)indentSelectionIfIndentable:(id)arg1; - (void)indentSelection:(id)arg1; - (struct _NSRange)_adjustedSelectedRange:(struct _NSRange)arg1 fromChangeIndex:(unsigned long long)arg2; -- (void)commentAndUncommentCurrentLines:(id)arg1; - (void)moveCurrentLineDown:(id)arg1; - (void)moveCurrentLineUp:(id)arg1; - (void)_didChangeSelection:(id)arg1; @@ -140,7 +166,7 @@ - (id)accessibilityAXAttributedStringForCharacterRange:(struct _NSRange)arg1 parent:(id)arg2; - (BOOL)scrollRectToVisible:(struct CGRect)arg1; - (void)scrollPoint:(struct CGPoint)arg1; -- (void)setMarkedText:(id)arg1 selectedRange:(struct _NSRange)arg2; +- (void)setMarkedText:(id)arg1 selectedRange:(struct _NSRange)arg2 replacementRange:(struct _NSRange)arg3; - (BOOL)shouldChangeTextInRanges:(id)arg1 replacementStrings:(id)arg2; - (void)_invalidateAllRevealovers; - (BOOL)isEditable; @@ -168,7 +194,6 @@ - (void)textStorage:(id)arg1 willEndEditRange:(struct _NSRange)arg2 changeInLength:(long long)arg3; - (void)didEndTokenizedEditingWithRanges:(id)arg1; - (void)willStartTokenizedEditingWithRanges:(id)arg1; -- (void)tokenizableRangesWithRange:(struct _NSRange)arg1 completionBlock:(id)arg2; - (void)_scheduleAutoHighlightTokenMenuTimerIfNeeded; - (void)_showAutoHighlightTokenMenuWithTimer:(id)arg1; - (id)_autoHighlightTokenWindowWithTokenRect:(struct CGRect)arg1; @@ -182,8 +207,6 @@ - (void)_clearAutoHighlightTokenMenu; - (void)removeStaticVisualizationView; - (void)addStaticVisualizationView:(id)arg1; -- (void)removeVisualization:(id)arg1 fadeOut:(BOOL)arg2 completionBlock:(id)arg3; -- (void)addVisualization:(id)arg1 fadeIn:(BOOL)arg2 completionBlock:(id)arg3; - (void)adjustTypeOverCompletionForSelectionChange:(struct _NSRange)arg1; - (void)removeInvalidTypeOverCompletion; - (void)removeTypeOverCompletionIfAppropriateForEditedRange:(struct _NSRange)arg1 changeInLength:(long long)arg2; @@ -191,7 +214,7 @@ - (void)addTypeOverCompletionForRange:(struct _NSRange)arg1 openRange:(struct _NSRange)arg2; - (struct _NSRange)lastTypeOverCompletionRange; - (struct _NSRange)typeOverCompletionRangeFollowingLocation:(unsigned long long)arg1; -- (void)didInsertCompletionTextAtRange:(struct _NSRange)arg1; +- (void)textCompletionSession:(id)arg1 didInsertCompletionItem:(id)arg2 range:(struct _NSRange)arg3; - (struct _NSRange)_suggestedOpenRangeForTypeOverRange:(struct _NSRange)arg1; - (BOOL)shouldAutoCompleteAtLocation:(unsigned long long)arg1; - (BOOL)shouldSuppressTextCompletion; @@ -215,6 +238,7 @@ - (void)paste:(id)arg1; - (void)_paste:(id)arg1 indent:(BOOL)arg2; - (void)insertNewline:(id)arg1; +- (BOOL)handleInsertNewline; - (BOOL)handleInsertTab; - (BOOL)handleSelectPreviousPlaceholder; - (BOOL)handleSelectNextPlaceholder; @@ -240,6 +264,7 @@ - (void)mouseMoved:(id)arg1; - (void)_mouseInside:(id)arg1; - (void)resetCursorRects; +- (void)keyDown:(id)arg1; - (void)removeFromSuperview; - (void)viewDidMoveToWindow; - (void)_refreshScrollerMarkers; @@ -268,6 +293,7 @@ - (void)toggleCodeFocus:(id)arg1; - (BOOL)codeFocusFollowsSelection; - (void)_drawViewBackgroundInRect:(struct CGRect)arg1; +- (void)_drawCurrentLineHighlight:(struct CGRect)arg1; - (void)_drawCaretForTextAnnotationsInRect:(struct CGRect)arg1; - (void)drawTextAnnotationsInRect:(struct CGRect)arg1; - (long long)_drawRoundedBackgroundForFoldableBlockRangeAtLocation:(unsigned long long)arg1; @@ -275,14 +301,14 @@ - (id)alternateColor; - (void)setFoldingHoverRange:(struct _NSRange)arg1; - (struct _NSRange)foldingHoverRange; -- (void)_loadColorsFromCurrentTheme; -- (void)_themeColorsChanged:(id)arg1; +- (void)_loadFontsAndColorsFromTheme:(id)arg1; +- (void)_fontAndColorSettingsChanged:(id)arg1; - (void)_scheduleAnnotationLayout; - (void)drawRect:(struct CGRect)arg1; - (void)prepareContentInRect:(struct CGRect)arg1; - (unsigned long long)foldedCharacterIndexForPoint:(struct CGPoint)arg1; - (void)setSelectedRanges:(id)arg1 affinity:(unsigned long long)arg2 stillSelecting:(BOOL)arg3; -- (void)_delayedTrimTrailingWhitespaceForLine:(id)arg1; +- (void)_delayedTrimTrailingWhitespaceForLines; - (void)trimTrailingWhitespaceOnLine:(unsigned long long)arg1; - (void)_trimTrailingWhitespaceOnLineAfterIndent:(unsigned long long)arg1 trimWhitespaceOnlyLine:(BOOL)arg2; - (void)trimTrailingWhitespaceOnLine:(unsigned long long)arg1 trimWhitespaceOnlyLine:(BOOL)arg2; @@ -291,7 +317,6 @@ - (void)setSelectedRange:(struct _NSRange)arg1; - (void)contextMenu_toggleMessageBubbleShown:(id)arg1; - (void)toggleMessageBubbleShown:(id)arg1; -- (void)_enumerateMessageBubbleAnnotationsInSelection:(id)arg1; @property(readonly, getter=isAccessoryAnnotationCollapsed) BOOL accessoryAnnotationCollapsed; - (void)setAccessoryAnnotationWidth:(double)arg1; - (double)_maxAllowableAccessoryAnnotationWidth; @@ -314,9 +339,6 @@ - (struct _NSRange)lineNumberRangeForBoundingRect:(struct CGRect)arg1; - (unsigned long long)lineNumberForPoint:(struct CGPoint)arg1; - (id)printJobTitle; -- (void)setIsCurrentlyDoingNonUserEditing:(BOOL)arg1; -@property(readonly) BOOL isCurrentlyDoingNonUserEditing; -@property(readonly) NSDictionary *syntaxColoringContext; - (id)language; - (BOOL)allowsCodeFolding; - (void)setAllowsCodeFolding:(BOOL)arg1; @@ -324,6 +346,7 @@ - (void)setTextStorage:(id)arg1 keepOldLayout:(BOOL)arg2; - (void)setTextContainer:(id)arg1; - (id)initWithCoder:(id)arg1; +- (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1 textContainer:(id)arg2; - (void)_commonInitDVTSourceTextView; - (id)menuForEvent:(id)arg1; From 322c1878d710e18a316d08def0b6cbb919beb388 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 16 Aug 2018 07:49:00 +0300 Subject: [PATCH 95/96] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b4efc2..06dab39 100644 --- a/README.md +++ b/README.md @@ -40,4 +40,4 @@ Without editor highlighting | With editor highlighting SCXcodeMiniMap is released under the GNU GENERAL PUBLIC LICENSE (see the LICENSE file) #### Contact -Any suggestions or improvements are more than welcome. Feel free to contact me at [stefan.ceriu@yahoo.com](mailto:stefan.ceriu@yahoo.com) or [@stefanceriu](https://twitter.com/stefanceriu). +Any suggestions or improvements are more than welcome. Feel free to contact me at [stefan.ceriu@gmail.com](mailto:stefan.ceriu@gmail.com) or [@stefanceriu](https://twitter.com/stefanceriu). From b7c894838b2bff2eb699b3e0f18e0b2204f39fe9 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Fri, 19 Feb 2021 17:22:40 +0200 Subject: [PATCH 96/96] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 06dab39..0b24f13 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,12 @@ All options are configurable through the View/Minimap menu item #### Screenshots Without editor highlighting | With editor highlighting :--------------------------:|:--------------------------: -![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoakt2SGFVendkLTg) | ![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoSnBuS2R3SDNHM3M) | -![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltodHUwS3U1ZlV4NFU) | ![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoZWYtdnhRVFRDeU0) | +![](https://drive.google.com/u/0/uc?id=17cfIoUGJZc2I_21Zv4s0kqlb5uxkwplL&export=download) | ![](https://drive.google.com/u/0/uc?id=1sKzcMnu94IQAYwRyJnNAKiiBBOJkX9YC&export=download) | +![](https://drive.google.com/u/0/uc?id=1NSk0QTXnfX1A4CEja7_aRDb8d19YCiW3&export=download) | ![](https://drive.google.com/u/0/uc?id=1a-7Luigmw0RLZlaZy86URNd8l8aPx6dO&export=download) | -![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoN3Z1bl9aMS1zd1E) +![](https://drive.google.com/u/0/uc?id=14vYpfnPLlENWjYPtTtJQm1pmnivPp0rC&export=download) -![](https://drive.google.com/uc?export=download&id=0ByLCkUO90ltoMnQ0c3h3djZWU00) +![](https://drive.google.com/u/0/uc?id=1csskmT7_ToRYCUwT6eEep3ld5eOT63pj&export=download) #### Installation - Through [Alcatraz](https://github.com/alcatraz/Alcatraz)