--- nono/lib/textscreen.h 2026/04/29 17:04:51 1.1.1.7 +++ nono/lib/textscreen.h 2026/04/29 17:05:12 1.1.1.10 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// テキストスクリーン +// + #pragma once #include "header.h" @@ -94,7 +98,7 @@ class TextScreen virtual ~TextScreen(); // 初期化 - void Init(int col, int row); + void Init(int col, int row, ModeKind mode = ModeKind::Fixed); // 画面をクリアして、カーソルをホームポジションに移動 void Clear(); @@ -158,6 +162,12 @@ class TextScreen // 現在位置に1文字出力 (上位バイトは属性) void Putc(uint16 ch); + // 座標を指定して1文字出力 (上位バイトは属性) + void Putc(int x, int y, uint16 ch) { + Locate(x, y); + Putc(ch); + } + // 現在位置に文字列を出力 void Puts(const char *str); @@ -237,30 +247,3 @@ class TextScreen // カーソルが画面外に位置するとき true bool OutOfScreen {}; }; - -// -// テキストコンソール -// -class TextConsole : public TextScreen -{ - using inherited = TextScreen; - public: - TextConsole(); -}; - -// -// モニターインタフェース -// -// モニターされる側はこのインタフェースを実装すること。 -// -class IMonitor -{ - public: - virtual ~IMonitor(); - - // 自身の現在の状態を TextScreen に書き出す - virtual void MonitorUpdate(TextScreen&) = 0; - - // このモニターが必要とするサイズ(桁数×行数)を取得する - virtual nnSize GetMonitorSize() = 0; -};