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 ++++++++++++++++++++++++++++++ index.html | 26 ++++++ info.html | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ios.html | 57 ++++++++++++ 4 files changed, 530 insertions(+) create mode 100644 hexes.html create mode 100644 index.html create mode 100644 info.html create mode 100644 ios.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.

+
+ + diff --git a/index.html b/index.html new file mode 100644 index 0000000..a728b44 --- /dev/null +++ b/index.html @@ -0,0 +1,26 @@ + + + + + + + Crate term + + + + + +
+ + +
+ + + + diff --git a/info.html b/info.html new file mode 100644 index 0000000..64d9f2b --- /dev/null +++ b/info.html @@ -0,0 +1,300 @@ + + + + + + + Module info + + + + + +
+ + +
+ +
+

Enum Color

+

The default colors available on a terminal emulator.

+
+

Variants

+
    +
  • ColorBlack = 0
  • +
  • ColorRed
  • +
  • ColorGreen
  • +
  • ColorYellow
  • +
  • ColorBlue
  • +
  • ColorMagenta
  • +
  • ColorCyan
  • +
  • ColorWhite
  • +
+
+
+
+

Implementation of ::core::cmp::Eq for Color

+
+

Method eq

+
fn eq(&self, __other: &Color) -> bool
+
+
+

Method ne

+
fn ne(&self, __other: &Color) -> bool
+
+
+
+

Function carriage_return

+
fn carriage_return() -> ~str
+
+
+

Function clear_screen

+
fn clear_screen() -> ~str
+
+
+

Function cursor_address

+
fn cursor_address(p1: uint, p2: uint) -> ~str
+
+
+

Function cursor_home

+
fn cursor_home() -> ~str
+
+
+

Function cursor_invisible

+
fn cursor_invisible() -> ~str
+
+
+

Function cursor_normal

+
fn cursor_normal() -> ~str
+
+ +
+

Function enter_bold_mode

+
fn enter_bold_mode() -> ~str
+
+
+

Function enter_ca_mode

+
fn enter_ca_mode() -> ~str
+
+
+

Function enter_reverse_mode

+
fn enter_reverse_mode() -> ~str
+
+
+

Function enter_standout_mode

+
fn enter_standout_mode() -> ~str
+
+
+

Function enter_underline_mode

+
fn enter_underline_mode() -> ~str
+
+
+

Function escape

+
fn escape(name: &str) -> ~str
+

The terminal escape corresponding to the name terminfo capability.

+
+
+

Function escape1

+
fn escape1(name: &str, p1: int) -> ~str
+

The terminal escape corresponding to the name terminfo capability.

+

This capability must take one parameter, which should be passed as p1.

+
+
+

Function escape2

+
fn escape2(name: &str, p1: int, p2: int) -> ~str
+

The terminal escape corresponding to the name terminfo capability.

+

This capability must take two parameters, which should be passed as p1 and p2.

+
+
+

Function exit_attribute_mode

+
fn exit_attribute_mode() -> ~str
+
+
+

Function exit_ca_mode

+
fn exit_ca_mode() -> ~str
+
+
+

Function exit_standout_mode

+
fn exit_standout_mode() -> ~str
+
+
+

Function exit_underline_mode

+
fn exit_underline_mode() -> ~str
+
+
+

Function init

+
fn init()
+

Initialize the terminfo database.

+

This must be called before any functions from this module are used. The current terminal is determined by looking at the TERM environment variable.

+
+
+

Function key_backspace

+
fn key_backspace() -> ~str
+
+
+

Function key_dc

+
fn key_dc() -> ~str
+
+
+

Function key_down

+
fn key_down() -> ~str
+
+
+

Function key_end

+
fn key_end() -> ~str
+
+
+

Function key_f

+
fn key_f(n: uint) -> ~str
+

The terminal escape generated by the F<n> key.

+
+
+

Function key_f1

+
fn key_f1() -> ~str
+
+
+

Function key_f10

+
fn key_f10() -> ~str
+
+
+

Function key_f11

+
fn key_f11() -> ~str
+
+
+

Function key_f12

+
fn key_f12() -> ~str
+
+
+

Function key_f2

+
fn key_f2() -> ~str
+
+
+

Function key_f3

+
fn key_f3() -> ~str
+
+
+

Function key_f4

+
fn key_f4() -> ~str
+
+
+

Function key_f5

+
fn key_f5() -> ~str
+
+
+

Function key_f6

+
fn key_f6() -> ~str
+
+
+

Function key_f7

+
fn key_f7() -> ~str
+
+
+

Function key_f8

+
fn key_f8() -> ~str
+
+
+

Function key_f9

+
fn key_f9() -> ~str
+
+
+

Function key_home

+
fn key_home() -> ~str
+
+
+

Function key_ic

+
fn key_ic() -> ~str
+
+
+

Function key_left

+
fn key_left() -> ~str
+
+
+

Function key_right

+
fn key_right() -> ~str
+
+
+

Function key_up

+
fn key_up() -> ~str
+
+
+

Function keypad_local

+
fn keypad_local() -> ~str
+
+
+

Function keypad_xmit

+
fn keypad_xmit() -> ~str
+
+
+

Function orig_pair

+
fn orig_pair() -> ~str
+
+
+

Function set_a_background

+
fn set_a_background(p1: Color) -> ~str
+
+
+

Function set_a_foreground

+
fn set_a_foreground(p1: Color) -> ~str
+
+
+

Function tab

+
fn tab() -> ~str
+
+ + diff --git a/ios.html b/ios.html new file mode 100644 index 0000000..660e89f --- /dev/null +++ b/ios.html @@ -0,0 +1,57 @@ + + + + + + + Module ios + + + + + +
+ + +
+ +
+

Function cbreak

+
fn cbreak() -> int
+

Put the terminal into cbreak mode.

+

This is the normal unbuffered mode.

+
+
+

Function cooked

+
fn cooked() -> int
+

Put the terminal into cooked mode.

+

This is the normal line-buffered mode.

+
+
+

Function echo

+
fn echo(enable: bool) -> int
+

Change the echo mode of the terminal.

+

true turns echo on, and false turns echo off.

+
+
+

Function preserve

+
fn preserve<T>(body: &fn() -> T) -> T
+

Run a block of code, restoring the terminal state when the block ends.

+

This will ensure you don't leave the terminal in a broken state, even if the current task fails.

+
+
+

Function raw

+
fn raw() -> int
+

Put the terminal into raw mode.

+

This is like cbreak mode, except that control characters (like ^C) are not translated into signals.

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