Structs.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Structures Reference</title>
  5. <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
  6. <link rel="stylesheet" type="text/css" href="css/highlight.css" />
  7. <meta charset='utf-8'>
  8. <script src="js/jquery.min.js" defer></script>
  9. <script src="js/jazzy.js" defer></script>
  10. </head>
  11. <body>
  12. <a name="//apple_ref/swift/Section/Structures" class="dashAnchor"></a>
  13. <a title="Structures Reference"></a>
  14. <header>
  15. <div class="content-wrapper">
  16. <p><a href="index.html">SwiftTerm 1.0 Docs</a> (65% documented)</p>
  17. <p class="header-right"><a href="https://github.com/migueldeicaza/SwiftTerm"><img src="img/gh.png"/>View on GitHub</a></p>
  18. <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>
  19. </div>
  20. </header>
  21. <div class="content-wrapper">
  22. <p id="breadcrumbs">
  23. <a href="index.html">SwiftTerm Reference</a>
  24. <img id="carat" src="img/carat.png" />
  25. Structures Reference
  26. </p>
  27. </div>
  28. <div class="content-wrapper">
  29. <nav class="sidebar">
  30. <ul class="nav-groups">
  31. <li class="nav-group-name">
  32. <a href="Classes.html">Classes</a>
  33. <ul class="nav-group-tasks">
  34. <li class="nav-group-task">
  35. <a href="Classes/Color.html">Color</a>
  36. </li>
  37. <li class="nav-group-task">
  38. <a href="Classes/HeadlessTerminal.html">HeadlessTerminal</a>
  39. </li>
  40. <li class="nav-group-task">
  41. <a href="Classes/LocalProcess.html">LocalProcess</a>
  42. </li>
  43. <li class="nav-group-task">
  44. <a href="Classes/LocalProcessTerminalView.html">LocalProcessTerminalView</a>
  45. </li>
  46. <li class="nav-group-task">
  47. <a href="Classes/PseudoTerminalHelpers.html">PseudoTerminalHelpers</a>
  48. </li>
  49. <li class="nav-group-task">
  50. <a href="Classes/Terminal.html">Terminal</a>
  51. </li>
  52. <li class="nav-group-task">
  53. <a href="Classes/Terminal/MouseMode.html">– MouseMode</a>
  54. </li>
  55. <li class="nav-group-task">
  56. <a href="Classes/Terminal/WindowManipulationCommand.html">– WindowManipulationCommand</a>
  57. </li>
  58. <li class="nav-group-task">
  59. <a href="Classes/TerminalAccessory.html">TerminalAccessory</a>
  60. </li>
  61. <li class="nav-group-task">
  62. <a href="Classes/TerminalDebugView.html">TerminalDebugView</a>
  63. </li>
  64. <li class="nav-group-task">
  65. <a href="Classes/TerminalView.html">TerminalView</a>
  66. </li>
  67. <li class="nav-group-task">
  68. <a href="Classes/TerminalView/Font.html">– Font</a>
  69. </li>
  70. <li class="nav-group-task">
  71. <a href="Classes/TerminalView.html">TerminalView</a>
  72. </li>
  73. <li class="nav-group-task">
  74. <a href="Classes/TerminalView/Font.html">– Font</a>
  75. </li>
  76. </ul>
  77. </li>
  78. <li class="nav-group-name">
  79. <a href="Enums.html">Enumerations</a>
  80. <ul class="nav-group-tasks">
  81. <li class="nav-group-task">
  82. <a href="Enums/CursorStyle.html">CursorStyle</a>
  83. </li>
  84. </ul>
  85. </li>
  86. <li class="nav-group-name">
  87. <a href="Extensions.html">Extensions</a>
  88. <ul class="nav-group-tasks">
  89. <li class="nav-group-task">
  90. <a href="Extensions/TerminalViewDelegate.html">TerminalViewDelegate</a>
  91. </li>
  92. </ul>
  93. </li>
  94. <li class="nav-group-name">
  95. <a href="Protocols.html">Protocols</a>
  96. <ul class="nav-group-tasks">
  97. <li class="nav-group-task">
  98. <a href="Protocols/LocalProcessDelegate.html">LocalProcessDelegate</a>
  99. </li>
  100. <li class="nav-group-task">
  101. <a href="Protocols/LocalProcessTerminalViewDelegate.html">LocalProcessTerminalViewDelegate</a>
  102. </li>
  103. <li class="nav-group-task">
  104. <a href="Protocols/TerminalDelegate.html">TerminalDelegate</a>
  105. </li>
  106. <li class="nav-group-task">
  107. <a href="Protocols/TerminalViewDelegate.html">TerminalViewDelegate</a>
  108. </li>
  109. </ul>
  110. </li>
  111. <li class="nav-group-name">
  112. <a href="Structs.html">Structures</a>
  113. <ul class="nav-group-tasks">
  114. <li class="nav-group-task">
  115. <a href="Structs/Attribute.html">Attribute</a>
  116. </li>
  117. <li class="nav-group-task">
  118. <a href="Structs/Attribute/Color.html">– Color</a>
  119. </li>
  120. <li class="nav-group-task">
  121. <a href="Structs/CharData.html">CharData</a>
  122. </li>
  123. <li class="nav-group-task">
  124. <a href="Structs/CharacterStyle.html">CharacterStyle</a>
  125. </li>
  126. <li class="nav-group-task">
  127. <a href="Structs/TerminalOptions.html">TerminalOptions</a>
  128. </li>
  129. <li class="nav-group-task">
  130. <a href="Structs/TinyAtom.html">TinyAtom</a>
  131. </li>
  132. </ul>
  133. </li>
  134. <li class="nav-group-name">
  135. <a href="Typealiases.html">Type Aliases</a>
  136. <ul class="nav-group-tasks">
  137. <li class="nav-group-task">
  138. <a href="Typealiases.html#/s:9SwiftTerm7TTImagea">TTImage</a>
  139. </li>
  140. </ul>
  141. </li>
  142. </ul>
  143. </nav>
  144. <article class="main-content">
  145. <section>
  146. <section class="section">
  147. <h1>Structures</h1>
  148. <p>The following structures are available globally.</p>
  149. </section>
  150. <section class="section task-group-section">
  151. <div class="task-group">
  152. <ul>
  153. <li class="item">
  154. <div>
  155. <code>
  156. <a name="/s:9SwiftTerm14CharacterStyleV"></a>
  157. <a name="//apple_ref/swift/Struct/CharacterStyle" class="dashAnchor"></a>
  158. <a class="token" href="#/s:9SwiftTerm14CharacterStyleV">CharacterStyle</a>
  159. </code>
  160. </div>
  161. <div class="height-container">
  162. <div class="pointer-container"></div>
  163. <section class="section">
  164. <div class="pointer"></div>
  165. <div class="abstract">
  166. <p>This option set describes the character style for a cell, this includes
  167. information about the font to use as well as decorations on the text</p>
  168. <a href="Structs/CharacterStyle.html" class="slightly-smaller">See more</a>
  169. </div>
  170. <div class="declaration">
  171. <h4>Declaration</h4>
  172. <div class="language">
  173. <p class="aside-title">Swift</p>
  174. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">CharacterStyle</span> <span class="p">:</span> <span class="kt">OptionSet</span><span class="p">,</span> <span class="kt">Hashable</span></code></pre>
  175. </div>
  176. </div>
  177. <div class="slightly-smaller">
  178. <a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/CharData.swift#L13-L51">Show on GitHub</a>
  179. </div>
  180. </section>
  181. </div>
  182. </li>
  183. <li class="item">
  184. <div>
  185. <code>
  186. <a name="/s:9SwiftTerm9AttributeV"></a>
  187. <a name="//apple_ref/swift/Struct/Attribute" class="dashAnchor"></a>
  188. <a class="token" href="#/s:9SwiftTerm9AttributeV">Attribute</a>
  189. </code>
  190. </div>
  191. <div class="height-container">
  192. <div class="pointer-container"></div>
  193. <section class="section">
  194. <div class="pointer"></div>
  195. <div class="abstract">
  196. <p>Attribute contains the foreground and background color information for the invidual
  197. cells, as well as the character style of the cell (bold, underline, inverse) that the character
  198. should be drawn as.</p>
  199. <a href="Structs/Attribute.html" class="slightly-smaller">See more</a>
  200. </div>
  201. <div class="declaration">
  202. <h4>Declaration</h4>
  203. <div class="language">
  204. <p class="aside-title">Swift</p>
  205. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Attribute</span> <span class="p">:</span> <span class="kt">Equatable</span><span class="p">,</span> <span class="kt">Hashable</span></code></pre>
  206. </div>
  207. </div>
  208. <div class="slightly-smaller">
  209. <a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/CharData.swift#L58-L167">Show on GitHub</a>
  210. </div>
  211. </section>
  212. </div>
  213. </li>
  214. <li class="item">
  215. <div>
  216. <code>
  217. <a name="/s:9SwiftTerm8TinyAtomV"></a>
  218. <a name="//apple_ref/swift/Struct/TinyAtom" class="dashAnchor"></a>
  219. <a class="token" href="#/s:9SwiftTerm8TinyAtomV">TinyAtom</a>
  220. </code>
  221. </div>
  222. <div class="height-container">
  223. <div class="pointer-container"></div>
  224. <section class="section">
  225. <div class="pointer"></div>
  226. <div class="abstract">
  227. <p>TinyAtoms are 16-bit values that can be used to represent a string as a number
  228. you create them by calling TinyAtom.lookup (String) and retrieve the
  229. value using the <code>target</code> property. They are used to store the urls and any
  230. additional parameter information in the OSC 8 scenario.</p>
  231. <p>This is kept to 16 bits for now, so that we keep the CharData to less than 15 bytes
  232. it could in theory be changed to be 24 bits without much trouble</p>
  233. <a href="Structs/TinyAtom.html" class="slightly-smaller">See more</a>
  234. </div>
  235. <div class="declaration">
  236. <h4>Declaration</h4>
  237. <div class="language">
  238. <p class="aside-title">Swift</p>
  239. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TinyAtom</span></code></pre>
  240. </div>
  241. </div>
  242. <div class="slightly-smaller">
  243. <a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/CharData.swift#L176-L207">Show on GitHub</a>
  244. </div>
  245. </section>
  246. </div>
  247. </li>
  248. <li class="item">
  249. <div>
  250. <code>
  251. <a name="/s:9SwiftTerm8CharDataV"></a>
  252. <a name="//apple_ref/swift/Struct/CharData" class="dashAnchor"></a>
  253. <a class="token" href="#/s:9SwiftTerm8CharDataV">CharData</a>
  254. </code>
  255. </div>
  256. <div class="height-container">
  257. <div class="pointer-container"></div>
  258. <section class="section">
  259. <div class="pointer"></div>
  260. <div class="abstract">
  261. <p>Stores a cell with both the character being displayed as well as the color attribute.
  262. This uses an Int32 to store the value, if the value can not be encoded as a single Unicode.Scalar,
  263. then an index is stored that is looked up in parallel, so that full grapheme clusters can be tracked.</p>
  264. <p>Use the <code>getCharacter</code> function to get the stored Character, and use the <code>attribute</code> property
  265. to retrieve the color and other character attributes. The <code>width</code> property contains the number of
  266. columns used by the <code>Character</code> stored in this <code>CharData</code> on the screen.</p>
  267. <p>It is possible to change the value of the stored character by calling the <code>setValue</code> method.</p>
  268. <a href="Structs/CharData.html" class="slightly-smaller">See more</a>
  269. </div>
  270. <div class="declaration">
  271. <h4>Declaration</h4>
  272. <div class="language">
  273. <p class="aside-title">Swift</p>
  274. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">CharData</span></code></pre>
  275. </div>
  276. </div>
  277. <div class="slightly-smaller">
  278. <a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/CharData.swift#L220-L342">Show on GitHub</a>
  279. </div>
  280. </section>
  281. </div>
  282. </li>
  283. <li class="item">
  284. <div>
  285. <code>
  286. <a name="/s:9SwiftTerm15TerminalOptionsV"></a>
  287. <a name="//apple_ref/swift/Struct/TerminalOptions" class="dashAnchor"></a>
  288. <a class="token" href="#/s:9SwiftTerm15TerminalOptionsV">TerminalOptions</a>
  289. </code>
  290. </div>
  291. <div class="height-container">
  292. <div class="pointer-container"></div>
  293. <section class="section">
  294. <div class="pointer"></div>
  295. <div class="abstract">
  296. <p>Configuration options for the terminal at startup, these values are only read at startup</p>
  297. <a href="Structs/TerminalOptions.html" class="slightly-smaller">See more</a>
  298. </div>
  299. <div class="declaration">
  300. <h4>Declaration</h4>
  301. <div class="language">
  302. <p class="aside-title">Swift</p>
  303. <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">TerminalOptions</span></code></pre>
  304. </div>
  305. </div>
  306. <div class="slightly-smaller">
  307. <a href="https://github.com/migueldeicaza/SwiftTerm/tree/master/Sources/SwiftTerm/TerminalOptions.swift#L23-L61">Show on GitHub</a>
  308. </div>
  309. </section>
  310. </div>
  311. </li>
  312. </ul>
  313. </div>
  314. </section>
  315. </section>
  316. <section id="footer">
  317. <p>&copy; 2020 <a class="link" href="https://tirania.org/" target="_blank" rel="external">Miguel de Icaza</a>. All rights reserved. (Last updated: 2020-05-30)</p>
  318. <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
  319. </section>
  320. </article>
  321. </div>
  322. </body>
  323. </div>
  324. </html>