- Added support for setting the terminal foreground color.

- Some improvements to error handling.
This commit is contained in:
Adam Murdoch
2012-08-04 10:00:32 +10:00
parent 31e9d2b41c
commit 335065887e
10 changed files with 145 additions and 49 deletions

View File

@@ -1,20 +1,32 @@
package net.rubygrapefruit.platform;
public interface Terminal {
enum Color {
Black, Red, Green, Yellow, Blue, Magenta, Cyan, White
}
/**
* Returns the size of the terminal.
*/
TerminalSize getTerminalSize();
/**
* Sets the terminal foreground color.
*/
Terminal foreground(Color color);
/**
* Switches the terminal to bold mode.
*/
Terminal bold();
/**
* Switches the terminal to bold mode, outputs the given text, then switches to normal mode.
*/
Terminal bold(String output);
/**
* Switches the terminal to normal mode.
*/
Terminal normal();
/**
* Switches the terminal to normal mode and restores default colors.
*/
Terminal reset();
}