Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Console Class Reference

User interface Console. More...

#include <Console.h>

Inherits Widget.

Inheritance diagram for Console:

Inheritance graph
[legend]
Collaboration diagram for Console:

Collaboration graph
[legend]
List of all members.

Public Methods

Console & operator<< (const string &line)
 Print a string to the console. More...

void resize (unsigned short w, unsigned short h)
 Resizes the region. More...

void refresh ()
 Repaints the region. More...


Static Public Methods

Console * getConsole ()
 Returns the singleton Console instance. More...


Protected Attributes

int currentLine
 Current line that will be printed to (cyclic).

int lineDistance
 Distance between two printed lines in pixels.

int visibleBuffers
 The number of visible line buffers.

string text [lineBuffers]
 Actual line buffers.


Static Protected Attributes

Console * instance = NULL
 Signleton instance.

const int lineBuffers = 80
 Maximum buffered lines.

const int lineSeperate = 4
 Space between lines in pixels.


Detailed Description

User interface Console.

Todo:
Multiple instances of Console that all display the same history.

A console displays all values and strings that are printed to cout. In addition all strings are logged to file '/var/expression.log'.


Member Function Documentation

Console * Console::getConsole   [static]
 

Returns the singleton Console instance.

Precondition:
none.
Postcondition:
  • Construct a singleton instance.
  • Replaced cout.
Returns:
Signleton Console instance pointer.

Console & Console::operator<< const string &    line
 

Print a string to the console.

Prints an logs a single line.

Precondition:
none.
Postcondition:
The line is appended to 'text'.
Parameters:
line  The line to print.
Returns:
reference to this.

void Console::refresh   [virtual]
 

Repaints the region.

This method is called whenever the screen is repainted. The repaint method uses OpenGL calls to render the region. Currently it is assumed that regions are refreshed automatically so that no refresh notification has to be done when the region changes state i.e. no refresh has to be forced by the region. Region rendering is done back to front.

Precondition:
An OpenGL context has been created and activated to render in.
Postcondition:
The region is redrawn.

Reimplemented from Region.

void Console::resize unsigned short    w,
unsigned short    h
[virtual]
 

Resizes the region.

Virtual method to change the size of the Region.

Parameters:
w  New width.
h  New height.
Postcondition:
The region has been resized to (w, h).

Reimplemented from Region.


The documentation for this class was generated from the following files:
This documentation was generated using doxygen. If you have any comments or additions please mail me.