The Pedigree Project
0.1
|
#include <TextIO.h>
Classes | |
struct | VgaCell |
Public Types | |
enum | InputMode { Standard, Raw } |
Public Member Functions | |
TextIO (String str, size_t inode, Filesystem *pParentFS, File *pParent) | |
bool | initialise (bool bClear=true) |
void | writeStr (const char *s, size_t len) |
virtual uint64_t | readBytewise (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) |
virtual uint64_t | writeBytewise (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) |
virtual int | select (bool bWriting=false, int timeout=0) |
virtual void | flipThread () |
void | handleInput (InputManager::InputNotification &in) |
void | markPrimary () |
void | unmarkPrimary () |
bool | isPrimary () const |
void | setMode (InputMode mode) |
InputMode | getMode () const |
Public Member Functions inherited from File | |
File () | |
File (const String &name, Time::Timestamp accessedTime, Time::Timestamp modifiedTime, Time::Timestamp creationTime, uintptr_t inode, class Filesystem *pFs, size_t size, File *pParent) | |
virtual | ~File () |
virtual uint64_t | read (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) final |
virtual uint64_t | write (uint64_t location, uint64_t size, uintptr_t buffer, bool bCanBlock=true) final |
virtual physical_uintptr_t | getPhysicalPage (size_t offset) |
virtual void | returnPhysicalPage (size_t offset) |
virtual void | sync () |
virtual void | sync (size_t offset, bool async) |
Time::Timestamp | getCreationTime () |
void | setCreationTime (Time::Timestamp t) |
Time::Timestamp | getAccessedTime () |
void | setAccessedTime (Time::Timestamp t) |
Time::Timestamp | getModifiedTime () |
void | setModifiedTime (Time::Timestamp t) |
String | getName () const |
void | getName (String &s) const |
virtual String | getFullPath (bool bWithLabel=true) |
virtual void | truncate () |
size_t | getSize () |
void | setSize (size_t sz) |
virtual bool | isSymlink () |
virtual bool | isDirectory () |
virtual bool | isPipe () const |
virtual bool | isFifo () const |
virtual bool | isSocket () const |
uintptr_t | getInode () const |
virtual void | setInode (uintptr_t inode) |
Filesystem * | getFilesystem () const |
void | setFilesystem (Filesystem *pFs) |
virtual void | fileAttributeChanged () |
virtual void | increaseRefCount (bool bIsWriter) |
virtual void | decreaseRefCount (bool bIsWriter) |
void | setPermissions (uint32_t perms) |
uint32_t | getPermissions () const |
void | setUid (size_t uid) |
size_t | getUid () const |
void | setGid (size_t gid) |
size_t | getGid () const |
File * | getParent () const |
void | monitor (Thread *pThread, Event *pEvent) |
void | cullMonitorTargets (Thread *pThread) |
virtual bool | supports (const size_t command) const |
virtual int | command (const size_t command, void *buffer) |
virtual size_t | getBlockSize () const |
void | enableDirect () |
void | disableDirect () |
virtual void | preallocate (size_t expectedSize, bool zero=true) |
virtual File * | open () |
Static Public Member Functions | |
static void | inputCallback (InputManager::InputNotification &in) |
Private Types | |
enum | VgaColour { 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 } |
enum | TerminalModes { LineFeedNewLine = 0x1, CursorKey = 0x2, AnsiVt52 = 0x4, Column = 0x8, Scrolling = 0x10, Screen = 0x20, Origin = 0x40, AutoWrap = 0x80, AutoRepeat = 0x100, Interlace = 0x200, Inverse = 0x100000, Bright = 0x200000, Blink = 0x400000, CharacterSetG0 = 0x1000000, CharacterSetG1 = 0x2000000 } |
Private Member Functions | |
VgaColour | adjustColour (int colour, bool up) |
virtual bool | isBytewise () const |
void | setColour (VgaColour *which, size_t param, bool bBright=false) |
void | doBackspace () |
void | doLinefeed () |
void | doCarriageReturn () |
void | doHorizontalTab () |
void | checkScroll () |
void | checkWrap () |
void | eraseSOS () |
void | eraseEOS () |
void | eraseEOL () |
void | eraseSOL () |
void | eraseLine () |
void | eraseScreen (uint8_t character) |
void | goHome (ssize_t xmove=0, ssize_t ymove=0) |
void | clearBackbuffer () |
void | flip (bool timer=false, bool hideState=false) |
uint8_t | translate (uint32_t codepoint) |
Private Attributes | |
bool | m_bInitialised |
bool | m_bControlSeq |
bool | m_bBracket |
bool | m_bParenthesis |
bool | m_bParams |
bool | m_bQuestionMark |
ssize_t | m_CursorX |
ssize_t | m_CursorY |
ssize_t | m_SavedCursorX |
ssize_t | m_SavedCursorY |
ssize_t | m_ScrollStart |
ssize_t | m_ScrollEnd |
ssize_t | m_LeftMargin |
ssize_t | m_RightMargin |
size_t | m_CurrentParam |
size_t | m_Params [MAX_TEXTIO_PARAMS] |
int | m_CurrentModes |
VgaColour | m_Fore |
VgaColour | m_Back |
MemoryRegion | m_Backbuffer |
uint16_t * | m_pFramebuffer |
VgaCell * | m_pBackbuffer |
Vga * | m_pVga |
char | m_TabStops [BACKBUFFER_STRIDE] |
Buffer< char > | m_OutBuffer |
uint8_t | m_G0 |
uint8_t | m_G1 |
uint64_t | m_NextInterval |
bool | m_bUtf8 |
uint32_t | m_nCharacter |
size_t | m_nUtf8Handled |
bool | m_bActive |
Mutex | m_Lock |
Thread * | m_pFlipThread |
bool | m_bOwnsConsole |
InputMode | m_InputMode |
Additional Inherited Members | |
Protected Member Functions inherited from File | |
virtual uintptr_t | readBlock (uint64_t location) |
virtual void | writeBlock (uint64_t location, uintptr_t addr) |
virtual void | extend (size_t newSize) |
virtual void | extend (size_t newSize, uint64_t location, uint64_t size) |
void | dataChanged () |
void | getFilesystemLabel (HugeStaticString &s) |
virtual void | pinBlock (uint64_t location) |
virtual void | unpinBlock (uint64_t location) |
void | evict (uint64_t location) |
void | setPermissionsOnly (uint32_t perms) |
void | setUidOnly (size_t uid) |
void | setGidOnly (size_t gid) |
Static Protected Member Functions inherited from File | |
static void | writeCallback (CacheConstants::CallbackCause cause, uintptr_t loc, uintptr_t page, void *meta) |
Protected Attributes inherited from File | |
String | m_Name |
Time::Timestamp | m_AccessedTime |
Time::Timestamp | m_ModifiedTime |
Time::Timestamp | m_CreationTime |
uintptr_t | m_Inode |
class Filesystem * | m_pFilesystem |
size_t | m_Size |
File * | m_pParent |
size_t | m_nWriters |
size_t | m_nReaders |
size_t | m_Uid |
size_t | m_Gid |
uint32_t | m_Permissions |
HashTable< DataCacheKey, uintptr_t > | m_DataCache |
bool | m_bDirect |
Cache | m_FillCache |
Mutex | m_Lock |
List< MonitorTarget * > | m_MonitorTargets |
Provides exceptionally simple VT100 emulation to the Vga class, if one exists. Note that this is NOT xterm emulation.
|
private |
|
private |
|
private |
Present backbuffer to the VGA instance.
Definition at line 1595 of file TextIO.cc.
References TextIO::VgaCell::hidden, and Process::m_Lock.
TextIO::InputMode TextIO::getMode | ( | ) | const |
bool TextIO::initialise | ( | bool | bClear = true | ) |
Initialise and prepare for rendering. Clears the screen as a side-effect, unless false is passed in for bClear.
Definition at line 104 of file TextIO.cc.
References Machine::getVga(), Processor::information(), Process::m_Lock, and Vga::setLargestTextMode().
Referenced by DevFs::initialise(), and VirtualTerminalManager::openInactive().
|
inlineprivatevirtual |
bool TextIO::isPrimary | ( | ) | const |
void TextIO::markPrimary | ( | ) |
|
virtual |
|
virtual |
void TextIO::setMode | ( | InputMode | mode | ) |
|
private |
Translate given UTF32 codepoint to an ASCII character for display.
Definition at line 1704 of file TextIO.cc.
References InputManager::Key, String::Utf32ToUtf8(), and WARNING.
void TextIO::unmarkPrimary | ( | ) |
|
virtual |
Writes bytes to the file, if isBytewise() == true.
Reimplemented from File.
void TextIO::writeStr | ( | const char * | s, |
size_t | len | ||
) |
Write a string to the screen, handling any VT100 control sequences embedded in the string along the way.
str | The string to write. |
Definition at line 177 of file TextIO.cc.
References Dec, ERROR, FATAL, Hex, Terminal::initialise(), Process::m_Lock, NOTICE, and WARNING.
Referenced by VirtualTerminalManager::openInactive().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |