#import <IntegratedTSView.h>
Inherits TallTextView.
Inheritance diagram for IntegratedTSView:


An IntegratedTSView is a TallTextView with a terminal (a TextStorageTerminal wrapped in a TerminalSection) at the bottom. Its section iterators are specialized to include the special terminal section at the end of the list. The view responds to keyboard events and changes in geometry by informing a delegate through the ITSVDelegate informal protocol.
When resized, the view allocates and displays a PlacardWindow showing its current dimensions in rows and columns, near the lower-right corner of the view. See resizeWithOldSuperviewSize:.
Definition at line 28 of file IntegratedTSView.h.
Public Member Functions | |
| (id) | - initWithFrame: |
| Designated initializer. | |
| (id) | - initWithRows:columns: |
| Notional initializer. | |
| (int) | - rows |
| The height of the terminal section in lines. | |
| (int) | - columns |
| The width of the terminal section in characters. | |
| (void) | - setRows:columns: |
| Resize self and window for rows x columns. | |
| (TextStorageTerminal *) | - terminal |
| Return the terminal model for the view. | |
| (id) | - delegate |
| Getter for the view delegate. | |
| (void) | - setDelegate: |
| Setter for the view delegate. | |
| (BOOL) | - acceptsKeystrokes |
| Whether the view responds to key-down events. | |
| (void) | - setAcceptsKeystrokes: |
| Set whether the view responds to key-down events. | |
| (BOOL) | - deleteIsBackspace |
| Whether the delete key maps to 0x08. | |
| (void) | - setDeleteIsBackspace: |
| Set whether the delete key maps to 0x08. | |
| (NSColor *) | - cursorColor |
| Get terminal cursor color. | |
| (void) | - setCursorColor: |
| Set terminal cursor color. | |
| (float) | - cursorHeight |
| Get terminal cursor height. | |
| (void) | - setCursorHeight: |
| Set terminal cursor height. | |
| (NSColor *) | - foreColor |
| Get the color to be used for plain text. | |
| (NSColor *) | - backColor |
| Get the color to fill behind plain text. | |
| (void) | - setForeColor: |
| Set the color to be used for plain text. | |
| (void) | - setBackColor: |
| Set the color to fill behind plain text. | |
| (NSFont *) | - defaultFont |
| Get the font used in the terminal. | |
| (NSSize) | - sizeIncrement |
| Get the size of one line by one character. | |
| (void) | - ignorePreferencesAndScanURL:email: |
| Demonstrate URL and email highlighting. | |
| (NSEnumerator *) | - sectionEnumerator [implementation] |
| Enumerator of text-storage sections. | |
| (NSEnumerator *) | - reverseSectionEnumerator [implementation] |
| Reverse enumerator of text-storage sections. | |
| (void) | - recalculateFrame [implementation] |
| Adjust the total height of the view and redraw. | |
| (void) | - setTerminalSizeFromSize: [implementation] |
| Change terminal geometry in response to change in view size. | |
| (void) | - awakeFromNib [implementation] |
| (void) | - dealloc [implementation] |
| (void) | - fillBackground: [implementation] |
| Fill the on-screen view with the terminal background color. | |
| (void) | - drawRect: [implementation] |
| Draw the view. | |
| (void) | - scrollToBottom [implementation] |
| Scrolls the receiver to the bottom of the view. | |
| (void) | - resizeWithOldSuperviewSize: [implementation] |
| Amplification of NSView method, popping a PlacardWindow up to show terminal size. | |
| (void) | - tearDownPlacard: [implementation] |
| Completion method for the terminal-size placard timer. | |
| (void) | - scrollPageUp: [implementation] |
| Scroll up by one page. | |
| (void) | - scrollPageDown: [implementation] |
| Scroll down by one page. | |
| (void) | - keyDown: [implementation] |
| Handle keyboard events. | |
| (IBAction) | - selectScreen: [implementation] |
| Select the whole contents of the terminal section. | |
| (NSMenu *) | - menuForEvent: [implementation] |
| Compose a contextual menu. | |
| (void) | - typeMenuTitle: [implementation] |
| Turn the title of the sender into keyboard events. | |
| (void) | - enterTextFromPasteboard: [implementation] |
| Accept text from the pasteboard. | |
| (void) | - paste: [implementation] |
| Take text from the general pasteboard and type it in through the delegate. | |
| (BOOL) | - readSelectionFromPasteboard: [implementation] |
| Services-input method. | |
| (BOOL) | - validateUserInterfaceItem: [implementation] |
| Menu-item validataion. | |
| (id) | - validRequestorForSendType:returnType: [implementation] |
| Return the handler (self or up chain) to send or receive a pasteboard type. | |
| (void) | - appendAttributedString: [implementation] |
| Append text to the view. | |
NSDraggingDestination | |
| (NSDragOperation) | - draggingEntered: [implementation] |
| First notice that a drag has entered the view. | |
| (void) | - draggingExited: [implementation] |
| Drag operation has left the view. | |
| (BOOL) | - prepareForDragOperation: [implementation] |
| Final notice to prepare for drop. | |
| (BOOL) | - performDragOperation: [implementation] |
| Execute the drop from a drag. | |
| (void) | - concludeDragOperation: [implementation] |
| Finish drag and drop. | |
NSTextInput | |
Implementation of the NSTextInput informal protocol. It appears that most of these are stub implementations. I assume (I forget) that what is implemented is enough to handle dead-key input of accented characters. The terminal view can't do general input management, as it "accepts" input only at the cursor, and even that is the result of a turnaround through the host. | |
| (void) | - insertText: [implementation] |
| (void) | - setMarkedText:selectedRange: [implementation] |
| (void) | - unmarkText [implementation] |
| (BOOL) | - hasMarkedText [implementation] |
| (void) | - doCommandBySelector: [implementation] |
| (long) | - conversationIdentifier [implementation] |
| Use terminalSection to identify link to input method. | |
| (NSAttributedString *) | - attributedSubstringFromRange: [implementation] |
| Returns attributed string at a given range. | |
| (NSRange) | - markedRange [implementation] |
| Returns the range for marked region. | |
| (NSRange) | - selectedRange [implementation] |
| Returns the range for selected region. | |
| (NSRect) | - firstRectForCharacterRange: [implementation] |
| The first frame of rects for theRange in screen coordindate system. | |
| (unsigned int) | - characterIndexForPoint: [implementation] |
| Returns the index for character that is nearest to thePoint. | |
| (NSArray *) | - validAttributesForMarkedText [implementation] |
| This method is the key to attribute extension. | |
Static Public Member Functions | |
| (void) | + initialize [implementation] |
Protected Attributes | |
| IBOutlet id | delegate |
| Delegate for keyboard and geometry events. | |
| TerminalSection * | terminalSection |
| Terminal subview. | |
| BOOL | acceptsKeystrokes |
| Whether the view is open for input. | |
| BOOL | deleteIsBackspace |
| Whether key x7f is sent as x08. | |
| int | rows |
| int | columns |
| Terminal geometry. | |
| PlacardWindow * | placardWindow |
| Geometry display window. | |
| NSTimer * | placardTimer |
| Teardown timer for placard window. | |
| BOOL | dragHighlight |
| Whether to show drag and drop highlight. | |
| NSMutableArray * | deadKeyEvents |
| Accumulated dead-key events for input managers. | |
| NSString * | markedString |
| Accumulated string for input managers. | |
|
|
Whether the view responds to key-down events. Key-down events are usable in the terminal model only when a terminal session is connected. The session owner (MyDocument) is responsible for calling setAcceptsKeystrokes: to turn key handling on and off as needed.
Referenced by keyDown:, and setAcceptsKeystrokes:. |
|
|
Append text to the view. Appends the attributed string aString to the NSTextStorage in the last section in line. The last section is the only one subject to revision by appending in this way. If appending makes the section tall enough (currently 10000 pixels), a new section is allocated and added to the end of the list.
Reimplemented from TallTextView. Definition at line 835 of file IntegratedTSView.m. References TallTextView::appendAttributedString:, and scrollToBottom. Referenced by MyDocument::terminalScreen:scrollsOffText:. Here is the call graph for this function: ![]() |
|
|
Returns attributed string at a given range. This allows input mangers to query any range in backing-store. May return nil. Definition at line 960 of file IntegratedTSView.m. |
|
|
Definition at line 282 of file IntegratedTSView.m. References defaultColumns(), defaultRows(), setRows:columns:, PreferenceController::settings, and CrescatAppDelegate::sharedPreferenceController. Here is the call graph for this function: ![]() |
|
|
Get the color to fill behind plain text. Returns the color used as a background ("black") for plain text, normally white. This is a front for the underlying TerminalSection method defaultBackColor.
Definition at line 321 of file IntegratedTSView.m. References TextStorageTerminal::defaultBackColor, TerminalSection::terminal, and terminalSection. Referenced by MyDocument::backColor, drawRect:, MyDocument::printAttributedString:, and MyDocument::printShowingPrintPanel:. |
|
|
Returns the index for character that is nearest to thePoint. thPoint is in screen coordinate system. Definition at line 992 of file IntegratedTSView.m. |
|
|
The width of the terminal section in characters. Returns the width of the terminal section, and therefore the view, in character widths.
Referenced by setTerminalSizeFromSize:. |
|
|
Finish drag and drop. Turn off drag highlighting. Definition at line 895 of file IntegratedTSView.m. References dragHighlight. |
|
|
Use terminalSection to identify link to input method.
Definition at line 956 of file IntegratedTSView.m. References terminalSection. |
|
|
Get terminal cursor color. This is a front for the underlying TerminalSection method of the same name.
Definition at line 841 of file IntegratedTSView.m. References TerminalSection::cursorColor, and terminalSection. Referenced by MyDocument::cursorColor. |
|
|
Get terminal cursor height. The practical values for this setting are 1.0, 0.5, and -1.0 (underline). This is a front for the underlying TerminalSection method of the same name.
Definition at line 848 of file IntegratedTSView.m. References TerminalSection::cursorHeight, and terminalSection. |
|
|
Reimplemented from TallTextView. Definition at line 299 of file IntegratedTSView.m. References TallTextView::dealloc, TerminalSection::dealloc, and terminalSection. Here is the call graph for this function: ![]() |
|
|
Get the font used in the terminal. Returns the font used in rendering plain terminal output, by default some size of Monaco. This is a front for the underlying TerminalSection method of the same name.
Definition at line 851 of file IntegratedTSView.m. References TerminalSection::defaultFont, and terminalSection. Referenced by MyDocument::printAttributedString:, and MyDocument::printShowingPrintPanel:. Here is the call graph for this function: ![]() |
|
|
Getter for the view delegate. The delegate for an IntegratedTSView receives key-down events for transmission to the terminal session, and geometry-changed events, so it can notify the pseudo-terminal that its row and column counts have changed. This method returns the delegate object set by setDelegate:. The delegate must conform to the ITSVDelegate informal protocol.
Referenced by enterTextFromPasteboard:, keyDown:, setDelegate:, setTerminalSizeFromSize:, and typeMenuTitle:. |
|
|
Whether the delete key maps to 0x08. IntegratedTSView does one piece of filtering of key-down events: If this property is YES, the delete key is sent to the delegate as 0x08, otherwise it is sent as 0x7f.
Referenced by keyDown:, and setDeleteIsBackspace:. |
|
|
Definition at line 948 of file IntegratedTSView.m. |
|
|
First notice that a drag has entered the view. Highlight the view for the drag and return NSDragOperationGeneric. Definition at line 866 of file IntegratedTSView.m. References dragHighlight. |
|
|
Drag operation has left the view. Take down drag highlighting. Definition at line 874 of file IntegratedTSView.m. References dragHighlight. |
|
|
Draw the view. The inherited method iterates through the scrollback and terminal sections to draw those. This method draws a three-point highlight (a blend at the border from foreground to background) when a drag into the view is in progress.
Reimplemented from TallTextView. Definition at line 349 of file IntegratedTSView.m. References backColor, dragHighlight, TallTextView::drawRect:, and foreColor. Here is the call graph for this function: ![]() |
|
|
Accept text from the pasteboard. There is more to this than one would think. The pasteboard may be a string, a file or files, or file contents. Whatever, the relevant contents are converted to ISO-Latin-1 text. They are then sent, line-by-line, with line delimiters replaced by carriage returns, to the delegate via terminalView:gotKeyData:. While the send is going on, this method watches the event queue for either an escape or a command-period, in which case the paste is stopped.
Definition at line 693 of file IntegratedTSView.m. References delegate, and length(). Referenced by paste:, performDragOperation:, and readSelectionFromPasteboard:. Here is the call graph for this function: ![]() |
|
|
Fill the on-screen view with the terminal background color. If the view is being drawn to the screen, fill the redraw rectangle with the terminal section's default background color. Otherwise do nothing, on the assumption that we're leaving a print raster unmarked.
Reimplemented from TallTextView. Definition at line 337 of file IntegratedTSView.m. References TextStorageTerminal::defaultBackColor, TerminalSection::terminal, and terminalSection. |
|
|
The first frame of rects for theRange in screen coordindate system.
Definition at line 985 of file IntegratedTSView.m. |
|
|
Get the color to be used for plain text. Returns the color used for plain ("white") text, normally black. This is a front for the underlying TerminalSection method defaultForeColor.
Definition at line 320 of file IntegratedTSView.m. References TextStorageTerminal::defaultForeColor, TerminalSection::terminal, and terminalSection. Referenced by drawRect:, MyDocument::foreColor, MyDocument::printAttributedString:, and MyDocument::printShowingPrintPanel:. |
|
|
Definition at line 943 of file IntegratedTSView.m. References markedString. |
|
||||||||||||
|
Demonstrate URL and email highlighting. The layout manager for the terminal section consults the settings for the application to determine whether to highlight URLs and email addresses in the display. There is a small terminal display in the preferences panel which has to demonstrate such highlighting according to the transient settings of the preference checkboxes, and not the committed preferences. Sending this message causes URLs or emails (or both) to be highlighted regardless of the global preferences.
Definition at line 856 of file IntegratedTSView.m. References TerminalSection::ignorePreferencesAndScanURL:email:, and terminalSection. Referenced by PreferenceController::detectButtonPressed:, PreferenceController::loadUI, PreferenceController::tabView:didSelectTabViewItem:, and PreferenceController::windowDidBecomeMain:. Here is the call graph for this function: ![]() |
|
|
Reimplemented from TallTextView. Definition at line 132 of file IntegratedTSView.m. |
|
|
Designated initializer. Once superclass initialization is done, determines the size of the terminal in rows and columns from the size of the frame.
Reimplemented from TallTextView. Definition at line 253 of file IntegratedTSView.m. References TallTextView::initWithFrame:, setTerminalSizeFromSize:, and terminalSection. Referenced by initWithRows:columns:. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Notional initializer. Initialize a view of a size calculated from the given number of rows and columns for the terminal section. IntegratedTSView is instantiated from a NIB, so this method is never used in practice. I don't have any good reason to suppose it even works.
Definition at line 264 of file IntegratedTSView.m. References TerminalSection::characterSizeForFont:, CrescatAppDelegate::defaultFont, initWithFrame:, TerminalSection::setParentView:, and terminalSection. Here is the call graph for this function: ![]() |
|
|
Definition at line 908 of file IntegratedTSView.m. |
|
|
Handle keyboard events. This method takes key-down events and turns them into character data to be sent to the host. Cursor-movement key events are hard-coded to emit ANSI terminal codes. The delete key is mapped to backspace, or not, according to preference. Beeps if acceptsKeystrokes is NO. Set IMPLEMENTS_FKEYS to nonzero if you want to emit function-key codes; I haven't found these to be very successful.
Definition at line 507 of file IntegratedTSView.m. References acceptsKeystrokes, delegate, deleteIsBackspace, scrollPageDown:, and scrollPageUp:. Here is the call graph for this function: ![]() |
|
|
Returns the range for marked region. If hasMarkedText == false, it'll return NSNotFound location & 0 length range. Definition at line 967 of file IntegratedTSView.m. References length(), and markedString. Here is the call graph for this function: ![]() |
|
|
Compose a contextual menu. The supplied event is checked for location on the screen.
Definition at line 628 of file IntegratedTSView.m. References SectionRecord::attribute:atPoint:, length(), terminalSection, and SectionRecord::wordAtPoint:. Here is the call graph for this function: ![]() |
|
|
Take text from the general pasteboard and type it in through the delegate.
This method accepts only pasteboards of type
Definition at line 763 of file IntegratedTSView.m. References enterTextFromPasteboard:. Referenced by validateUserInterfaceItem:. Here is the call graph for this function: ![]() |
|
|
Execute the drop from a drag. Take text out of the pasteboard.
Definition at line 888 of file IntegratedTSView.m. References enterTextFromPasteboard:. Here is the call graph for this function: ![]() |
|
|
Final notice to prepare for drop. Just approve.
Definition at line 883 of file IntegratedTSView.m. |
|
|
Services-input method.
This method accepts only pasteboards of type
Definition at line 778 of file IntegratedTSView.m. References enterTextFromPasteboard:. Here is the call graph for this function: ![]() |
|
|
Adjust the total height of the view and redraw. Recalculates the height of the view by summing the heights of the sections. Sets the view's frame height accordingly, and then calls setNeedsDisplay: YES. This is necessary whenever the content of the view changes (or at least whenever a line is added to it). It's how scroll bars get updated. Reimplemented from TallTextView. Definition at line 164 of file IntegratedTSView.m. References SectionRecord::height, TallTextView::recalculateFrame, TerminalSection::setOrigin:, and terminalSection. Referenced by setTerminalSizeFromSize:. Here is the call graph for this function: ![]() |
|
|
Amplification of NSView method, popping a PlacardWindow up to show terminal size.
Definition at line 395 of file IntegratedTSView.m. References TerminalSection::getRows:columns:, PlacardWindow::mouseMovedTo:, placardTimer, placardWindow, scrollToBottom, setTerminalSizeFromSize:, and terminalSection. Here is the call graph for this function: ![]() |
|
|
Reverse enumerator of text-storage sections. This method returns an NSEnumerator that steps through the text sections of the view from last to first. This enumerator is simple in the case of TallTextView, but becomes more interesting in the case of IntegratedTSView, in which the last section is a terminal view.
Reimplemented from TallTextView. Definition at line 145 of file IntegratedTSView.m. |
|
|
The height of the terminal section in lines. Returns the height of the terminal section, and therefore the view, in lines of text.
Referenced by setTerminalSizeFromSize:. |
|
|
Scroll down by one page. This is keyDown:'s response to the page-down function key.
Definition at line 484 of file IntegratedTSView.m. Referenced by keyDown:. |
|
|
Scroll up by one page. This is keyDown:'s response to the page-up function key.
Definition at line 467 of file IntegratedTSView.m. Referenced by keyDown:. |
|
|
Scrolls the receiver to the bottom of the view.
Definition at line 379 of file IntegratedTSView.m. Referenced by appendAttributedString:, and resizeWithOldSuperviewSize:. |
|
|
Enumerator of text-storage sections. This method returns an NSEnumerator that steps through the text sections of the view from first to last. This enumerator is simple in the case of TallTextView, but becomes more interesting in the case of IntegratedTSView, in which the last section is a terminal view.
Reimplemented from TallTextView. Definition at line 140 of file IntegratedTSView.m. |
|
|
Returns the range for selected region. Just like markedRange method, its location field contains char index from the text beginning. Definition at line 977 of file IntegratedTSView.m. |
|
|
Select the whole contents of the terminal section. This is done through the expedient of setting the selection from the top-left of the terminal section, to way-right at the bottom.
Definition at line 612 of file IntegratedTSView.m. References TallTextView::endSelPoint, TallTextView::endSelSection, foot(), origin(), TallTextView::startSelPoint, TallTextView::startSelSection, and terminalSection. Here is the call graph for this function: ![]() |
|
|
Set whether the view responds to key-down events. Key-down events are usable in the terminal model only when a terminal session is connected. The session owner (MyDocument) is responsible for calling setAcceptsKeystrokes: to turn key handling on and off as needed.
Definition at line 458 of file IntegratedTSView.m. References acceptsKeystrokes. Referenced by MyDocument::dataArrivedFromPty:, and MyDocument::ptyTaskCompleted:. Here is the call graph for this function: ![]() |
|
|
Set the color to fill behind plain text. Sets the color to be used as a background for plain text, which by default is white. This is a front for the underlying TerminalSection method setDefauiltBackColor.
Definition at line 328 of file IntegratedTSView.m. References TextStorageTerminal::setDefaultBackColor:, TerminalSection::terminal, and terminalSection. Referenced by PreferenceController::loadUI, PreferenceController::sampleBackground:, MyDocument::setBackColor:, and MyDocument::startSession. Here is the call graph for this function: ![]() |
|
|
Set terminal cursor color. This is a front for the underlying TerminalSection method of the same name. If the cursor color and the foreground color are determined to be of similar luminance, the TerminalSection will render characters under the cursor in the background color.
Definition at line 843 of file IntegratedTSView.m. References TerminalSection::setCursorColor:, and terminalSection. Referenced by MyDocument::setCursorColor:, and MyDocument::startSession. Here is the call graph for this function: ![]() |
|
|
Set terminal cursor height. The practical values for this setting are 1.0, 0.5, and -1.0 (underline). This is a front for the underlying TerminalSection method of the same name.
Definition at line 849 of file IntegratedTSView.m. References TerminalSection::setCursorHeight:, and terminalSection. Referenced by MyDocument::showSessionSettings:, and MyDocument::startSession. Here is the call graph for this function: ![]() |
|
|
Setter for the view delegate. The delegate for an IntegratedTSView receives key-down events for transmission to the terminal session, and geometry-changed events, so it can notify the pseudo-terminal that its row and column counts have changed. This method sets the delegate object. The delegate must conform to the ITSVDelegate informal protocol.
|