summaryrefslogtreecommitdiff
path: root/Source/Kernel/VTManager/VT.ns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/VTManager/VT.ns.cpp')
-rw-r--r--Source/Kernel/VTManager/VT.ns.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/Kernel/VTManager/VT.ns.cpp b/Source/Kernel/VTManager/VT.ns.cpp
new file mode 100644
index 0000000..76aeb47
--- /dev/null
+++ b/Source/Kernel/VTManager/VT.ns.cpp
@@ -0,0 +1,32 @@
+#include "VT.ns.h"
+#include <Library/Vector.class.h>
+#include <DeviceManager/Disp.ns.h>
+
+namespace VT {
+
+Vector<VirtualTerminal*> mappedVTs;
+
+void map(VirtualTerminal* vt) {
+ unmap(vt); //Bad things might happen
+ mappedVTs.push(vt);
+}
+
+void unmap(VirtualTerminal* vt) {
+ for (u32int i = 0; i < mappedVTs.size(); i++) {
+ if (mappedVTs[i] == vt) {
+ mappedVTs[i] = mappedVTs.back();
+ mappedVTs.pop();
+ redrawScreen();
+ return;
+ }
+ }
+}
+
+void redrawScreen() {
+ Disp::clear();
+ for (u32int i = 0; i < mappedVTs.size(); i++) {
+ mappedVTs[i]->redraw();
+ }
+}
+
+}