Files
SwiftTerm/docs/Protocols/TerminalViewDelegate.html

408 lines
21 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<title>TerminalViewDelegate Protocol Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Protocol/TerminalViewDelegate" class="dashAnchor"></a>
<a title="TerminalViewDelegate Protocol Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftTerm 1.0 Docs</a> (61% documented)</p>
<p class="header-right"><a href="https://github.com/migueldeicaza/SwiftTerm"><img src="../img/gh.png"/>View on GitHub</a></p>
<p class="header-right"><a href="dash-feed://https%3A%2F%2Fmigueldeicaza%2Egithub%2Eio%2FSwiftTerm%2Fdocsets%2FSwiftTerm%2Exml"><img src="../img/dash.png"/>Install in Dash</a></p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">SwiftTerm Reference</a>
<img id="carat" src="../img/carat.png" />
TerminalViewDelegate Protocol Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/HeadlessTerminal.html">HeadlessTerminal</a>
</li>
<li class="nav-group-task">
<a href="../Classes/LocalProcess.html">LocalProcess</a>
</li>
<li class="nav-group-task">
<a href="../Classes/LocalProcessTerminalView.html">LocalProcessTerminalView</a>
</li>
<li class="nav-group-task">
<a href="../Classes/PseudoTerminalHelpers.html">PseudoTerminalHelpers</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Terminal.html">Terminal</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Terminal/MouseMode.html">– MouseMode</a>
</li>
<li class="nav-group-task">
<a href="../Classes/Terminal/WindowManipulationCommand.html">– WindowManipulationCommand</a>
</li>
<li class="nav-group-task">
<a href="../Classes/TerminalDebugView.html">TerminalDebugView</a>
</li>
<li class="nav-group-task">
<a href="../Classes/TerminalView.html">TerminalView</a>
</li>
<li class="nav-group-task">
<a href="../Classes/TerminalView/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a href="../Classes/TerminalView.html">TerminalView</a>
</li>
<li class="nav-group-task">
<a href="../Classes/TerminalView/Options.html">– Options</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/CursorStyle.html">CursorStyle</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Extensions/TerminalViewDelegate.html">TerminalViewDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Protocols/LocalProcessDelegate.html">LocalProcessDelegate</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/LocalProcessTerminalViewDelegate.html">LocalProcessTerminalViewDelegate</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/TerminalDelegate.html">TerminalDelegate</a>
</li>
<li class="nav-group-task">
<a href="../Protocols/TerminalViewDelegate.html">TerminalViewDelegate</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/Attribute.html">Attribute</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Attribute/Color.html">– Color</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CharData.html">CharData</a>
</li>
<li class="nav-group-task">
<a href="../Structs/CharacterStyle.html">CharacterStyle</a>
</li>
<li class="nav-group-task">
<a href="../Structs/TerminalOptions.html">TerminalOptions</a>
</li>
<li class="nav-group-task">
<a href="../Structs/TinyAtom.html">TinyAtom</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>TerminalViewDelegate</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">TerminalViewDelegate</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>
</div>
</div>
<p>Undocumented</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:9SwiftTerm20TerminalViewDelegateP11sizeChanged6source7newCols0I4RowsyAA0cD0C_S2itF"></a>
<a name="//apple_ref/swift/Method/sizeChanged(source:newCols:newRows:)" class="dashAnchor"></a>
<a class="token" href="#/s:9SwiftTerm20TerminalViewDelegateP11sizeChanged6source7newCols0I4RowsyAA0cD0C_S2itF">sizeChanged(source:<wbr>newCols:<wbr>newRows:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The client code sending commands to the terminal has requested a new size for the terminal
Applications that support this should call the <code>TerminalView.getOptimalFrameSize</code>
to get the ideal frame size.</p>
<p>This is needed for the rare cases where the remote client request 80 or 132 column displays,
it is a rare feature and you most likely can ignore this request.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">sizeChanged</span><span class="p">(</span><span class="nv">source</span><span class="p">:</span> <span class="kt"><a href="../Classes/TerminalView.html">TerminalView</a></span><span class="p">,</span> <span class="nv">newCols</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">newRows</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/Apple/TerminalViewDelegate.swift#L19">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9SwiftTerm20TerminalViewDelegateP03setC5Title6source5titleyAA0cD0C_SStF"></a>
<a name="//apple_ref/swift/Method/setTerminalTitle(source:title:)" class="dashAnchor"></a>
<a class="token" href="#/s:9SwiftTerm20TerminalViewDelegateP03setC5Title6source5titleyAA0cD0C_SStF">setTerminalTitle(source:<wbr>title:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Request to change the title of the terminal.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">setTerminalTitle</span><span class="p">(</span><span class="nv">source</span><span class="p">:</span> <span class="kt"><a href="../Classes/TerminalView.html">TerminalView</a></span><span class="p">,</span> <span class="nv">title</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/Apple/TerminalViewDelegate.swift#L24">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9SwiftTerm20TerminalViewDelegateP4send6source4datayAA0cD0C_s10ArraySliceVys5UInt8VGtF"></a>
<a name="//apple_ref/swift/Method/send(source:data:)" class="dashAnchor"></a>
<a class="token" href="#/s:9SwiftTerm20TerminalViewDelegateP4send6source4datayAA0cD0C_s10ArraySliceVys5UInt8VGtF">send(source:<wbr>data:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Request that date be sent to the application running inside the terminal.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">send</span><span class="p">(</span><span class="nv">source</span><span class="p">:</span> <span class="kt"><a href="../Classes/TerminalView.html">TerminalView</a></span><span class="p">,</span> <span class="nv">data</span><span class="p">:</span> <span class="kt">ArraySlice</span><span class="o">&lt;</span><span class="kt">UInt8</span><span class="o">&gt;</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>data</em>
</code>
</td>
<td>
<div>
<p>Slice of data that should be sent</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="slightly-smaller">
<a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/Apple/TerminalViewDelegate.swift#L30">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9SwiftTerm20TerminalViewDelegateP8scrolled6source8positionyAA0cD0C_SdtF"></a>
<a name="//apple_ref/swift/Method/scrolled(source:position:)" class="dashAnchor"></a>
<a class="token" href="#/s:9SwiftTerm20TerminalViewDelegateP8scrolled6source8positionyAA0cD0C_SdtF">scrolled(source:<wbr>position:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Invoked when the terminal has been scrolled and the new position is provided</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">scrolled</span><span class="p">(</span><span class="nv">source</span><span class="p">:</span> <span class="kt"><a href="../Classes/TerminalView.html">TerminalView</a></span><span class="p">,</span> <span class="nv">position</span><span class="p">:</span> <span class="kt">Double</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>position</em>
</code>
</td>
<td>
<div>
<p>the relative position that the code was scrolled to, a value between 0 and 1</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="slightly-smaller">
<a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/Apple/TerminalViewDelegate.swift#L36">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9SwiftTerm20TerminalViewDelegateP15requestOpenLink6source4link6paramsyAA0cD0C_SSSDyS2SGtF"></a>
<a name="//apple_ref/swift/Method/requestOpenLink(source:link:params:)" class="dashAnchor"></a>
<a class="token" href="#/s:9SwiftTerm20TerminalViewDelegateP15requestOpenLink6source4link6paramsyAA0cD0C_SSSDyS2SGtF">requestOpenLink(source:<wbr>link:<wbr>params:<wbr>)</a>
</code>
<span class="declaration-note">
Default implementation
</span>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Invoked in response to the user clicking on a link, which is most likely a url, but is not
mandatory, so custom implementations receive a string, and they can act on this as a way
of communciating with the host if desired. The default implementation calls NSWorkspace.shared.open()
on the URL.</p>
</div>
<h4>Default Implementation</h4>
<div class="default_impl abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">requestOpenLink</span><span class="p">(</span><span class="nv">source</span><span class="p">:</span> <span class="kt"><a href="../Classes/TerminalView.html">TerminalView</a></span><span class="p">,</span> <span class="nv">link</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">params</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">String</span><span class="p">])</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>source</em>
</code>
</td>
<td>
<div>
<p>the terminalview that called this method</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>link</em>
</code>
</td>
<td>
<div>
<p>the string that was encoded as a link by the client application, typically a url,
but could be anything, and could be used to communicate by the embedded application and the host</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>params</em>
</code>
</td>
<td>
<div>
<p>the specification allows for key/value pairs to be provided, this contains the
key and value pairs that were provided</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="slightly-smaller">
<a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/Apple/TerminalViewDelegate.swift#L49">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2020 <a class="link" href="https://tirania.org/" target="_blank" rel="external">Miguel de Icaza</a>. All rights reserved. (Last updated: 2020-04-28)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>