From e7bb35dc9f07d6027b98fe31629d1ceec5893480 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 3 Apr 2013 20:52:01 -0500 Subject: documentation --- hexes.html | 147 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 hexes.html (limited to 'hexes.html') diff --git a/hexes.html b/hexes.html new file mode 100644 index 0000000..bd9be72 --- /dev/null +++ b/hexes.html @@ -0,0 +1,147 @@ + + + + + + + Module hexes + + + + + +
+ + +
+ +
+

Enum Keypress

+

Keys that can be returned by Term::read.

+
+

Variants

+
    +
  • KeyCharacter(char)
  • +
  • KeyBackspace
  • +
  • KeyReturn
  • +
  • KeyTab
  • +
  • KeyCtrl(char)
  • +
  • KeyF(int)
  • +
  • KeyUp
  • +
  • KeyDown
  • +
  • KeyLeft
  • +
  • KeyRight
  • +
  • KeyHome
  • +
  • KeyEnd
  • +
  • KeyInsert
  • +
  • KeyDelete
  • +
  • KeyEscape
  • +
+
+
+
+

Implementation for Term

+
+

Method clear

+
fn clear(&mut self)
+

Clears the screen.

+
+
+

Method move

+
fn move(&mut self, col: uint, row: uint)
+

Moves the cursor to (col, row).

+
+
+

Method fg_color

+
fn fg_color(&mut self, color: info::Color)
+

Changes the currently active foreground color to color.

+
+
+

Method bg_color

+
fn bg_color(&mut self, color: info::Color)
+

Changes the currently active background color to color.

+
+
+

Method reset_color

+
fn reset_color(&mut self)
+

Resets the foreground and background colors to the default.

+
+
+

Method underline

+
fn underline(&mut self, enabled: bool)
+

Enables or disables underline mode.

+
+
+

Method standout

+
fn standout(&mut self, enabled: bool)
+

Enables or disables standout mode.

+
+
+

Method reverse

+
fn reverse(&mut self, enabled: bool)
+

Enables or disables reverse mode.

+
+
+

Method bold

+
fn bold(&mut self, enabled: bool)
+

Enables or disables bold mode.

+
+ +
+

Method cursor

+
fn cursor(&mut self, enabled: bool)
+

Enables or disables visible cursor mode.

+
+
+

Method alternate_screen

+
fn alternate_screen(&mut self, enabled: bool)
+

Switches to or from the alternate screen.

+

This is used to provide a separate place to do all of the drawing for a full screen app, so that at the end of the application, the terminal will be restored to the original state.

+
+
+

Method write

+
fn write(&mut self, text: &str)
+

Write a string to the terminal.

+

Due to buffering, using io::print() will not work properly. All text written to the terminal must go through the Term object, or the state of the screen will likely end up incorrect.

+
+
+

Method flush

+
fn flush(&mut self)
+

Flush the data written so far to the terminal.

+

This is also done implicitly before every call to read, so there's not usually a reason to do it manually, other than edge cases such as timed animations.

+
+
+

Method read

+
fn read(&mut self) -> Option<Keypress>
+

Read a keypress from the terminal.

+

Returns Some(Keypress) if a key was read, and None if stdin reaches eof.

+

Note that most special keys are actually sequences of multiple characters. This means that if a prefix of a special character key sequence was read, it has to wait to see if there are more characters coming, or if that character was the only key. Since most of these multi-character sequences start with escape, there will be a delay in reading a single KeyEscape keypress.

+

Also, other special keys are represented as control keys, so for instance, ^J will likely return KeyReturn instead of KeyCtrl('j').

+
+
+
+

Implementation of Drop for Term

+
+

Method finalize

+
fn finalize(&self)
+
+
+
+

Function Term

+
fn Term() -> Term
+

Creates a new Term instance.

+

This can be used to manipulate the terminal for full screen applications.

+
+ + -- cgit v1.2.3-54-g00ecf