#import <MyDocument.h>
Collaboration diagram for MyDocument:

This is the only document type for Crescat. It encompasses an SSH terminal session, including settings, terminal screen, and scrollback buffer. It manages the SSH login process by presenting password sheets and error messages as needed.
This is the principal controller object. The principal view is the IntegratedTSView in the termView instance variable. The principal model is accessed through [termView terminal], and is a TextStorageTerminal. MyDocument is the delegate of the SSHTask "session," which provides the input and output streams for SSH. Incoming data goes to the terminal model through the lineFilter CharacterLineFilter.
Definition at line 55 of file MyDocument.h.
Public Member Functions | |
| (IBAction) | - changeLogging: |
| Toggle logging of input data. | |
| (IBAction) | - reconnect: |
| Connect through a new instance of ssh(1). | |
| (IBAction) | - clearScrollback: |
| Discard the scrollback text. | |
| (IBAction) | - printSelection: |
| Print the selected text. | |
| (IBAction) | - printScreen: |
| Print the terminal screen. | |
| (IBAction) | - spellChecking: |
| Toggle spell-checking. | |
| (IBAction) | - showSessionSettings: |
| (brief description) (comprehensive description) | |
| (void) | - startSession |
| Run a new session. | |
| (void) | - startNewSession |
| Ask user to configure a new session and run it. | |
| (NSString *) | - userName |
| User ID for SSH session. | |
| (NSString *) | - hostName |
| Host address for SSH session. | |
| (void) | - setUserName: |
| Set the user ID for SSH session. | |
| (void) | - setHostName: |
| Set the host address for SSH session. | |
| (int) | - rows |
| Height of terminal screen in lines. | |
| (int) | - columns |
| Width of terminal screen in characters. | |
| (void) | - setRows: |
| Set the height of the terminal screen in lines. | |
| (void) | - setColumns: |
| Set the width of the terminal screen in characters. | |
| (void) | - setForeColor: |
| Set the "plain" color for text on the terminal screen. | |
| (void) | - setBackColor: |
| Set the "plain" color for the terminal background. | |
| (void) | - setCursorColor: |
| Set the color of the terminal cursor. | |
| (id) | - sendText: |
| AppleScript send-text command. | |
| (NSTextStorage *) | - terminalText |
| NSTextStorage underlying the terminal. | |
| (id) | - init [implementation] |
| (void) | - dealloc [implementation] |
| (NSString *) | - windowNibName [implementation] |
| (BOOL) | - sessionParamsSuffice [implementation] |
| (void) | - windowControllerDidLoadNib: [implementation] |
| (BOOL) | - userPresentsPassword: [implementation] |
| (ConnectionExpectState) | - sshNotification: [implementation] |
| (void) | - dataArrivedFromPty: [implementation] |
| (void) | - ptyTaskCompleted: [implementation] |
| (void) | - terminalView:gotKeyData:modifiers: [implementation] |
| (void) | - terminalView:changedGeometryToRows:columns: [implementation] |
| (BOOL) | - textView:clickedOnLink:atIndex: [implementation] |
| (void) | - terminalScreen:sendsReportData: [implementation] |
| (void) | - terminalScreenPrintsScreen: [implementation] |
| (void) | - terminalScreen:printsBuffer: [implementation] |
| (void) | - printBufferDone:success:tempView: [implementation] |
| (void) | - terminalScreen:scrollsOffText: [implementation] |
| (NSData *) | - dataRepresentationOfType: [implementation] |
| (BOOL) | - loadDataRepresentation:ofType: [implementation] |
| (BOOL) | - validateUserInterfaceItem: [implementation] |
| (id) | - handleClearScrollback: [implementation] |
| (id) | - handleFind: [implementation] |
| (NSColor *) | - foreColor [implementation] |
| (NSColor *) | - backColor [implementation] |
| (NSColor *) | - cursorColor [implementation] |
| (NSString *) | - selectedText [implementation] |
| (NSString *) | - fullContent [implementation] |
| (int) | - cursorRow [implementation] |
| (int) | - cursorColumn [implementation] |
| (void) | - setPassword: [implementation] |
| (void) | - printShowingPrintPanel: [implementation] |
| (void) | - printAttributedString: [implementation] |
| (void) | - windowDidBecomeMain: [implementation] |
| (NSSize) | - windowWillResize:toSize: [implementation] |
Protected Attributes | |
| IBOutlet IntegratedTSView * | termView |
| IBOutlet NSButton * | testButton |
| IBOutlet NSButton * | logCheckbox |
| IBOutlet NSWindow * | mainWindow |
| NSMutableDictionary * | sessionParams |
| SSHTask * | session |
| CharacterLineFilter * | lineFilter |
| BOOL | logInput |
| ConnectionExpectState | state |
| NSMutableString * | sshErrorMessage |
| NSData * | scrollbackTemp |
|
|
Definition at line 582 of file MyDocument.m. References IntegratedTSView::backColor, and termView. Here is the call graph for this function: ![]() |
|
|
Toggle logging of input data. This is an IBAction, intended to be sent by a menu item. In addition to toggling the state of the BOOL that controls whether incoming data from the terminal is logged to standard error, this method does a setState: on the sender according to whether the BOOL is on or off. The validateUserInterface: method will trigger an assertion if an item having this message for its action is not an NSMenuItem or an NSButton.
Definition at line 462 of file MyDocument.m. References logInput. Referenced by validateUserInterfaceItem:. |
|
|
Discard the scrollback text. Tells termView to clearBuffer, which releases everything stored in the scrollback buffer, but not the terminal screen.
Definition at line 53 of file MyDocument.m. References TallTextView::clearBuffer, and termView. Referenced by handleClearScrollback:, and validateUserInterfaceItem:. Here is the call graph for this function: ![]() |
|
|
Width of terminal screen in characters. Getter for the horizontal dimension of the terminal screen. KVC compliance for AppleScript.
Definition at line 502 of file MyDocument.m. References IntegratedTSView::columns, and termView. Referenced by printAttributedString:, and startSession. |
|
|
Definition at line 583 of file MyDocument.m. References IntegratedTSView::cursorColor, and termView. Here is the call graph for this function: ![]() |
|
|
Definition at line 657 of file MyDocument.m. References TextStorageTerminal::cursorLocationX:Y:, IntegratedTSView::terminal, and termView. Here is the call graph for this function: ![]() |
|
|
Definition at line 650 of file MyDocument.m. References TextStorageTerminal::cursorLocationX:Y:, IntegratedTSView::terminal, and termView. Here is the call graph for this function: ![]() |
|
|
Definition at line 212 of file MyDocument.m. References PTYTask(streamTasks)::availableData, IntegratedTSView::columns, expectNothing, expectPass, expectPassOrKey, expectRejectOrTraffic, expectTraffic, SSHTask::hostName, lineFilter, logInput, mainWindow, CharacterLineFilter::processData:, CrescatAppDelegate::registerSessionWithBanner:, IntegratedTSView::rows, SSHTask::sendStringToHost:, session, IntegratedTSView::setAcceptsKeystrokes:, SSHTask::setRows:columns:, sshErrorMessage, sshNotification:, state, termView, SSHTask::userName, and userPresentsPassword:. Here is the call graph for this function: ![]() |
|
|
Definition at line 419 of file MyDocument.m. References TallTextView::attributedString, TallTextView::content, PlainTextFileType, RichTextFileType, SessionFileType, TallTextView::string, and termView. Here is the call graph for this function: ![]() |
|
|
Definition at line 44 of file MyDocument.m. References mainWindow, session, and sessionParams. |
|
|
Definition at line 581 of file MyDocument.m. References IntegratedTSView::foreColor, and termView. Here is the call graph for this function: ![]() |
|
|
Definition at line 645 of file MyDocument.m. References TallTextView::string, and termView. Here is the call graph for this function: ![]() |
|
|
Definition at line 551 of file MyDocument.m. References clearScrollback:. Here is the call graph for this function: ![]() |
|
|
Definition at line 557 of file MyDocument.m. References TallTextView::doSearch:backward:caseSensitive:wraps:, and termView. Here is the call graph for this function: ![]() |
|
|
Host address for SSH session. Getter method for the host address to be used in connecting through ssh(1). KVC compliance for AppleScript.
Definition at line 114 of file MyDocument.m. References sessionParams. Referenced by TallTextView::drawPageBorderWithSize:. |
|
|
Definition at line 33 of file MyDocument.m. References expectPassOrKey, sessionParams, sshErrorMessage, and state. |
|
||||||||||||
|
Definition at line 445 of file MyDocument.m. References PlainTextFileType, RichTextFileType, scrollbackTemp, and sessionParams. |
|
|
Definition at line 704 of file MyDocument.m. References IntegratedTSView::backColor, TerminalSection::characterSizeForFont:, columns, IntegratedTSView::defaultFont, TextStorageTerminal::defaultFont, IntegratedTSView::foreColor, CrescatAppDelegate::printingFont, rows, TallTextView::setAttributedString:, TallTextView::setDocument:, TallTextView::setPageInfo:, and termView. Referenced by printScreen:, and printSelection:. Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 403 of file MyDocument.m. |
|
|
Print the terminal screen. Takes the contents of the terminal view, and renders it in the printer font, with foreground set to black and background to white. Vertical pagination is automatic; horizontally, the view is resized to fit the page. The results are printed via the standard document-modal printing dialog.
Definition at line 740 of file MyDocument.m. References printAttributedString:, IntegratedTSView::terminal, termView, and TextStorageTerminal::textStorage. Referenced by terminalScreenPrintsScreen:, and validateUserInterfaceItem:. Here is the call graph for this function: ![]() |
|
|
Print the selected text. Takes the selection from the document's view, and renders it in the printer font, with foreground set to black and background to white. Vertical pagination is automatic; horizontally, the view is resized to fit the page. The results are printed via the standard document-modal printing dialog.
Definition at line 735 of file MyDocument.m. References printAttributedString:, TallTextView::selectedAttributedString, and termView. Referenced by validateUserInterfaceItem:. Here is the call graph for this function: ![]() |
|
|
Definition at line 671 of file MyDocument.m. References TallTextView::attributedString, IntegratedTSView::backColor, IntegratedTSView::defaultFont, IntegratedTSView::foreColor, CrescatAppDelegate::printingFont, TallTextView::setAttributedString:, TallTextView::setDocument:, TallTextView::setPageInfo:, and termView. Here is the call graph for this function: ![]() |
|
|
Definition at line 312 of file MyDocument.m. References closeWhenSessionCloses(), expectNothing, SSHTask::hostName, mainWindow, OneButtonAlertController::run, session, IntegratedTSView::setAcceptsKeystrokes:, sshErrorMessage, state, termView, and SSHTask::userName. Here is the call graph for this function: ![]() |
|
|
Connect through a new instance of ssh(1). This method resets the connection state to expectPassOrKey, and calls startSession. This initializes a new SSHTask, which initializes a new ssh(1) instance with the current document's settings and begins the state machine's path through connection and authentication.
Definition at line 58 of file MyDocument.m. References expectPassOrKey, startSession, and state. Referenced by validateUserInterfaceItem:. Here is the call graph for this function: ![]() |
|
|
Height of terminal screen in lines. Getter for the vertical dimension of the terminal screen. KVC compliance for AppleScript.
Definition at line 501 of file MyDocument.m. References IntegratedTSView::rows, and termView. Referenced by printAttributedString:, and startSession. |
|
|
Definition at line 640 of file MyDocument.m. References TallTextView::selectedAttributedString, and termView. Here is the call graph for this function: ![]() |
|
|
AppleScript send-text command. This method implements the AppleScript command for sending text through the terminal. The parameters include the text to send and whether to follow it with a press of the return key.
Definition at line 528 of file MyDocument.m. References content(), SSHTask::sendToHost:, and session. Here is the call graph for this function: ![]() |
|
|
Definition at line 71 of file MyDocument.m. References CrescatAppDelegate::defaultHostSettings, and sessionParams. Referenced by windowControllerDidLoadNib:. Here is the call graph for this function: ![]() |
|
|
Set the "plain" color for the terminal background. Setter for the background color, the color that fills the portions of the screen for which the host specifies normal-background text. Normally white. KVC compliance for AppleScript.
Definition at line 594 of file MyDocument.m. References EnsureColor(), sessionParams, IntegratedTSView::setBackColor:, and termView. Referenced by showSessionSettings:. Here is the call graph for this function: ![]() |
|
|
Set the width of the terminal screen in characters. Setter for the horizontal dimension of the terminal screen, in charaacters. Values less than 6 or greater than 499 will have no effect. KVC compliance for AppleScript.
Definition at line 521 of file MyDocument.m. References IntegratedTSView::rows, IntegratedTSView::setRows:columns:, and termView. Referenced by showSessionSettings:. Here is the call graph for this function: ![]() |
|
|
Set the color of the terminal cursor. Setter for the color of the cursor, the block of highlighting that indicates the location of current focus in the terminal screen. KVC compliance for AppleScript.
Definition at line 603 of file MyDocument.m. References EnsureColor(), sessionParams, IntegratedTSView::setCursorColor:, and termView. Referenced by showSessionSettings:. Here is the call graph for this function: ![]() |
|
|
Set the "plain" color for text on the terminal screen. Setter for the foreground color, the color used when the host specifies normal text. Normally black. KVC compliance for AppleScript.
Definition at line 585 of file MyDocument.m. References EnsureColor(), sessionParams, IntegratedTSView::setForeColor:, and termView. Referenced by showSessionSettings:. Here is the call graph for this function: ![]() |
|
|
Set the host address for SSH session. Setter method for the host address to be used in connecting through ssh(1). KVC compliance for AppleScript. This setting has practical effect only when a connection is being made.
Definition at line 509 of file MyDocument.m. References sessionParams. |
|
|
Definition at line 664 of file MyDocument.m. References sessionParams. |
|
|
Set the height of the terminal screen in lines. Setter for the vertical dimension of the terminal screen, in lines. Values less than 2 or greater than 255 will have no effect. KVC compliance for AppleScript.
Definition at line 514 of file MyDocument.m. References IntegratedTSView::columns, IntegratedTSView::setRows:columns:, and termView. Referenced by showSessionSettings:. Here is the call graph for this function: ![]() |
|
|
Set the user ID for SSH session. Setter method for the user ID to be used in connnecting through ssh(1). KVC compliance for AppleScript. This setting has practical effect only when a connection is being made.
Definition at line 504 of file MyDocument.m. References sessionParams. |
|
|
(brief description) (comprehensive description)
Definition at line 612 of file MyDocument.m. References sessionParams, setBackColor:, setColumns:, setCursorColor:, IntegratedTSView::setCursorHeight:, IntegratedTSView::setDeleteIsBackspace:, setForeColor:, setRows:, CrescatAppDelegate::setSettings:forHost:userID:, SessionPanelController::settings, and termView. Here is the call graph for this function: ![]() |
|
|
Toggle spell-checking. Toggles the state of the sender object using setState: (which more or less restricts this to being sent by an NSMenuItem). When the item is on, starts a once-a-second task that checks the terminal screen for misspellings and highlights them. When off, unschedules the timer task and removes spell-check attributes.
Definition at line 768 of file MyDocument.m. References TextStorageTerminal::checkSpelling:, IntegratedTSView::terminal, and termView. Referenced by validateUserInterfaceItem:. Here is the call graph for this function: ![]() |
|
|
Definition at line 202 of file MyDocument.m. References expectNothing, expectPass, TwoButtonAlertController::result, and TwoButtonAlertController::run. Referenced by dataArrivedFromPty:. Here is the call graph for this function: ![]() |
|
|
Ask user to configure a new session and run it. Instantiates a LoginInfoController to run a sheet allowing the user to enter user ID, host name, and possibly other parameters, then calls startSession to start an SSH connection with those parameters. Definition at line 155 of file MyDocument.m. References LoginInfoController::results, LoginInfoController::run, sessionParams, and startSession. Here is the call graph for this function: ![]() |
|
|
Run a new session. Initializes a new SSHTask, which initializes a new ssh(1) instance with the current document's settings and begins the state machine's path through connection and authentication. Definition at line 116 of file MyDocument.m. References CrescatAppDelegate::cipherParamFromIndex:, columns, SSHTask::connect, lineFilter, CrescatAppDelegate::protocolParamFromIndex:, rows, session, sessionParams, IntegratedTSView::setBackColor:, SSHTask::setCipher:, SSHTask::setCompression:, IntegratedTSView::setCursorColor:, IntegratedTSView::setCursorHeight:, TextStorageTerminal::setDelegate:, SSHTask::setDelegate:, IntegratedTSView::setDeleteIsBackspace:, TextStorageTerminal::setEatsNewlines:, IntegratedTSView::setForeColor:, SSHTask::setPort:, SSHTask::setProtocol:, IntegratedTSView::setRows:columns:, IntegratedTSView::terminal, and termView. Referenced by reconnect:, and startNewSession. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 369 of file MyDocument.m. References length(). Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 408 of file MyDocument.m. References IntegratedTSView::appendAttributedString:, and termView. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 359 of file MyDocument.m. References SSHTask::sendToHost:, and session. Here is the call graph for this function: ![]() |
|
|
Definition at line 364 of file MyDocument.m. References printScreen:. Here is the call graph for this function: ![]() |
|
|
NSTextStorage underlying the terminal. This method affords the AppleScript text suite access to the terminal screen. KVC compliance for AppleScript.
Definition at line 576 of file MyDocument.m. References IntegratedTSView::terminal, termView, and TextStorageTerminal::textStorage. Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 338 of file MyDocument.m. References session, sessionParams, SSHTask::setRows:columns:, and CrescatAppDelegate::setSettings:forHost:userID:. Here is the call graph for this function: ![]() |
|