Skip to content

Commit

Permalink
"Autocomplete.h"
Browse files Browse the repository at this point in the history
"Autocomplete.m"
"DVR.h"
"DVR.m"
"DVRBuffer.h"
"DVRBuffer.m"
"DVRDecoder.h"
"DVRDecoder.m"
"DVREncoder.h"
"DVREncoder.m"
"DVRIndexEntry.h"
"DVRIndexEntry.m"
"EncodingsWithLowerCase.plist"
"English.lproj/Autocomplete.xib"
"English.lproj/FindView.xib"
"English.lproj/GlobalSearch.xib"
"English.lproj/PasteboardHistory.xib"
"English.lproj/iTerm2 Help/"
"FakeWindow.h"
"FakeWindow.m"
"FindView.h"
"FindView.m"
"FindViewController.h"
"FindViewController.m"
"GlobalSearch.h"
"GlobalSearch.m"
"NSDateFormatterExtras.h"
"NSDateFormatterExtras.m"
"PSMTabBarControl/iTermDiffs/"
"PTYTab.h"
"PTYTab.m"
"PasteboardHistory.h"
"PasteboardHistory.m"
"Popup.h"
"Popup.m"
"RegexKitLite/"
"ScreenChar.h"
"ScreenChar.m"
"SessionView.h"
"SessionView.m"
"TextViewWrapper.h"
"TextViewWrapper.m"
"UKCrashReporter/"
"WindowControllerInterface.h"
"crash_report_to_plist.py"
"iTerm.xcodeproj/georgen.mode1v3"
"iTerm.xcodeproj/georgen.pbxuser"
"iTermExpose.h"
"iTermExpose.m"
"iTermSearchField.h"
"iTermSearchField.m"
"images/IBarCursor.png"
"images/bell.png"
"images/bell.psd"
"images/screen.png"
"images/wrap.psd"
"images/wrap_to_bottom.png"
"images/wrap_to_top.png"
"nightly.sh"
"ply/"
"tests/UTF-8-demo.txt"
"tests/a-harpoon.txt"
"tests/acid.txt"
"tests/apple.txt"
"tests/bogusutf8.txt"
"tests/bold-complex.txt"
"tests/bug439.applescript"
"tests/colors.sh"
"tests/combiningmark.txt"
"tests/dw_sip.txt"
"tests/enclosing-mark.txt"
"tests/english_and_chinese.txt"
"tests/greek.txt"
"tests/harpoon.txt"
"tests/low-surrogate.txt"
"tests/radical.txt"
"tests/ranges.py"
"tests/register_bonjour_host"
"tests/reverse_mode.txt"
"tests/searchtext"
"tests/set_icon_title.txt"
"tests/set_icon_window_title.txt"
"tests/set_window_title.txt"
"tests/setbg-blue"
"tests/setbg-yellow"
"tests/setpal"
"tests/spaces.txt"
"tests/spacing-combining-mark.txt"
"tests/spam-tabs.cc"
"tests/suits.txt"
"tests/surrogatepair.txt"
"tests/too_many_parts.txt"
"tests/u2000b.txt"
"tests/zeta.txt"
  • Loading branch information
gnachman committed Apr 5, 2011
1 parent 39786bc commit d1321d0
Show file tree
Hide file tree
Showing 73 changed files with 36,791 additions and 15,473 deletions.
69 changes: 53 additions & 16 deletions BookmarkListView.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,47 @@
#import <Cocoa/Cocoa.h>
#import "BookmarkModel.h"

@interface BookmarkSearchField : NSSearchField
@class iTermSearchField;
@class BookmarkRow;
// This is an intermediate model that wraps BookmarkModel and allows
// each BookmarkListView to have a different ordering of bookmarks.
// It represents bookmarks are BookmarkRow objects which have a
// key-value coding and can be sorted by the columns relevant to
// BookmarkListView.
@interface BookmarkModelWrapper : NSObject
{
id arrowHandler_;
BookmarkModel* underlyingModel;
NSMutableArray* bookmarks;
NSMutableString* filter;
NSArray* sortDescriptors;
}

- (BOOL)performKeyEquivalent:(NSEvent *)theEvent;
- (void)setArrowHandler:(id)handler;
- (id)initWithModel:(BookmarkModel*)model;
- (void)dealloc;
- (void)setSortDescriptors:(NSArray*)newSortDescriptors;
- (NSArray*)sortDescriptors;

// Cause the underlying model to have the visible bookmarks in the same order as
// they appear here. Only bookmarks matching the filter are pushed.
- (void)pushOrderToUnderlyingModel;

// Sort the local representation according to sort descriptors set with setSortDescriptors.
- (void)sort;

// These functions take the filter (set with setFilter) into account with respect to indices.
- (int)numberOfBookmarks;
- (BookmarkRow*)bookmarkRowAtIndex:(int)index;
- (Bookmark*)bookmarkAtIndex:(int)index;
- (int)indexOfBookmarkWithGuid:(NSString*)guid;
- (void)moveBookmarkWithGuid:(NSString*)guid toIndex:(int)index;

- (BookmarkModel*)underlyingModel;

// Copy bookmarks matchin the filter from the underlying model.
- (void)sync;

// Show only bookmarks matching a search query 'filter'.
- (void)setFilter:(NSString*)newFilter;

@end

Expand All @@ -53,7 +87,7 @@
@interface BookmarkListView : NSView {
int rowHeight_;
NSScrollView* scrollView_;
BookmarkSearchField* searchField_;
iTermSearchField* searchField_;
BookmarkTableView* tableView_;
NSTableColumn* tableColumn_;
NSTableColumn* commandColumn_;
Expand All @@ -64,20 +98,17 @@
BOOL showGraphic_;
NSSet* selectedGuids_;
BOOL debug;
BookmarkModel* dataSource_;
BookmarkModelWrapper* dataSource_;
}

- (void)awakeFromNib;
- (id)initWithFrame:(NSRect)frameRect;
- (id)initWithFrame:(NSRect)frameRect model:(BookmarkModel*)dataSource;
- (void)setDelegate:(id<BookmarkTableDelegate>)delegate;
- (void)dealloc;
- (void)setDataSource:(BookmarkModel*)dataSource;

// DataSource methods
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex;
- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView;
- (NSDragOperation)tableView:(NSTableView *)aTableView validateDrop:(id < NSDraggingInfo >)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)operation;
- (BookmarkModelWrapper*)dataSource;
- (void)setUnderlyingDatasource:(BookmarkModel*)dataSource;
- (void)focusSearchField;

// Drag drop
- (BOOL)tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard*)pboard;
Expand All @@ -86,11 +117,18 @@
row:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation;


// DataSource methods
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)rowIndex;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex;
- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView;
- (NSDragOperation)tableView:(NSTableView *)aTableView validateDrop:(id < NSDraggingInfo >)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)operation;

// Delegate methods
- (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView;
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification;

// Don't use this if you've called allowMultipleSelection.
// Don't use this if you've called allowMultipleSelections.
- (int)selectedRow;
- (void)reloadData;
- (void)selectRowIndex:(int)theIndex;
Expand All @@ -103,7 +141,7 @@
- (void)deselectAll;
- (void)multiColumns;

// Dont' use this if you've called allowMultipleSelection
// Dont' use this if you've called allowMultipleSelections
- (NSString*)selectedGuid;
- (NSSet*)selectedGuids;
- (void)dataChangeNotification:(id)sender;
Expand All @@ -113,7 +151,6 @@
- (id)retain;
- (oneway void)release;
- (void)turnOnDebug;
- (void)allowMultipleSelection;
- (NSTableView*)tableView;
- (id)delegate;

Expand Down
Loading

0 comments on commit d1321d0

Please sign in to comment.