Cosmos/source/Cosmos.HAL2/TextScreenBase.cs
fanoI 4a990ac2af Added the concept of Encoding to the Console for now ASCII (default) and CP437 are supported (for others as CP858 I think it is needed to change font too)
- moved EncodingTest on Text subdir
- added ConsoleTest (not enabled by default)
- removed ASCIIEncodingImpl (it was not needed)
- Made plugs of Console better and added plugs for formatted versions
- Removed code to test Hashtable, Hashtable it will be a separate PR
2018-01-27 20:00:11 +01:00

55 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Cosmos.HAL
{
public abstract class TextScreenBase : Device
{
public abstract void Clear();
public abstract void SetColors(ConsoleColor aForeground, ConsoleColor aBackground);
public abstract byte GetColor();
public abstract ushort Cols
{
get;
}
public abstract ushort Rows
{
get;
}
public ConsoleColor Foreground
{
get { return (ConsoleColor)(GetColor() ^ (byte)((byte)Background << 4)); }
set { SetColors(value, Background); }
}
public ConsoleColor Background
{
get { return (ConsoleColor)(GetColor() >> 4); }
set { SetColors(Foreground, value); }
}
public abstract void SetCursorPos(int x, int y);
public abstract void ScrollUp();
public abstract byte this[int x, int y]
{
get;
set;
}
public abstract int GetCursorSize();
public abstract void SetCursorSize(int value);
public abstract bool GetCursorVisible();
public abstract void SetCursorVisible(bool value);
}
}