The Pedigree Project 0.1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
LocalIO Class Reference

#include <LocalIO.h>

+ Inheritance diagram for LocalIO:
+ Collaboration diagram for LocalIO:

Public Member Functions

 LocalIO (Vga *pVga, Keyboard *pKeyboard)
 
void initialise ()
 
void destroy ()
 
void setCliUpperLimit (size_t nlines)
 
void setCliLowerLimit (size_t nlines)
 
void enableCli ()
 
void disableCli ()
 
void cls ()
 
virtual char getCharNonBlock ()
 
void drawHorizontalLine (char c, size_t row, size_t colStart, size_t colEnd, DebuggerIO::Colour foreColour, DebuggerIO::Colour backColour)
 
void drawVerticalLine (char c, size_t col, size_t rowStart, size_t rowEnd, DebuggerIO::Colour foreColour, DebuggerIO::Colour backColour)
 
void drawString (const char *str, size_t row, size_t col, DebuggerIO::Colour foreColour, DebuggerIO::Colour backColour)
 
size_t getWidth ()
 
size_t getHeight ()
 
void enableRefreshes ()
 
void disableRefreshes ()
 
void forceRefresh ()
 
char getChar ()
 
void readDimensions ()
 
- Public Member Functions inherited from DebuggerIO
 DebuggerIO ()
 
virtual void writeCli (const char *str, Colour foreColour, Colour backColour)
 
virtual void writeCli (char ch, DebuggerIO::Colour foreColour, DebuggerIO::Colour backColour)
 
virtual bool readCli (HugeStaticString &str, DebuggerCommand *pAutoComplete)
 

Protected Member Functions

void scroll ()
 
void moveCursor ()
 
void putChar (char c, DebuggerIO::Colour foreColour, DebuggerIO::Colour backColour)
 
void setMode (int nMode)
 
int getMode ()
 

Protected Attributes

uint16_t m_pFramebuffer [MAX_CONSOLE_WIDTH *MAX_CONSOLE_HEIGHT]
 
uint16_t m_pOldFramebuffer [MAX_CONSOLE_WIDTH *MAX_CONSOLE_HEIGHT]
 
size_t m_nWidth
 
size_t m_nHeight
 
size_t m_UpperCliLimit
 
size_t m_LowerCliLimit
 
size_t m_CursorX
 
size_t m_CursorY
 
Vga * m_pVga
 
Keyboard * m_pKeyboard
 
- Protected Attributes inherited from DebuggerIO
bool m_bReady
 
char m_pCommand [COMMAND_MAX]
 
bool m_bRefreshesEnabled
 

Private Member Functions

 LocalIO (const LocalIO &)
 
LocalIO & operator= (const LocalIO &)
 

Additional Inherited Members

- Public Types inherited from DebuggerIO
enum  Colour {
  Black = 0 , Blue = 1 , Green = 2 , Cyan = 3 ,
  Red = 4 , Magenta = 5 , Orange = 6 , LightGrey = 7 ,
  DarkGrey = 8 , LightBlue = 9 , LightGreen = 10 , LightCyan = 11 ,
  LightRed = 12 , LightMagenta = 13 , Yellow = 14 , White = 15
}
 

Detailed Description

Provides an implementation of DebuggerIO, using the monitor and keyboard.

Definition at line 40 of file LocalIO.h.

Constructor & Destructor Documentation

◆ LocalIO()

LocalIO::LocalIO ( Vga *  pVga,
Keyboard *  pKeyboard 
)

Default constructor and destructor.

Definition at line 24 of file LocalIO.cc.

◆ ~LocalIO()

LocalIO::~LocalIO ( )

Definition at line 36 of file LocalIO.cc.

Member Function Documentation

◆ cls()

void LocalIO::cls ( )
virtual

Implements DebuggerIO.

Definition at line 299 of file LocalIO.cc.

◆ destroy()

void LocalIO::destroy ( )
virtual

Implements DebuggerIO.

Definition at line 64 of file LocalIO.cc.

◆ disableCli()

void LocalIO::disableCli ( )
virtual

Implements DebuggerIO.

Definition at line 107 of file LocalIO.cc.

◆ disableRefreshes()

void LocalIO::disableRefreshes ( )
virtual

Implements DebuggerIO.

Definition at line 223 of file LocalIO.cc.

◆ drawHorizontalLine()

void LocalIO::drawHorizontalLine ( char  c,
size_t  row,
size_t  colStart,
size_t  colEnd,
DebuggerIO::Colour  foreColour,
DebuggerIO::Colour  backColour 
)
virtual

Draw a line of characters in the given fore and back colours, in the horizontal or vertical direction. Note that if the CLI is enabled, anything drawn across the CLI area can be wiped without warning.

Implements DebuggerIO.

Definition at line 130 of file LocalIO.cc.

References DebuggerIO::m_bRefreshesEnabled, and m_pFramebuffer.

◆ drawString()

void LocalIO::drawString ( const char *  str,
size_t  row,
size_t  col,
DebuggerIO::Colour  foreColour,
DebuggerIO::Colour  backColour 
)
virtual

Draws a string of text at the given location in the given colour. note that wrapping is not performed, the string will be clipped.

Implements DebuggerIO.

Definition at line 184 of file LocalIO.cc.

References DebuggerIO::m_bRefreshesEnabled, m_CursorX, and moveCursor().

◆ drawVerticalLine()

void LocalIO::drawVerticalLine ( char  c,
size_t  col,
size_t  rowStart,
size_t  rowEnd,
DebuggerIO::Colour  foreColour,
DebuggerIO::Colour  backColour 
)
virtual

Implements DebuggerIO.

Definition at line 157 of file LocalIO.cc.

◆ enableCli()

void LocalIO::enableCli ( )
virtual

Enables or disables the command line interface, allowing full access to the display. disableCli blanks the screen, enableCli blanks it and puts a prompt up.

Implements DebuggerIO.

Definition at line 90 of file LocalIO.cc.

References m_CursorX, DebuggerIO::m_pCommand, m_pFramebuffer, and m_UpperCliLimit.

◆ enableRefreshes()

void LocalIO::enableRefreshes ( )
virtual

Allows disabling of refreshes, for example when deleting something then writing it back.

Implements DebuggerIO.

Definition at line 218 of file LocalIO.cc.

References DebuggerIO::m_bRefreshesEnabled.

◆ forceRefresh()

void LocalIO::forceRefresh ( )
virtual

Implements DebuggerIO.

Definition at line 227 of file LocalIO.cc.

◆ getChar()

char LocalIO::getChar ( )
virtual

Gets a character from the keyboard. Blocking. Returns 0 for a nonprintable character.

Implements DebuggerIO.

Definition at line 126 of file LocalIO.cc.

References Keyboard::getChar(), and m_pKeyboard.

◆ getCharNonBlock()

char LocalIO::getCharNonBlock ( )
virtual

Implements DebuggerIO.

Definition at line 122 of file LocalIO.cc.

◆ getHeight()

size_t LocalIO::getHeight ( )
inlinevirtual

Implements DebuggerIO.

Definition at line 94 of file LocalIO.h.

◆ getWidth()

size_t LocalIO::getWidth ( )
inlinevirtual

Returns the width and height respectively of the console.

Implements DebuggerIO.

Definition at line 91 of file LocalIO.h.

◆ initialise()

void LocalIO::initialise ( )
virtual

Implements DebuggerIO.

Definition at line 38 of file LocalIO.cc.

◆ moveCursor()

void LocalIO::moveCursor ( )
protectedvirtual

Updates the hardware cursor position.

Implements DebuggerIO.

Definition at line 249 of file LocalIO.cc.

References m_CursorX, m_pVga, and Vga::moveCursor().

Referenced by drawString().

+ Here is the caller graph for this function:

◆ putChar()

void LocalIO::putChar ( char  c,
DebuggerIO::Colour  foreColour,
DebuggerIO::Colour  backColour 
)
protectedvirtual

Implements DebuggerIO.

Definition at line 253 of file LocalIO.cc.

◆ readDimensions()

void LocalIO::readDimensions ( )
inlinevirtual

Implements DebuggerIO.

Definition at line 112 of file LocalIO.h.

◆ scroll()

void LocalIO::scroll ( )
protectedvirtual

Scrolls the CLI screen down a line, if needed.

Implements DebuggerIO.

Definition at line 232 of file LocalIO.cc.

References m_LowerCliLimit, m_pFramebuffer, and m_UpperCliLimit.

◆ setCliLowerLimit()

void LocalIO::setCliLowerLimit ( size_t  nlines)
virtual

Implements DebuggerIO.

Definition at line 80 of file LocalIO.cc.

◆ setCliUpperLimit()

void LocalIO::setCliUpperLimit ( size_t  nlines)
virtual

Forces the command line interface not to use the specified number of lines from either the top or bottom of the screen, respectively. Can be used to create status lines that aren't destroyed by screen scrolling.

Implements DebuggerIO.

Definition at line 70 of file LocalIO.cc.

References m_UpperCliLimit.

Member Data Documentation

◆ m_CursorX

size_t LocalIO::m_CursorX
protected

How many lines from the bottom of the screen the bottom of our CLI area is. Current cursor position.

Definition at line 154 of file LocalIO.h.

Referenced by drawString(), enableCli(), and moveCursor().

◆ m_CursorY

size_t LocalIO::m_CursorY
protected

Definition at line 154 of file LocalIO.h.

◆ m_LowerCliLimit

size_t LocalIO::m_LowerCliLimit
protected

How many lines from the top of the screen the top of our CLI area is.

Definition at line 148 of file LocalIO.h.

Referenced by scroll().

◆ m_nHeight

size_t LocalIO::m_nHeight
protected

Definition at line 141 of file LocalIO.h.

◆ m_nWidth

size_t LocalIO::m_nWidth
protected

Definition at line 140 of file LocalIO.h.

◆ m_pFramebuffer

uint16_t LocalIO::m_pFramebuffer[MAX_CONSOLE_WIDTH *MAX_CONSOLE_HEIGHT]
protected

Framebuffer.

Definition at line 133 of file LocalIO.h.

Referenced by drawHorizontalLine(), enableCli(), and scroll().

◆ m_pKeyboard

Keyboard* LocalIO::m_pKeyboard
protected

Keyboard driver.

Definition at line 164 of file LocalIO.h.

Referenced by getChar().

◆ m_pOldFramebuffer

uint16_t LocalIO::m_pOldFramebuffer[MAX_CONSOLE_WIDTH *MAX_CONSOLE_HEIGHT]
protected

Framebuffer for the screen before we took control.

Definition at line 138 of file LocalIO.h.

◆ m_pVga

Vga* LocalIO::m_pVga
protected

Vga driver.

Definition at line 159 of file LocalIO.h.

Referenced by moveCursor().

◆ m_UpperCliLimit

size_t LocalIO::m_UpperCliLimit
protected

Current upper and lower CLI limits.

Definition at line 146 of file LocalIO.h.

Referenced by enableCli(), scroll(), and setCliUpperLimit().


The documentation for this class was generated from the following files: