a LOT of minor stuff
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
package kernel.ui;
|
||||
|
||||
using tink.CoreApi;
|
||||
|
||||
import util.Vec.Vec2;
|
||||
import util.Color;
|
||||
import lib.TermWriteable;
|
||||
import kernel.ui.TermWriteable;
|
||||
|
||||
using tink.CoreApi;
|
||||
|
||||
/**
|
||||
A virtual terminal. With this a GUI program can still write to its "screen"
|
||||
even if its not displayed right now. When the GUI gets displayed again
|
||||
this buffer will be written to the screen.
|
||||
**/
|
||||
class TermBuffer implements TermWriteable {
|
||||
/**
|
||||
format [y][x]. First index is the line. Second index the char in the line.
|
||||
@@ -15,14 +21,14 @@ class TermBuffer implements TermWriteable {
|
||||
private var cursorPos:Vec2<Int> = {x: 0, y: 0};
|
||||
private var currentTextColor:Color = White;
|
||||
private var currentBgColor:Color = Black;
|
||||
private var cursorBlink: Bool = false;
|
||||
private var size:Vec2<Int> = {x: 51, y: 19}; // Default size set to default size of the main terminal
|
||||
|
||||
public var onResize(default, null):Signal<Vec2<Int>>;
|
||||
public final onResize:Signal<Vec2<Int>>;
|
||||
|
||||
private final onResizeTrigger:SignalTrigger<Vec2<Int>>;
|
||||
private final onResizeTrigger:SignalTrigger<Vec2<Int>> = Signal.trigger();
|
||||
|
||||
public function new() {
|
||||
this.onResizeTrigger = Signal.trigger();
|
||||
private function new() {
|
||||
this.onResize = onResizeTrigger.asSignal();
|
||||
initScreenBuffer(size);
|
||||
}
|
||||
@@ -126,11 +132,11 @@ class TermBuffer implements TermWriteable {
|
||||
}
|
||||
|
||||
public function getCursorBlink():Bool {
|
||||
throw new haxe.exceptions.NotImplementedException();
|
||||
return this.cursorBlink;
|
||||
}
|
||||
|
||||
public function setCursorBlink(blink:Bool) {
|
||||
// TODO
|
||||
this.cursorBlink = blink;
|
||||
}
|
||||
|
||||
public function getSize():Vec2<Int> {
|
||||
@@ -164,7 +170,7 @@ class TermBuffer implements TermWriteable {
|
||||
}
|
||||
|
||||
public function isColor():Bool {
|
||||
throw new haxe.exceptions.NotImplementedException();
|
||||
return true; // Lets return true for now.
|
||||
}
|
||||
|
||||
public function reset() {
|
||||
|
||||
Reference in New Issue
Block a user