using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Cosmos.HAL
{
public abstract class TextScreenBase : Device
{
///
/// Clear text screen.
///
public abstract void Clear();
///
/// Get and set console foreground color.
///
public abstract void SetColors(ConsoleColor aForeground, ConsoleColor aBackground);
///
/// Get screen color.
///
/// byte value.
public abstract byte GetColor();
///
/// Get number of columns in text screen.
///
public abstract ushort Cols
{
get;
}
///
/// Get number of rows in text screen.
///
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); }
}
///
/// Set cursor position.
///
/// A position on X axis.
/// A position on Y axis.
public abstract void SetCursorPos(int x, int y);
///
/// Scroll screen up.
///
public abstract void ScrollUp();
public abstract byte this[int x, int y]
{
get;
set;
}
///
/// Get cursor size.
///
/// int value.
public abstract int GetCursorSize();
public abstract void SetCursorSize(int value);
public abstract bool GetCursorVisible();
public abstract void SetCursorVisible(bool value);
}
}