| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iConsoleOutput Struct Reference

This is the Crystal Space Console interface. More...

`#include <ivaria/conout.h>`

Inheritance diagram for iConsoleOutput:

[legend]
List of all members.

## Public Member Functions
virtual void | AutoUpdate (bool autoUpdate)=0
| Enable or disable automatic console updates.
virtual void | Clear (bool wipe=false)=0
| Clear console.
virtual void | Draw2D (csRect *oRect=0)=0
| Display the console and return the dirty rectangle.
virtual void | Draw3D (csRect *oRect=0)=0
| Update the 3D part of the console on the window.
virtual int | GetCursorStyle () const =0
| Retrieve the cursor style.
virtual iFont * | GetFont () const =0
| Gets the current font.
virtual const char * | GetLine (int line=-1) const =0
| Return a line from the buffer.
virtual int | GetMaxLineWidth ()=0
| Query maximal line width in characters.
virtual int | GetTopLine () const =0
| Get the current top line being displayed.
virtual bool | GetTransparency () const =0
| Retrieve the transparency setting.
virtual bool | GetVisible ()=0
| Query whether the console is visible or hidden.
virtual bool | PerformExtension (const char *command,...)=0
| Implement simple extension commands.
virtual bool | PerformExtensionV (const char *command, va_list)=0
| Implement simple extension commands.
virtual void | PutText (const char *text,...)=0
| Put some text to the console.
virtual void | PutTextV (const char *text, va_list args)=0
| Var_args version of PutText.
virtual void | RegisterWatcher (iConsoleWatcher *)=0
| Tell console that this object should be notified when console visibility status changes.
virtual void | ScrollTo (int topLine, bool snap=true)=0
| Set the current top line, or use of the constants above for scrolling.
virtual void | SetBufferSize (int maxLines)=0
| Set the buffer size in lines.
virtual void | SetCursorPos (int charNo)=0
| Set cursor horizontal position (-1 == follow output).
virtual void | SetCursorStyle (int style)=0
| Assign the cursor style.
virtual void | SetFont (iFont *font)=0
| Sets the font.
virtual void | SetTransparency (bool transp)=0
| Set transparency.
virtual void | SetVisible (bool show)=0
| Show/hide the console.

## Detailed Description

This is the Crystal Space Console interface.

It is an output only system. It can be used in conjunction with the iConsoleInput interface to form an interactive console.

Main creators of instances implementing this interface:

- Standard output console plugin (crystalspace.console.output.standard)
- Fancy output console plugin (crystalspace.console.output.fancy)

Main ways to get pointers to this interface:

- csQueryRegistry()

Main users of this interface:

- iConsoleInput
- iStandardReporterListener

Definition at line 79 of file conout.h.

## Member Function Documentation

virtual void iConsoleOutput::AutoUpdate | ( | bool | autoUpdate | ) | `[pure virtual]`

Enable or disable automatic console updates.

When the console is in console auto-update mode, it automatically calls BeginDraw/Console->Draw methods on every PutText call. Otherwise it is your responsability to call Draw() at appropiate times. Initially this mode is enabled.

Note that some implementations of the output consoles may be thread-safe. But in that case you MUST use AutoUpdate(false) because access to graphics is not thread-safe.

virtual void iConsoleOutput::Clear | ( | bool | wipe = `false` | ) | `[pure virtual]`

Clear console.

Parameters:

  | wipe | If true then the buffer is completely cleared. Else (default) the top line is moved to the current line.

virtual void iConsoleOutput::Draw2D | ( | csRect * | oRect = `0` | ) | `[pure virtual]`

Display the console and return the dirty rectangle.

The graphics driver should be in 2D draw mode. Only call this function from the same thread that maintains the graphics subsystem!

Parameters:

  | oRect | will be set to the dirty rectangle so you can choose to update only that part of the screen. You can also supply 0 (default) if you are not interested in that.

virtual void iConsoleOutput::Draw3D | ( | csRect * | oRect = `0` | ) | `[pure virtual]`

Update the 3D part of the console on the window.

The graphics driver should be in 3D draw mode. Only call this function from the same thread that maintains the graphics subsystem!

Parameters:

  | oRect | will be set to the dirty rectangle so you can choose to update only that part of the screen. You can also supply 0 (default) if you are not interested in that.

virtual int iConsoleOutput::GetCursorStyle | ( |  | ) | const`[pure virtual]`

Retrieve the cursor style.

virtual iFont* iConsoleOutput::GetFont | ( |  | ) | const`[pure virtual]`

Gets the current font.

virtual const char* iConsoleOutput::GetLine | ( | int | line = `-1` | ) | const`[pure virtual]`

Return a line from the buffer.

Parameters:

  | line | is the line to get or -1 (default) for the current line.

virtual int iConsoleOutput::GetMaxLineWidth | ( |  | ) | `[pure virtual]`

Query maximal line width in characters.

virtual int iConsoleOutput::GetTopLine | ( |  | ) | const`[pure virtual]`

Get the current top line being displayed.

virtual bool iConsoleOutput::GetTransparency | ( |  | ) | const`[pure virtual]`

Retrieve the transparency setting.

virtual bool iConsoleOutput::GetVisible | ( |  | ) | `[pure virtual]`

Query whether the console is visible or hidden.

virtual bool iConsoleOutput::PerformExtension | ( | const char * | command,
|  |  | ... |
| ) |  |  | `[pure virtual]`

Implement simple extension commands.

virtual bool iConsoleOutput::PerformExtensionV | ( | const char * | command,
|  | va_list |  |
| ) |  |  | `[pure virtual]`

Implement simple extension commands.

virtual void iConsoleOutput::PutText | ( | const char * | text,
|  |  | ... |
| ) |  |  | `[pure virtual]`

Put some text to the console.

Console acts like a simple TTY and should interpret basical symbols like '\n' and '\b'. The '\r' character has a special meaning: it sets a flag that tells console to clear the current line before next character is output. That is, you can emmit non-persistent messages this way: PutText ("some text@\r"); This message will disappear as soon as any other message will be sent to console.

Remember that if you are not using the printf-style functionality, and the string may include '' signs, you should do PutText("%s", str) instead of PutText(str).

See also:
  Notes about string formatting in Crystal Space

virtual void iConsoleOutput::PutTextV | ( | const char * | text,
|  | va_list | args |
| ) |  |  | `[pure virtual]`

Var_args version of PutText.

virtual void iConsoleOutput::RegisterWatcher | ( | iConsoleWatcher * |  | ) | `[pure virtual]`

Tell console that this object should be notified when console visibility status changes.

virtual void iConsoleOutput::ScrollTo | ( | int | topLine,
|  | bool | snap = `true` |
| ) |  |  | `[pure virtual]`

Set the current top line, or use of the constants above for scrolling.

Parameters:

  | topLine | is the new top line.
  | snap | If true the console returns to the very bottom of the display when a new line is printed.

virtual void iConsoleOutput::SetBufferSize | ( | int | maxLines | ) | `[pure virtual]`

Set the buffer size in lines.

virtual void iConsoleOutput::SetCursorPos | ( | int | charNo | ) | `[pure virtual]`

Set cursor horizontal position (-1 == follow output).

virtual void iConsoleOutput::SetCursorStyle | ( | int | style | ) | `[pure virtual]`

Assign the cursor style.

virtual void iConsoleOutput::SetFont | ( | iFont * | font | ) | `[pure virtual]`

Sets the font.

virtual void iConsoleOutput::SetTransparency | ( | bool | transp | ) | `[pure virtual]`

Set transparency.

virtual void iConsoleOutput::SetVisible | ( | bool | show | ) | `[pure virtual]`

Show/hide the console.

In 'hidden' state console should not display anything at all (when Draw() is called) or draw some minimal information

The documentation for this struct was generated from the following file:

- ivaria/conout.h