Skip to content
Snippets Groups Projects
Commit 99c21863 authored by George Nachman's avatar George Nachman
Browse files

Additional cleanup

parent 791cad64
No related branches found
No related tags found
No related merge requests found
Showing
with 127 additions and 177 deletions
Loading
Loading
@@ -624,8 +624,6 @@
1DB40A431B1FDC80005B83C7 /* NoColor@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1DB40A3F1B1FDC75005B83C7 /* NoColor@2x.png */; };
1DB40AA11B221028005B83C7 /* iTermNoColorAccessoryButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DB40A9F1B221028005B83C7 /* iTermNoColorAccessoryButton.h */; };
1DB40AA21B221028005B83C7 /* iTermNoColorAccessoryButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DB40A9F1B221028005B83C7 /* iTermNoColorAccessoryButton.h */; };
1DB40AA81B221088005B83C7 /* iTermTwoColorWellsCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DB40AA61B221088005B83C7 /* iTermTwoColorWellsCell.h */; };
1DB40AA91B221088005B83C7 /* iTermTwoColorWellsCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DB40AA61B221088005B83C7 /* iTermTwoColorWellsCell.h */; };
1DB40AB51B27B577005B83C7 /* PTYTabDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DB40AB41B27B577005B83C7 /* PTYTabDelegate.h */; };
1DB40AB61B27B577005B83C7 /* PTYTabDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DB40AB41B27B577005B83C7 /* PTYTabDelegate.h */; };
1DB67CED14850D53005849A1 /* TmuxWindowOpener.h in Headers */ = {isa = PBXBuildFile; fileRef = 1DB67CEB14850D53005849A1 /* TmuxWindowOpener.h */; };
Loading
Loading
@@ -1344,7 +1342,6 @@
A6C763471B45C52B00E3C992 /* iTermSearchField.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DAED99112EDF923005E49ED /* iTermSearchField.m */; };
A6C763481B45C52B00E3C992 /* iTermShortcutInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D373E4818F3613600773D3E /* iTermShortcutInputView.m */; };
A6C763491B45C52B00E3C992 /* iTermTabBarControlView.m in Sources */ = {isa = PBXBuildFile; fileRef = A6C537BD1938374600A08C18 /* iTermTabBarControlView.m */; };
A6C7634B1B45C52B00E3C992 /* iTermTwoColorWellsCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DB40AA71B221088005B83C7 /* iTermTwoColorWellsCell.m */; };
A6C7634C1B45C52B00E3C992 /* PasteView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D085F9116F03E5400B7FCE9 /* PasteView.m */; };
A6C7634D1B45C52B00E3C992 /* PTYNoteView.m in Sources */ = {isa = PBXBuildFile; fileRef = A63F4099183B3AA7003A6A6D /* PTYNoteView.m */; };
A6C7634E1B45C52B00E3C992 /* RoundedRectView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D085F9D16F137D900B7FCE9 /* RoundedRectView.m */; };
Loading
Loading
@@ -1942,8 +1939,6 @@
1DB40A3F1B1FDC75005B83C7 /* NoColor@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "NoColor@2x.png"; path = "images/NoColor@2x.png"; sourceTree = "<group>"; };
1DB40A9F1B221028005B83C7 /* iTermNoColorAccessoryButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iTermNoColorAccessoryButton.h; sourceTree = "<group>"; };
1DB40AA01B221028005B83C7 /* iTermNoColorAccessoryButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iTermNoColorAccessoryButton.m; sourceTree = "<group>"; };
1DB40AA61B221088005B83C7 /* iTermTwoColorWellsCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iTermTwoColorWellsCell.h; sourceTree = "<group>"; };
1DB40AA71B221088005B83C7 /* iTermTwoColorWellsCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iTermTwoColorWellsCell.m; sourceTree = "<group>"; };
1DB40AB41B27B577005B83C7 /* PTYTabDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PTYTabDelegate.h; sourceTree = "<group>"; };
1DB67CEB14850D53005849A1 /* TmuxWindowOpener.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = TmuxWindowOpener.h; sourceTree = "<group>"; tabWidth = 4; };
1DB67CEC14850D53005849A1 /* TmuxWindowOpener.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = TmuxWindowOpener.m; sourceTree = "<group>"; tabWidth = 4; };
Loading
Loading
@@ -2934,7 +2929,6 @@
1DA76A031B30892900CB272A /* iTermTipWindowController.h */,
A667F38D1B49FC2E00705186 /* iTermToolbeltSplitView.h */,
1DE8DC871415513A00F83147 /* iTermToolbeltView.h */,
1DB40AA61B221088005B83C7 /* iTermTwoColorWellsCell.h */,
A6E713B818FCCDD1008D94DD /* iTermURLSchemeController.h */,
A6099B0318D6B0FD00081FA9 /* iTermWarning.h */,
A66A1FA61A3A207900F4A3A7 /* iTermWindowShortcutLabelTitlebarAccessoryViewController.h */,
Loading
Loading
@@ -3408,7 +3402,6 @@
1DAED99112EDF923005E49ED /* iTermSearchField.m */,
1D373E4818F3613600773D3E /* iTermShortcutInputView.m */,
A6C537BD1938374600A08C18 /* iTermTabBarControlView.m */,
1DB40AA71B221088005B83C7 /* iTermTwoColorWellsCell.m */,
1D085F9116F03E5400B7FCE9 /* PasteView.m */,
A63F4099183B3AA7003A6A6D /* PTYNoteView.m */,
1D085F9D16F137D900B7FCE9 /* RoundedRectView.m */,
Loading
Loading
@@ -4252,7 +4245,6 @@
1D6ED8B619AEA20D005A7799 /* PTYWindow+Scripting.h in Headers */,
1D6ED8B719AEA20D005A7799 /* PasswordTrigger.h in Headers */,
1D6ED8B819AEA20D005A7799 /* AppearancePreferencesViewController.h in Headers */,
1DB40AA91B221088005B83C7 /* iTermTwoColorWellsCell.h in Headers */,
1D6ED8B919AEA20D005A7799 /* iTermExposeView.h in Headers */,
1D6ED8BA19AEA20D005A7799 /* PasteboardHistory.h in Headers */,
1D6ED8BB19AEA20D005A7799 /* NSDateFormatterExtras.h in Headers */,
Loading
Loading
@@ -4605,7 +4597,6 @@
1DA76A061B30892900CB272A /* iTermTipWindowController.h in Headers */,
1DF8006F18F34CAB00722B35 /* NSPopUpButton+iTerm.h in Headers */,
A69B4585196F8EA100F5444D /* iTermOpenQuicklyWindowController.h in Headers */,
1DB40AA81B221088005B83C7 /* iTermTwoColorWellsCell.h in Headers */,
A6C7DE52199F3087001E5C75 /* PTYWindow+Scripting.h in Headers */,
1D468F041B06A79000226083 /* StopTrigger.h in Headers */,
A66A1FA81A3A207900F4A3A7 /* iTermWindowShortcutLabelTitlebarAccessoryViewController.h in Headers */,
Loading
Loading
@@ -5927,7 +5918,6 @@
A6C763C61B45C52B00E3C992 /* VT100State.m in Sources */,
A6C762CA1B45C52B00E3C992 /* iTermApplicationDelegate.m in Sources */,
A6C762C11B45C52B00E3C992 /* NSTextField+iTerm.m in Sources */,
A6C7634B1B45C52B00E3C992 /* iTermTwoColorWellsCell.m in Sources */,
A6C762B51B45C52B00E3C992 /* NSEvent+iTerm.m in Sources */,
A6C763E61B45C70100E3C992 /* SCEvents.m in Sources */,
);
Loading
Loading
Loading
Loading
@@ -21,7 +21,7 @@
NSNumber *n3 = [NSNumber numberWithInt:12];
EquivalenceClassSet *e = [[[EquivalenceClassSet alloc] init] autorelease];
[e setValue:n1 equalToValue:n2];
NSArray *ec = [e valuesEqualTo:n1];
NSSet *ec = [e valuesEqualTo:n1];
XCTAssert(ec.count == 2);
XCTAssert([ec containsObject:n1]);
XCTAssert([ec containsObject:n2]);
Loading
Loading
@@ -41,7 +41,7 @@
EquivalenceClassSet *e = [[[EquivalenceClassSet alloc] init] autorelease];
[e setValue:n1 equalToValue:n2];
[e setValue:n1 equalToValue:n2];
NSArray *ec = [e valuesEqualTo:n1];
NSSet *ec = [e valuesEqualTo:n1];
XCTAssert(ec.count == 2);
XCTAssert([ec containsObject:n1]);
XCTAssert([ec containsObject:n2]);
Loading
Loading
@@ -56,7 +56,7 @@
[e setValue:n1 equalToValue:n2];
[e setValue:n3 equalToValue:n4];
 
NSArray *ec = [e valuesEqualTo:n1];
NSSet *ec = [e valuesEqualTo:n1];
XCTAssert(ec.count == 2);
XCTAssert([ec containsObject:n1]);
XCTAssert([ec containsObject:n2]);
Loading
Loading
@@ -82,7 +82,7 @@
EquivalenceClassSet *e = [[[EquivalenceClassSet alloc] init] autorelease];
[e setValue:n1 equalToValue:n2];
[e setValue:n1 equalToValue:n3];
NSArray *ec = [e valuesEqualTo:n1];
NSSet *ec = [e valuesEqualTo:n1];
XCTAssert(ec.count == 3);
XCTAssert([ec containsObject:n1]);
XCTAssert([ec containsObject:n2]);
Loading
Loading
@@ -96,7 +96,7 @@
EquivalenceClassSet *e = [[[EquivalenceClassSet alloc] init] autorelease];
[e setValue:n1 equalToValue:n2];
[e setValue:n3 equalToValue:n1];
NSArray *ec = [e valuesEqualTo:n1];
NSSet *ec = [e valuesEqualTo:n1];
XCTAssert(ec.count == 3);
XCTAssert([ec containsObject:n1]);
XCTAssert([ec containsObject:n2]);
Loading
Loading
@@ -111,7 +111,7 @@
[e setValue:n1 equalToValue:n2];
[e setValue:n3 equalToValue:n1];
[e removeValue:n2];
NSArray *ec = [e valuesEqualTo:n1];
NSSet *ec = [e valuesEqualTo:n1];
XCTAssert(ec.count == 2);
XCTAssert([ec containsObject:n1]);
XCTAssert([ec containsObject:n3]);
Loading
Loading
@@ -123,7 +123,7 @@
EquivalenceClassSet *e = [[[EquivalenceClassSet alloc] init] autorelease];
[e setValue:n1 equalToValue:n2];
[e removeValue:n2];
NSArray *ec = [e valuesEqualTo:n1];
NSSet *ec = [e valuesEqualTo:n1];
XCTAssert(!ec);
}
 
Loading
Loading
Loading
Loading
@@ -32,36 +32,33 @@
@implementation DVRBuffer {
// Points to start of large circular buffer.
char* store_;
// Points into store_ after -[reserve:] is called.
char* scratch_;
// Total size of storage in bytes.
long long capacity_;
// Maps a frame key number to DVRIndexEntry*.
NSMutableDictionary* index_;
// First key in index.
long long firstKey_;
// Next key number to add to index.
long long nextKey_;
// begin may be before or after end. If "-" is an allocated byte and "." is
// a free byte then you can have one of two cases:
//
// begin------end.....
// ----end....begin---
// Beginning of circular buffer's used region.
long long begin_;
// Non-inclusive end of circular buffer's used regino.
long long end_;
// this must always equal index_.
id sanityCheck; // TODO(georgen): remove this after the source of corruption of index_ is found
}
 
- (instancetype)initWithBufferCapacity:(long long)maxsize
Loading
Loading
@@ -71,7 +68,6 @@
capacity_ = maxsize;
store_ = malloc(maxsize);
index_ = [[NSMutableDictionary alloc] init];
sanityCheck = index_;
firstKey_ = 0;
nextKey_ = 0;
begin_ = 0;
Loading
Loading
@@ -82,17 +78,14 @@
 
- (void)dealloc
{
assert(index_ == sanityCheck);
[index_ release];
index_ = nil;
sanityCheck = nil;
free(store_);
[super dealloc];
}
 
- (BOOL)reserve:(long long)length
{
assert(index_ == sanityCheck);
BOOL hadToFree = NO;
while (![self hasSpaceAvailable:length]) {
assert(nextKey_ > firstKey_);
Loading
Loading
@@ -108,13 +101,11 @@
} else {
scratch_ = store_ + end_;
}
assert(index_ == sanityCheck);
return hadToFree;
}
 
- (long long)allocateBlock:(long long)length
{
assert(index_ == sanityCheck);
assert([self hasSpaceAvailable:length]);
DVRIndexEntry* entry = [[DVRIndexEntry alloc] init];
entry->position = scratch_ - store_;
Loading
Loading
@@ -125,33 +116,27 @@
long long key = nextKey_++;
[index_ setObject:entry forKey:[NSNumber numberWithLongLong:key]];
[entry release];
assert(index_ == sanityCheck);
 
return key;
}
 
- (void)deallocateBlock
{
assert(index_ == sanityCheck);
long long key = firstKey_++;
DVRIndexEntry* entry = [self entryForKey:key];
begin_ = entry->position + entry->frameLength;
[index_ removeObjectForKey:[NSNumber numberWithLongLong:key]];
assert(index_ == sanityCheck);
}
 
- (void*)blockForKey:(long long)key
{
assert(index_ == sanityCheck);
DVRIndexEntry* entry = [self entryForKey:key];
assert(entry);
assert(index_ == sanityCheck);
return store_ + entry->position;
}
 
- (BOOL)hasSpaceAvailable:(long long)length
{
assert(index_ == sanityCheck);
if (begin_ <= end_) {
// ---begin*******end-----
if (capacity_ - end_ > length) {
Loading
Loading
@@ -173,38 +158,32 @@
 
- (long long)firstKey
{
assert(index_ == sanityCheck);
return firstKey_;
}
 
- (long long)lastKey
{
assert(index_ == sanityCheck);
return nextKey_ - 1;
}
 
- (DVRIndexEntry*)entryForKey:(long long)key
{
assert(index_ == sanityCheck);
assert(index_);
return [index_ objectForKey:[NSNumber numberWithLongLong:key]];
}
 
- (char*)scratch
{
assert(index_ == sanityCheck);
return scratch_;
}
 
- (long long)capacity
{
assert(index_ == sanityCheck);
return capacity_;
}
 
- (BOOL)isEmpty
{
assert(index_ == sanityCheck);
return [index_ count] == 0;
}
 
Loading
Loading
Loading
Loading
@@ -45,16 +45,16 @@
@implementation DVRDecoder {
// Circular buffer not owned by us.
DVRBuffer* buffer_;
// Most recent frame's metadata.
DVRFrameInfo info_;
// Most recent frame.
char* frame_;
// Length of frame.
int length_;
// Most recent frame's key (not timestamp).
long long key_;
}
Loading
Loading
Loading
Loading
@@ -64,22 +64,22 @@ static long long now()
@implementation DVREncoder {
// Underlying buffer to write to. Not owned by us.
DVRBuffer* buffer_;
// The last encoded frame.
NSMutableData* lastFrame_;
// Info from the last frame.
DVRFrameInfo lastInfo_;
// Number of frames. Used to ensure key frames are encoded every so often.
int count_;
// Used to ensure that reserve is called before appendFrame.
BOOL haveReservation_;
// Used to ensure a key frame is encoded before the circular buffer wraps.
long long bytesSinceLastKeyFrame_;
// Number of bytes reserved.
int reservation_;
}
Loading
Loading
#import <Foundation/Foundation.h>
 
@interface EquivalenceClassSet : NSObject
// Stores a set of equivalence classes. You can define that two objects are equal and then query for
// the set of objects that are equal to some query object. For example, you can say that @1, @2, and
// @3 are equivalent and that @4 and @5 are equivalent. A query for the values equal to @1 will
// give [ @1, @2, @3 ].
@interface EquivalenceClassSet : NSObject
 
@property(nonatomic, readonly) NSArray<Class> *classes;
// All equivalence classes. The type is hard to read, but it's an array of sets, where each set
// contains the objects that are equivalent.
@property(nonatomic, readonly) NSArray<NSSet<NSObject<NSCopying> *> *> *classes;
 
- (NSArray *)valuesEqualTo:(NSObject<NSCopying> *)target;
- (NSSet<NSObject<NSCopying> *> *)valuesEqualTo:(NSObject<NSCopying> *)target;
- (void)setValue:(NSObject<NSCopying> *)value equalToValue:(NSObject<NSCopying> *)otherValue;
- (void)removeValue:(NSObject<NSCopying> *)target;
 
Loading
Loading
#import "EquivalenceClassSet.h"
 
@implementation EquivalenceClassSet {
NSMutableDictionary *index_;
NSMutableDictionary *classes_;
// Maps objects belonging to an equivalence class to their class's number.
NSMutableDictionary<NSObject<NSCopying> *, NSNumber *> *index_;
// Maps a class's number to the objects that belong to it.
NSMutableDictionary<NSNumber *, NSMutableSet<NSObject<NSCopying> *> *> *classes_;
}
 
- (instancetype)init {
Loading
Loading
@@ -14,61 +17,56 @@
return self;
}
 
- (void)dealloc
{
- (void)dealloc {
[index_ release];
[classes_ release];
[super dealloc];
}
 
- (NSArray *)valuesEqualTo:(NSObject *)target
{
NSNumber *ec = [index_ objectForKey:target];
return ec ? [classes_ objectForKey:ec] : nil;
- (NSSet<NSObject<NSCopying> *> *)valuesEqualTo:(NSObject<NSCopying> *)target {
NSNumber *ec = index_[target];
return ec ? classes_[ec] : nil;
}
 
- (void)addValue:(NSObject<NSCopying> *)value toClass:(NSNumber *)ec
{
- (void)addValue:(NSObject<NSCopying> *)value toClass:(NSNumber *)ec {
[self removeValue:value];
[index_ setObject:ec forKey:value];
NSMutableSet *theSet = [classes_ objectForKey:ec];
index_[value] = ec;
NSMutableSet<NSObject<NSCopying> *> *theSet = classes_[ec];
if (!theSet) {
theSet = [NSMutableSet set];
[classes_ setObject:theSet forKey:ec];
classes_[ec] = theSet;
}
[theSet addObject:value];
}
 
- (NSNumber *)addEquivalenceClass
{
- (NSNumber *)addEquivalenceClass {
int i = 0;
while ([classes_ objectForKey:[NSNumber numberWithInt:i]]) {
while (classes_[@(i)]) {
i++;
}
return [NSNumber numberWithInt:i];
return @(i);
}
 
- (void)setValue:(NSObject<NSCopying> *)n1 equalToValue:(NSObject<NSCopying> *)n2
{
NSNumber *n1Class = [index_ objectForKey:n1];
NSNumber *n2Class = [index_ objectForKey:n2];
- (void)setValue:(NSObject<NSCopying> *)n1 equalToValue:(NSObject<NSCopying> *)n2 {
NSNumber *n1Class = index_[n1];
NSNumber *n2Class = index_[n2];
if (n1Class) {
if (n2Class) {
if ([n1Class intValue] != [n2Class intValue]) {
// Merge the equivalence classes. Move every value in n2's class
// (including n2, of course) into n1's.
for (NSNumber *n in [[[classes_ objectForKey:n2Class] copy] autorelease]) {
for (NSNumber *n in [[classes_[n2Class] copy] autorelease]) {
[self addValue:n toClass:n1Class];
}
}
} else {
// n2 does not belong to an existing equiv class yet so add it to n1's class
// n2 does not belong to an existing equivalence class yet so add it to n1's class
[self addValue:n2 toClass:n1Class];
}
} else {
// n1 does not have an equiv relation yet
// n1 does not have an equivalence relation yet
if (n2Class) {
// n2 has an equiv relation already so add n1 to it
// n2 has an equivalence relation already so add n1 to it
[self addValue:n1 toClass:n2Class];
} else {
// Neither n1 nor n2 has an existing relation so create a new equivalence class
Loading
Loading
@@ -79,13 +77,12 @@
}
}
 
- (void)removeValue:(NSObject<NSCopying> *)target
{
NSNumber *ec = [index_ objectForKey:target];
- (void)removeValue:(NSObject<NSCopying> *)target {
NSNumber *ec = index_[target];
if (!ec) {
return;
}
NSMutableSet *c = [classes_ objectForKey:ec];
NSMutableSet *c = classes_[ec];
[c removeObject:target];
[index_ removeObjectForKey:target];
if (!c.count) {
Loading
Loading
@@ -96,9 +93,8 @@
}
}
 
- (NSArray *)classes
{
return [classes_ allValues];
- (NSArray *)classes {
return [classes_ allValues];
}
 
@end
Loading
Loading
@@ -8,7 +8,7 @@
**
** Project: iTerm2
**
** Description: Shell window that takes over for a session during instant
** Description: Shell window that takes over for a session during instant
** replay.
**
** This program is free software; you can redistribute it and/or modify
Loading
Loading
@@ -33,7 +33,7 @@
@implementation FakeWindow {
// FakeWindow always has exactly one session.
PTYSession* session;
// Saved state from old window.
BOOL isFullScreen;
BOOL isLionFullScreen;
Loading
Loading
@@ -41,7 +41,7 @@
NSRect frame;
NSScreen* screen;
NSWindowController<iTermWindowController> * realWindow;
// Changes the session has initiated that will be delayed and performed
// in -[rejoin:].
BOOL hasPendingBlurChange;
Loading
Loading
@@ -54,7 +54,7 @@
int pendingH;
BOOL hasPendingSetWindowTitle;
BOOL hasPendingResetTempTitle;
BOOL scrollbarShouldBeVisible;
}
 
Loading
Loading
Loading
Loading
@@ -50,8 +50,9 @@
 
@interface GlobalSearch : NSViewController <NSTableViewDataSource>
 
@property(nonatomic, readonly) int numResults;
- (void)setDelegate:(id<GlobalSearchDelegate>)delegate;
- (int)numResults;
- (void)abort;
 
@end
Loading
Loading
@@ -10,9 +10,6 @@
 
@interface HighlightTrigger : Trigger
 
@property(nonatomic, readonly) BOOL takesParameter;
@property(nonatomic, readonly) BOOL paramIsPopupButton;
+ (NSString *)title;
 
@end
Loading
Loading
@@ -206,7 +206,7 @@ typedef enum {
WINDOW_TYPE_NORMAL = 0,
WINDOW_TYPE_TRADITIONAL_FULL_SCREEN = 1, // Pre-Lion fullscreen
// note: 2 is out of order below
// Type 3 is deprecated and used to be used internally to create a
// fullscreen window during toggling.
 
Loading
Loading
@@ -245,7 +245,7 @@ typedef NS_ENUM(NSInteger, iTermObjectType) {
+ (NSFont *)fontWithDesc:(NSString *)fontDesc;
 
// This is deprecated in favor of -[NSString fontValue] and -[NSFont stringValue].
+ (NSString*)descFromFont:(NSFont*)font;
+ (NSString*)descFromFont:(NSFont*)font __attribute__((deprecated));
+ (NSString*)bookmarkCommand:(Profile*)bookmark
forObjectType:(iTermObjectType)objectType;
+ (NSString*)bookmarkWorkingDirectory:(Profile*)bookmark
Loading
Loading
Loading
Loading
@@ -20,11 +20,12 @@
- (BOOL)intersectsRange:(IntRange *)other;
- (instancetype)intersectionWithRange:(IntRange *)other;
- (int)limit;
- (NSArray<IntRange*> *)rangesAfterSubtractingRange:(IntRange *)other;
- (NSArray<IntRange *> *)rangesAfterSubtractingRange:(IntRange *)other;
 
@end
 
@interface IntervalMap : NSObject
// Maps a range of integers to an object. There is special handling for objects that are numbers.
@interface IntervalMap : NSObject
 
- (void)setObject:(id)object forRange:(IntRange *)range;
- (void)incrementNumbersBy:(int)amount inRange:(IntRange *)range;
Loading
Loading
Loading
Loading
@@ -808,8 +808,7 @@ static NSString* RewrittenRegex(NSString* originalRegex) {
 
static int CoreSearch(NSString* needle, screen_char_t* rawline, int raw_line_length, int start, int end,
FindOptions options, int* resultLength, NSString* haystack, unichar* charHaystack,
int* deltas, int deltaOffset)
{
int* deltas, int deltaOffset) {
int apiOptions = 0;
NSRange range;
BOOL regex;
Loading
Loading
Loading
Loading
@@ -657,8 +657,7 @@ static int RawNumLines(LineBuffer* buffer, int width) {
- (void)prepareToSearchFor:(NSString*)substring
startingAt:(LineBufferPosition *)start
options:(FindOptions)options
withContext:(FindContext*)context
{
withContext:(FindContext*)context {
context.substring = substring;
context.options = options;
if (options & FindOptBackwards) {
Loading
Loading
Loading
Loading
@@ -8,12 +8,7 @@
 
#import <Foundation/Foundation.h>
 
@interface MovingAverage : NSObject {
double _alpha;
double _value;
NSTimeInterval _time; // Time when -startTimer was called, or 0 if stopped.
NSTimeInterval _timePaused; // Time at which -pauseTimer was called.
}
@interface MovingAverage : NSObject
 
@property(nonatomic, assign) double alpha; // Initialized to 0.5. Small values make updates affect the moving average more.
@property(nonatomic, assign) double value;
Loading
Loading
Loading
Loading
@@ -8,10 +8,10 @@
 
#import "MovingAverage.h"
 
@implementation MovingAverage
@synthesize alpha = _alpha;
@synthesize value = _value;
@implementation MovingAverage {
NSTimeInterval _time; // Time when -startTimer was called, or 0 if stopped.
NSTimeInterval _timePaused; // Time at which -pauseTimer was called.
}
 
- (instancetype)init {
self = [super init];
Loading
Loading
Loading
Loading
@@ -33,17 +33,11 @@
 
@property(nonatomic, assign) BOOL userScroll;
 
+ (BOOL)isCompatibleWithOverlayScrollers;
- (void)mouseDown: (NSEvent *)theEvent;
- (void)trackScrollButtons:(NSEvent *)theEvent;
- (void)trackKnob:(NSEvent *)theEvent;
@end
 
@interface PTYScrollView : NSScrollView
 
- (instancetype)initWithFrame:(NSRect)frame hasVerticalScroller:(BOOL)hasVerticalScroller;
- (void)scrollWheel:(NSEvent *)theEvent;
- (void)detectUserScroll;
- (BOOL)isLegacyScroller;
 
Loading
Loading
Loading
Loading
@@ -46,12 +46,39 @@
@property(nonatomic, readonly) NSSize tmuxSize;
@property(nonatomic, readonly) NSSize maxTmuxSize;
@property(nonatomic, copy) NSString *tmuxWindowName;
@property (readonly, getter=isTmuxTab) BOOL tmuxTab;
 
// Save the contents of all sessions. Used during window restoration so that if
// the sessions are later restored from a saved arrangement during startup
// activities, their contents can be rescued.
+ (void)registerSessionsInArrangement:(NSDictionary *)arrangement;
 
+ (NSDictionary *)tmuxBookmark;
+ (void)drawArrangementPreview:(NSDictionary*)arrangement frame:(NSRect)frame;
+ (PTYTab *)openTabWithArrangement:(NSDictionary*)arrangement
inTerminal:(NSWindowController<iTermWindowController> *)term
hasFlexibleView:(BOOL)hasFlexible
viewMap:(NSDictionary *)viewMap;
+ (PTYTab *)tabWithArrangement:(NSDictionary*)arrangement
inTerminal:(NSWindowController<iTermWindowController> *)term
hasFlexibleView:(BOOL)hasFlexible
viewMap:(NSDictionary *)viewMap;
+ (NSDictionary *)viewMapWithArrangement:(NSDictionary *)arrangement sessions:(NSArray *)sessions;
+ (PTYTab *)openTabWithTmuxLayout:(NSMutableDictionary *)parseTree
inTerminal:(NSWindowController<iTermWindowController> *)term
tmuxWindow:(int)tmuxWindow
tmuxController:(TmuxController *)tmuxController;
+ (void)setTmuxFont:(NSFont *)font
nonAsciiFont:(NSFont *)nonAsciiFont
hSpacing:(double)hs
vSpacing:(double)vs;
// init/dealloc
- (instancetype)initWithSession:(PTYSession*)session;
- (instancetype)initWithRoot:(NSSplitView*)root;
Loading
Loading
@@ -77,7 +104,6 @@
- (void)sessionInitiatedResize:(PTYSession*)session width:(int)width height:(int)height;
- (NSSize)sessionSizeForViewSize:(PTYSession *)aSession;
- (BOOL)fitSessionToCurrentViewSize:(PTYSession*)aSession;
+ (NSDictionary *)tmuxBookmark;
// Fit session views to scroll views.
// This is useful for a tmux tab where scrollviews sizes are not tightly coupled to the
// SessionView size because autoresizing is turned off. When something changes, such as
Loading
Loading
@@ -139,23 +165,9 @@
- (NSSize)_recursiveMinSize:(NSSplitView*)node;
- (PTYSession*)_recursiveSessionAtPoint:(NSPoint)point relativeTo:(NSView*)node;
 
+ (void)drawArrangementPreview:(NSDictionary*)arrangement frame:(NSRect)frame;
// A viewMap maps a session's unique ID to a SessionView. Views in the
// arrangement with matching session unique IDs will be assigned those
// SessionView's.
+ (PTYTab *)openTabWithArrangement:(NSDictionary*)arrangement
inTerminal:(NSWindowController<iTermWindowController> *)term
hasFlexibleView:(BOOL)hasFlexible
viewMap:(NSDictionary *)viewMap;
+ (PTYTab *)tabWithArrangement:(NSDictionary*)arrangement
inTerminal:(NSWindowController<iTermWindowController> *)term
hasFlexibleView:(BOOL)hasFlexible
viewMap:(NSDictionary *)viewMap;
+ (NSDictionary *)viewMapWithArrangement:(NSDictionary *)arrangement sessions:(NSArray *)sessions;
- (void)updateFlexibleViewColors;
- (NSDictionary*)arrangement;
 
Loading
Loading
@@ -174,19 +186,9 @@
- (void)resizeViewsInViewHierarchy:(NSView *)view
forNewLayout:(NSMutableDictionary *)parseTree;
- (void)reloadTmuxLayout;
+ (PTYTab *)openTabWithTmuxLayout:(NSMutableDictionary *)parseTree
inTerminal:(NSWindowController<iTermWindowController> *)term
tmuxWindow:(int)tmuxWindow
tmuxController:(TmuxController *)tmuxController;
+ (void)setTmuxFont:(NSFont *)font
nonAsciiFont:(NSFont *)nonAsciiFont
hSpacing:(double)hs
vSpacing:(double)vs;
// Size we are given the current layout
 
- (int)tmuxWindow;
@property (readonly, getter=isTmuxTab) BOOL tmuxTab;
- (void)setTmuxLayout:(NSMutableDictionary *)parseTree
tmuxController:(TmuxController *)tmuxController;
// Returns true if the tmux layout is too large for the window to accommodate.
Loading
Loading
Loading
Loading
@@ -9,13 +9,12 @@
#import "PasteContext.h"
#import "iTermAdvancedSettingsModel.h"
 
@implementation PasteContext {
NSString *bytesPerCallKey_;
NSString *delayBetweenCallsKey_;
}
@interface PasteContext ()
@property(nonatomic, copy) NSString *bytesPerCallKey;
@property(nonatomic, copy) NSString *delayBetweenCallsKey;
@end
 
@synthesize delayBetweenCalls = delayBetweenCalls_;
@synthesize bytesPerCall = bytesPerCall_;
@implementation PasteContext
 
- (instancetype)initWithBytesPerCallPrefKey:(NSString*)bytesPerCallKey
defaultValue:(int)bytesPerCallDefault
Loading
Loading
@@ -24,44 +23,36 @@
{
self = [super init];
if (self) {
bytesPerCallKey_ = [bytesPerCallKey copy];
bytesPerCall_ = bytesPerCallDefault;
delayBetweenCallsKey_ = [delayBetweenCallsKey copy];
delayBetweenCalls_ = delayBetweenCallsDefault;
_bytesPerCallKey = [bytesPerCallKey copy];
_bytesPerCall = bytesPerCallDefault;
_delayBetweenCallsKey = [delayBetweenCallsKey copy];
_delayBetweenCalls = delayBetweenCallsDefault;
[self updateValues];
}
return self;
}
 
- (void)updateValues {
if (bytesPerCallKey_ && [[NSUserDefaults standardUserDefaults] objectForKey:bytesPerCallKey_]) {
bytesPerCall_ = [[NSUserDefaults standardUserDefaults] integerForKey:bytesPerCallKey_];
if (_bytesPerCallKey && [[NSUserDefaults standardUserDefaults] objectForKey:_bytesPerCallKey]) {
_bytesPerCall = [[NSUserDefaults standardUserDefaults] integerForKey:_bytesPerCallKey];
}
if (delayBetweenCallsKey_ && [[NSUserDefaults standardUserDefaults] objectForKey:delayBetweenCallsKey_]) {
delayBetweenCalls_ = [[NSUserDefaults standardUserDefaults] floatForKey:delayBetweenCallsKey_];
if (_delayBetweenCallsKey && [[NSUserDefaults standardUserDefaults] objectForKey:_delayBetweenCallsKey]) {
_delayBetweenCalls = [[NSUserDefaults standardUserDefaults] floatForKey:_delayBetweenCallsKey];
}
}
 
- (int)bytesPerCall {
return bytesPerCall_;
}
- (void)setBytesPerCall:(int)newBytesPerCall {
bytesPerCall_ = newBytesPerCall;
if (bytesPerCallKey_) {
[[NSUserDefaults standardUserDefaults] setInteger:bytesPerCall_ forKey:bytesPerCallKey_];
_bytesPerCall = newBytesPerCall;
if (_bytesPerCallKey) {
[[NSUserDefaults standardUserDefaults] setInteger:_bytesPerCall forKey:_bytesPerCallKey];
}
}
 
- (float)delayBetweenCalls {
return delayBetweenCalls_;
}
- (void)setDelayBetweenCalls:(float)newDelayBetweenCalls {
delayBetweenCalls_ = newDelayBetweenCalls;
if (delayBetweenCallsKey_) {
_delayBetweenCalls = newDelayBetweenCalls;
if (_delayBetweenCallsKey) {
[[NSUserDefaults standardUserDefaults] setFloat:newDelayBetweenCalls
forKey:delayBetweenCallsKey_];
forKey:_delayBetweenCallsKey];
}
}
 
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@
 
@end
 
@interface PasteViewController : NSViewController
@interface PasteViewController : NSViewController
 
@property(nonatomic, assign) id<PasteViewControllerDelegate> delegate;
@property(nonatomic, assign) int remainingLength;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment