-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#41 add sys::tui::Screen and add BoxChar support to FOStream
- Loading branch information
Showing
3 changed files
with
389 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*[meta] | ||
mimetype = text/x-pool | ||
author = Marc Woerlein <[email protected]> | ||
version = 0.1.0 | ||
*/ | ||
namespace sys::tui; | ||
|
||
|
||
class Screen extends sys::core::Object { | ||
|
||
// private | ||
int maxX; | ||
int maxY; | ||
int maxPos; | ||
int cursor; | ||
|
||
// public | ||
[] _initScreen(int maxX, int maxY, int cursor) { | ||
this.maxX = maxX; | ||
this.maxY = maxY; | ||
this.maxPos = maxX * maxY; | ||
this.cursor = cursor; | ||
} | ||
|
||
[int] getMaxX() { return maxX; } | ||
[int] getMaxY() { return maxY; } | ||
[int] getCursor() { return cursor; } | ||
|
||
[sys::stream::FOStream] createFOStream(int fg, int bg) { | ||
ScreenFOStream stream = this.createOwn(ScreenFOStream:CLASSNAME); | ||
stream.setForeground(fg).setBackground(bg); | ||
return stream.initFOStream(this.screen()); | ||
} | ||
|
||
[sys::stream::OStream] createOStream(int fg, int bg) { | ||
return this.createFOStream(fg, bg).ostream(); | ||
} | ||
|
||
abstract [] drawFCharAt(int c, int fg, int bg, int x, int y); | ||
abstract [] drawFChar(int c, int fg, int bg); | ||
abstract [] drawFBoxCharAt(int bc, int fg, int bg, int x, int y); | ||
abstract [] drawFBoxChar(int bc, int fg, int bg); | ||
abstract [] clear(); | ||
|
||
// TODO: remove with implicit cast | ||
[Screen] screen() { return this; } | ||
} |
Oops, something went wrong.