ConsoleDriver.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. //
  2. // Driver.cs: Definition for the Console Driver API
  3. //
  4. // Authors:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Runtime.CompilerServices;
  10. using System.Runtime.InteropServices;
  11. using Mono.Terminal;
  12. using NStack;
  13. using Unix.Terminal;
  14. namespace Terminal.Gui {
  15. /// <summary>
  16. /// Basic colors that can be used to set the foreground and background colors in console applications. These can only be
  17. /// </summary>
  18. public enum Color {
  19. /// <summary>
  20. /// The black color.
  21. /// </summary>
  22. Black,
  23. /// <summary>
  24. /// The blue color.
  25. /// </summary>
  26. Blue,
  27. /// <summary>
  28. /// The green color.
  29. /// </summary>
  30. Green,
  31. /// <summary>
  32. /// The cyan color.
  33. /// </summary>
  34. Cyan,
  35. /// <summary>
  36. /// The red color.
  37. /// </summary>
  38. Red,
  39. /// <summary>
  40. /// The magenta color.
  41. /// </summary>
  42. Magenta,
  43. /// <summary>
  44. /// The brown color.
  45. /// </summary>
  46. Brown,
  47. /// <summary>
  48. /// The gray color.
  49. /// </summary>
  50. Gray,
  51. /// <summary>
  52. /// The dark gray color.
  53. /// </summary>
  54. DarkGray,
  55. /// <summary>
  56. /// The bright bBlue color.
  57. /// </summary>
  58. BrightBlue,
  59. /// <summary>
  60. /// The bright green color.
  61. /// </summary>
  62. BrightGreen,
  63. /// <summary>
  64. /// The brigh cyan color.
  65. /// </summary>
  66. BrighCyan,
  67. /// <summary>
  68. /// The bright red color.
  69. /// </summary>
  70. BrightRed,
  71. /// <summary>
  72. /// The bright magenta color.
  73. /// </summary>
  74. BrightMagenta,
  75. /// <summary>
  76. /// The bright yellow color.
  77. /// </summary>
  78. BrightYellow,
  79. /// <summary>
  80. /// The White color.
  81. /// </summary>
  82. White
  83. }
  84. /// <summary>
  85. /// Attributes are used as elements that contain both a foreground and a background or platform specific features
  86. /// </summary>
  87. /// <remarks>
  88. /// Attributes are needed to map colors to terminal capabilities that might lack colors, on color
  89. /// scenarios, they encode both the foreground and the background color and are used in the ColorScheme
  90. /// class to define color schemes that can be used in your application.
  91. /// </remarks>
  92. public struct Attribute {
  93. internal int value;
  94. internal Color foreground;
  95. internal Color background;
  96. /// <summary>
  97. /// Initializes a new instance of the <see cref="T:Terminal.Gui.Attribute"/> struct.
  98. /// </summary>
  99. /// <param name="value">Value.</param>
  100. /// <param name="foreground">Foreground</param>
  101. /// <param name="background">Background</param>
  102. public Attribute (int value, Color foreground = new Color(), Color background = new Color())
  103. {
  104. this.value = value;
  105. this.foreground = foreground;
  106. this.background = background;
  107. }
  108. /// <summary>
  109. /// Initializes a new instance of the <see cref="T:Terminal.Gui.Attribute"/> struct.
  110. /// </summary>
  111. /// <param name="foreground">Foreground</param>
  112. /// <param name="background">Background</param>
  113. public Attribute (Color foreground = new Color (), Color background = new Color ())
  114. {
  115. this.value = value = ((int)foreground | (int)background << 4);
  116. this.foreground = foreground;
  117. this.background = background;
  118. }
  119. /// <summary>
  120. /// Implicit conversion from an attribute to the underlying Int32 representation
  121. /// </summary>
  122. /// <returns>The integer value stored in the attribute.</returns>
  123. /// <param name="c">The attribute to convert</param>
  124. public static implicit operator int (Attribute c) => c.value;
  125. /// <summary>
  126. /// Implicitly convert an integer value into an attribute
  127. /// </summary>
  128. /// <returns>An attribute with the specified integer value.</returns>
  129. /// <param name="v">value</param>
  130. public static implicit operator Attribute (int v) => new Attribute (v);
  131. /// <summary>
  132. /// Creates an attribute from the specified foreground and background.
  133. /// </summary>
  134. /// <returns>The make.</returns>
  135. /// <param name="foreground">Foreground color to use.</param>
  136. /// <param name="background">Background color to use.</param>
  137. public static Attribute Make (Color foreground, Color background)
  138. {
  139. if (Application.Driver == null)
  140. throw new InvalidOperationException ("The Application has not been initialized");
  141. return Application.Driver.MakeAttribute (foreground, background);
  142. }
  143. }
  144. /// <summary>
  145. /// Color scheme definitions, they cover some common scenarios and are used
  146. /// typically in toplevel containers to set the scheme that is used by all the
  147. /// views contained inside.
  148. /// </summary>
  149. public class ColorScheme {
  150. Attribute _normal;
  151. Attribute _focus;
  152. Attribute _hotNormal;
  153. Attribute _hotFocus;
  154. Attribute _disabled;
  155. internal string caller = "";
  156. /// <summary>
  157. /// The default color for text, when the view is not focused.
  158. /// </summary>
  159. public Attribute Normal { get { return _normal; } set { _normal = SetAttribute (value); } }
  160. /// <summary>
  161. /// The color for text when the view has the focus.
  162. /// </summary>
  163. public Attribute Focus { get { return _focus; } set { _focus = SetAttribute (value); } }
  164. /// <summary>
  165. /// The color for the hotkey when a view is not focused
  166. /// </summary>
  167. public Attribute HotNormal { get { return _hotNormal; } set { _hotNormal = SetAttribute (value); } }
  168. /// <summary>
  169. /// The color for the hotkey when the view is focused.
  170. /// </summary>
  171. public Attribute HotFocus { get { return _hotFocus; } set { _hotFocus = SetAttribute (value); } }
  172. /// <summary>
  173. /// The default color for text, when the view is disabled.
  174. /// </summary>
  175. public Attribute Disabled { get { return _disabled; } set { _disabled = SetAttribute (value); } }
  176. bool preparingScheme = false;
  177. Attribute SetAttribute (Attribute attribute, [CallerMemberName]string callerMemberName = null)
  178. {
  179. if (!Application._initialized && !preparingScheme)
  180. return attribute;
  181. if (preparingScheme)
  182. return attribute;
  183. preparingScheme = true;
  184. switch (caller) {
  185. case "TopLevel":
  186. switch (callerMemberName) {
  187. case "Normal":
  188. HotNormal = Application.Driver.MakeAttribute (HotNormal.foreground, attribute.background);
  189. break;
  190. case "Focus":
  191. HotFocus = Application.Driver.MakeAttribute (HotFocus.foreground, attribute.background);
  192. break;
  193. case "HotNormal":
  194. HotFocus = Application.Driver.MakeAttribute (attribute.foreground, HotFocus.background);
  195. break;
  196. case "HotFocus":
  197. HotNormal = Application.Driver.MakeAttribute (attribute.foreground, HotNormal.background);
  198. if (Focus.foreground != attribute.background)
  199. Focus = Application.Driver.MakeAttribute (Focus.foreground, attribute.background);
  200. break;
  201. }
  202. break;
  203. case "Base":
  204. switch (callerMemberName) {
  205. case "Normal":
  206. HotNormal = Application.Driver.MakeAttribute (HotNormal.foreground, attribute.background);
  207. break;
  208. case "Focus":
  209. HotFocus = Application.Driver.MakeAttribute (HotFocus.foreground, attribute.background);
  210. break;
  211. case "HotNormal":
  212. HotFocus = Application.Driver.MakeAttribute (attribute.foreground, HotFocus.background);
  213. Normal = Application.Driver.MakeAttribute (Normal.foreground, attribute.background);
  214. break;
  215. case "HotFocus":
  216. HotNormal = Application.Driver.MakeAttribute (attribute.foreground, HotNormal.background);
  217. if (Focus.foreground != attribute.background)
  218. Focus = Application.Driver.MakeAttribute (Focus.foreground, attribute.background);
  219. break;
  220. }
  221. break;
  222. case "Menu":
  223. switch (callerMemberName) {
  224. case "Normal":
  225. if (Focus.background != attribute.background)
  226. Focus = Application.Driver.MakeAttribute (attribute.foreground, Focus.background);
  227. HotNormal = Application.Driver.MakeAttribute (HotNormal.foreground, attribute.background);
  228. Disabled = Application.Driver.MakeAttribute (Disabled.foreground, attribute.background);
  229. break;
  230. case "Focus":
  231. Normal = Application.Driver.MakeAttribute (attribute.foreground, Normal.background);
  232. HotFocus = Application.Driver.MakeAttribute (HotFocus.foreground, attribute.background);
  233. break;
  234. case "HotNormal":
  235. if (Focus.background != attribute.background)
  236. HotFocus = Application.Driver.MakeAttribute (attribute.foreground, HotFocus.background);
  237. Normal = Application.Driver.MakeAttribute (Normal.foreground, attribute.background);
  238. Disabled = Application.Driver.MakeAttribute (Disabled.foreground, attribute.background);
  239. break;
  240. case "HotFocus":
  241. HotNormal = Application.Driver.MakeAttribute (attribute.foreground, HotNormal.background);
  242. if (Focus.foreground != attribute.background)
  243. Focus = Application.Driver.MakeAttribute (Focus.foreground, attribute.background);
  244. break;
  245. case "Disabled":
  246. if (Focus.background != attribute.background)
  247. HotFocus = Application.Driver.MakeAttribute (attribute.foreground, HotFocus.background);
  248. Normal = Application.Driver.MakeAttribute (Normal.foreground, attribute.background);
  249. HotNormal = Application.Driver.MakeAttribute (HotNormal.foreground, attribute.background);
  250. break;
  251. }
  252. break;
  253. case "Dialog":
  254. switch (callerMemberName) {
  255. case "Normal":
  256. if (Focus.background != attribute.background)
  257. Focus = Application.Driver.MakeAttribute (attribute.foreground, Focus.background);
  258. HotNormal = Application.Driver.MakeAttribute (HotNormal.foreground, attribute.background);
  259. break;
  260. case "Focus":
  261. Normal = Application.Driver.MakeAttribute (attribute.foreground, Normal.background);
  262. HotFocus = Application.Driver.MakeAttribute (HotFocus.foreground, attribute.background);
  263. break;
  264. case "HotNormal":
  265. if (Focus.background != attribute.background)
  266. HotFocus = Application.Driver.MakeAttribute (attribute.foreground, HotFocus.background);
  267. if (Normal.foreground != attribute.background)
  268. Normal = Application.Driver.MakeAttribute (Normal.foreground, attribute.background);
  269. break;
  270. case "HotFocus":
  271. HotNormal = Application.Driver.MakeAttribute (attribute.foreground, HotNormal.background);
  272. if (Focus.foreground != attribute.background)
  273. Focus = Application.Driver.MakeAttribute (Focus.foreground, attribute.background);
  274. break;
  275. }
  276. break;
  277. case "Error":
  278. switch (callerMemberName) {
  279. case "Normal":
  280. HotNormal = Application.Driver.MakeAttribute (HotNormal.foreground, attribute.background);
  281. HotFocus = Application.Driver.MakeAttribute (HotFocus.foreground, attribute.background);
  282. break;
  283. case "HotNormal":
  284. case "HotFocus":
  285. HotFocus = Application.Driver.MakeAttribute (attribute.foreground, attribute.background);
  286. Normal = Application.Driver.MakeAttribute (Normal.foreground, attribute.background);
  287. break;
  288. }
  289. break;
  290. }
  291. preparingScheme = false;
  292. return attribute;
  293. }
  294. }
  295. /// <summary>
  296. /// The default ColorSchemes for the application.
  297. /// </summary>
  298. public static class Colors {
  299. static ColorScheme _toplevel;
  300. static ColorScheme _base;
  301. static ColorScheme _dialog;
  302. static ColorScheme _menu;
  303. static ColorScheme _error;
  304. /// <summary>
  305. /// The application toplevel color scheme, for the default toplevel views.
  306. /// </summary>
  307. public static ColorScheme TopLevel { get { return _toplevel; } set { _toplevel = SetColorScheme (value); } }
  308. /// <summary>
  309. /// The base color scheme, for the default toplevel views.
  310. /// </summary>
  311. public static ColorScheme Base { get { return _base; } set { _base = SetColorScheme (value); } }
  312. /// <summary>
  313. /// The dialog color scheme, for standard popup dialog boxes
  314. /// </summary>
  315. public static ColorScheme Dialog { get { return _dialog; } set { _dialog = SetColorScheme (value); } }
  316. /// <summary>
  317. /// The menu bar color
  318. /// </summary>
  319. public static ColorScheme Menu { get { return _menu; } set { _menu = SetColorScheme (value); } }
  320. /// <summary>
  321. /// The color scheme for showing errors.
  322. /// </summary>
  323. public static ColorScheme Error { get { return _error; } set { _error = SetColorScheme (value); } }
  324. static ColorScheme SetColorScheme (ColorScheme colorScheme, [CallerMemberName]string callerMemberName = null)
  325. {
  326. colorScheme.caller = callerMemberName;
  327. return colorScheme;
  328. }
  329. }
  330. /// <summary>
  331. /// Special characters that can be drawn with Driver.AddSpecial.
  332. /// </summary>
  333. public enum SpecialChar {
  334. /// <summary>
  335. /// Horizontal line character.
  336. /// </summary>
  337. HLine,
  338. /// <summary>
  339. /// Vertical line character.
  340. /// </summary>
  341. VLine,
  342. /// <summary>
  343. /// Stipple pattern
  344. /// </summary>
  345. Stipple,
  346. /// <summary>
  347. /// Diamond character
  348. /// </summary>
  349. Diamond,
  350. /// <summary>
  351. /// Upper left corner
  352. /// </summary>
  353. ULCorner,
  354. /// <summary>
  355. /// Lower left corner
  356. /// </summary>
  357. LLCorner,
  358. /// <summary>
  359. /// Upper right corner
  360. /// </summary>
  361. URCorner,
  362. /// <summary>
  363. /// Lower right corner
  364. /// </summary>
  365. LRCorner,
  366. /// <summary>
  367. /// Left tee
  368. /// </summary>
  369. LeftTee,
  370. /// <summary>
  371. /// Right tee
  372. /// </summary>
  373. RightTee,
  374. /// <summary>
  375. /// Top tee
  376. /// </summary>
  377. TopTee,
  378. /// <summary>
  379. /// The bottom tee.
  380. /// </summary>
  381. BottomTee,
  382. }
  383. /// <summary>
  384. /// ConsoleDriver is an abstract class that defines the requirements for a console driver. One implementation if the CursesDriver, and another one uses the .NET Console one.
  385. /// </summary>
  386. public abstract class ConsoleDriver {
  387. /// <summary>
  388. /// The handler fired when the terminal is resized.
  389. /// </summary>
  390. protected Action TerminalResized;
  391. /// <summary>
  392. /// The current number of columns in the terminal.
  393. /// </summary>
  394. public abstract int Cols { get; }
  395. /// <summary>
  396. /// The current number of rows in the terminal.
  397. /// </summary>
  398. public abstract int Rows { get; }
  399. /// <summary>
  400. /// Initializes the driver
  401. /// </summary>
  402. /// <param name="terminalResized">Method to invoke when the terminal is resized.</param>
  403. public abstract void Init (Action terminalResized);
  404. /// <summary>
  405. /// Moves the cursor to the specified column and row.
  406. /// </summary>
  407. /// <param name="col">Column to move the cursor to.</param>
  408. /// <param name="row">Row to move the cursor to.</param>
  409. public abstract void Move (int col, int row);
  410. /// <summary>
  411. /// Adds the specified rune to the display at the current cursor position
  412. /// </summary>
  413. /// <param name="rune">Rune to add.</param>
  414. public abstract void AddRune (Rune rune);
  415. /// <summary>
  416. /// Adds the specified
  417. /// </summary>
  418. /// <param name="str">String.</param>
  419. public abstract void AddStr (ustring str);
  420. /// <summary>
  421. /// Prepare the driver and set the key and mouse events handlers.
  422. /// </summary>
  423. /// <param name="mainLoop">The main loop.</param>
  424. /// <param name="keyHandler">The handler for ProcessKey</param>
  425. /// <param name="keyDownHandler">The handler for key down events</param>
  426. /// <param name="keyUpHandler">The handler for key up events</param>
  427. /// <param name="mouseHandler">The handler for mouse events</param>
  428. public abstract void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler);
  429. /// <summary>
  430. /// Updates the screen to reflect all the changes that have been done to the display buffer
  431. /// </summary>
  432. public abstract void Refresh ();
  433. /// <summary>
  434. /// Updates the location of the cursor position
  435. /// </summary>
  436. public abstract void UpdateCursor ();
  437. /// <summary>
  438. /// Ends the execution of the console driver.
  439. /// </summary>
  440. public abstract void End ();
  441. /// <summary>
  442. /// Redraws the physical screen with the contents that have been queued up via any of the printing commands.
  443. /// </summary>
  444. public abstract void UpdateScreen ();
  445. /// <summary>
  446. /// Selects the specified attribute as the attribute to use for future calls to AddRune, AddString.
  447. /// </summary>
  448. /// <param name="c">C.</param>
  449. public abstract void SetAttribute (Attribute c);
  450. /// <summary>
  451. /// Set Colors from limit sets of colors.
  452. /// </summary>
  453. /// <param name="foreground">Foreground.</param>
  454. /// <param name="background">Background.</param>
  455. public abstract void SetColors (ConsoleColor foreground, ConsoleColor background);
  456. // Advanced uses - set colors to any pre-set pairs, you would need to init_color
  457. // that independently with the R, G, B values.
  458. /// <summary>
  459. /// Advanced uses - set colors to any pre-set pairs, you would need to init_color
  460. /// that independently with the R, G, B values.
  461. /// </summary>
  462. /// <param name="foregroundColorId">Foreground color identifier.</param>
  463. /// <param name="backgroundColorId">Background color identifier.</param>
  464. public abstract void SetColors (short foregroundColorId, short backgroundColorId);
  465. /// <summary>
  466. /// Set the handler when the terminal is resized.
  467. /// </summary>
  468. /// <param name="terminalResized"></param>
  469. public void SetTerminalResized(Action terminalResized)
  470. {
  471. TerminalResized = terminalResized;
  472. }
  473. /// <summary>
  474. /// Draws a frame on the specified region with the specified padding around the frame.
  475. /// </summary>
  476. /// <param name="region">Region where the frame will be drawn..</param>
  477. /// <param name="padding">Padding to add on the sides.</param>
  478. /// <param name="fill">If set to <c>true</c> it will clear the contents with the current color, otherwise the contents will be left untouched.</param>
  479. public virtual void DrawFrame (Rect region, int padding, bool fill)
  480. {
  481. int width = region.Width;
  482. int height = region.Height;
  483. int b;
  484. int fwidth = width - padding * 2;
  485. int fheight = height - 1 - padding;
  486. Move (region.X, region.Y);
  487. if (padding > 0) {
  488. for (int l = 0; l < padding; l++)
  489. for (b = region.X; b < region.X + width; b++) {
  490. AddRune (' ');
  491. Move (b + 1, region.Y);
  492. }
  493. }
  494. Move (region.X, region.Y + padding);
  495. for (int c = 0; c < padding; c++) {
  496. AddRune (' ');
  497. Move (region.X + 1, region.Y + padding);
  498. }
  499. AddRune (ULCorner);
  500. for (b = region.X; b < region.X + fwidth - 2; b++) {
  501. AddRune (HLine);
  502. Move (b + (padding > 0 ? padding + 2 : 2), region.Y + padding);
  503. }
  504. AddRune (URCorner);
  505. for (int c = 0; c < padding; c++) {
  506. AddRune (' ');
  507. Move (region.X + 1, region.Y + padding);
  508. }
  509. for (b = 1 + padding; b < fheight; b++) {
  510. Move (region.X, region.Y + b);
  511. for (int c = 0; c < padding; c++) {
  512. AddRune (' ');
  513. Move (region.X + 1, region.Y + b);
  514. }
  515. AddRune (VLine);
  516. if (fill) {
  517. for (int x = region.X + 1; x < region.X + fwidth - 1; x++) {
  518. AddRune (' ');
  519. Move (x + (padding > 0 ? padding + 1 : 1), region.Y + b);
  520. }
  521. } else {
  522. if (padding > 0)
  523. Move (region.X + fwidth, region.Y + b);
  524. else
  525. Move (region.X + fwidth - 1, region.Y + b);
  526. }
  527. AddRune (VLine);
  528. for (int c = 0; c < padding; c++) {
  529. AddRune (' ');
  530. Move (region.X + 1, region.Y + b);
  531. }
  532. }
  533. Move (region.X, region.Y + fheight);
  534. for (int c = 0; c < padding; c++) {
  535. AddRune (' ');
  536. Move (region.X + 1, region.Y + b);
  537. }
  538. AddRune (LLCorner);
  539. for (b = region.X; b < region.X + fwidth - 2; b++) {
  540. AddRune (HLine);
  541. Move (b + (padding > 0 ? padding + 2 : 2), region.Y + fheight);
  542. }
  543. AddRune (LRCorner);
  544. for (int c = 0; c < padding; c++) {
  545. AddRune (' ');
  546. Move (region.X + 1, region.Y);
  547. }
  548. if (padding > 0) {
  549. Move (region.X, region.Y + height - padding);
  550. for (int l = 0; l < padding; l++) {
  551. for (b = region.X; b < region.X + width; b++) {
  552. AddRune (' ');
  553. Move (b + 1, region.Y + height - padding);
  554. }
  555. }
  556. }
  557. }
  558. /// <summary>
  559. /// Suspend the application, typically needs to save the state, suspend the app and upon return, reset the console driver.
  560. /// </summary>
  561. public abstract void Suspend ();
  562. Rect clip;
  563. /// <summary>
  564. /// Controls the current clipping region that AddRune/AddStr is subject to.
  565. /// </summary>
  566. /// <value>The clip.</value>
  567. public Rect Clip {
  568. get => clip;
  569. set => this.clip = value;
  570. }
  571. /// <summary>
  572. /// Start of mouse moves.
  573. /// </summary>
  574. public abstract void StartReportingMouseMoves ();
  575. /// <summary>
  576. /// Stop reporting mouses moves.
  577. /// </summary>
  578. public abstract void StopReportingMouseMoves ();
  579. /// <summary>
  580. /// Disables the cooked event processing from the mouse driver. At startup, it is assumed mouse events are cooked.
  581. /// </summary>
  582. public abstract void UncookMouse ();
  583. /// <summary>
  584. /// Enables the cooked event processing from the mouse driver
  585. /// </summary>
  586. public abstract void CookMouse ();
  587. /// <summary>
  588. /// Horizontal line character.
  589. /// </summary>
  590. public Rune HLine;
  591. /// <summary>
  592. /// Vertical line character.
  593. /// </summary>
  594. public Rune VLine;
  595. /// <summary>
  596. /// Stipple pattern
  597. /// </summary>
  598. public Rune Stipple;
  599. /// <summary>
  600. /// Diamond character
  601. /// </summary>
  602. public Rune Diamond;
  603. /// <summary>
  604. /// Upper left corner
  605. /// </summary>
  606. public Rune ULCorner;
  607. /// <summary>
  608. /// Lower left corner
  609. /// </summary>
  610. public Rune LLCorner;
  611. /// <summary>
  612. /// Upper right corner
  613. /// </summary>
  614. public Rune URCorner;
  615. /// <summary>
  616. /// Lower right corner
  617. /// </summary>
  618. public Rune LRCorner;
  619. /// <summary>
  620. /// Left tee
  621. /// </summary>
  622. public Rune LeftTee;
  623. /// <summary>
  624. /// Right tee
  625. /// </summary>
  626. public Rune RightTee;
  627. /// <summary>
  628. /// Top tee
  629. /// </summary>
  630. public Rune TopTee;
  631. /// <summary>
  632. /// The bottom tee.
  633. /// </summary>
  634. public Rune BottomTee;
  635. /// <summary>
  636. /// Make the attribute for the foreground and background colors.
  637. /// </summary>
  638. /// <param name="fore">Foreground.</param>
  639. /// <param name="back">Background.</param>
  640. /// <returns></returns>
  641. public abstract Attribute MakeAttribute (Color fore, Color back);
  642. }
  643. }