summaryrefslogtreecommitdiff
path: root/Source/Library/Userland/Binding
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library/Userland/Binding')
-rw-r--r--Source/Library/Userland/Binding/Process.class.h4
-rw-r--r--Source/Library/Userland/Binding/VirtualTerminal.class.h6
2 files changed, 7 insertions, 3 deletions
diff --git a/Source/Library/Userland/Binding/Process.class.h b/Source/Library/Userland/Binding/Process.class.h
index 2200f59..e94084b 100644
--- a/Source/Library/Userland/Binding/Process.class.h
+++ b/Source/Library/Userland/Binding/Process.class.h
@@ -54,10 +54,10 @@ class Process : public RessourceCaller {
void pushArg(const String& arg) {
doCall(PRIF_PUSHARG, (u32int)&arg);
}
- void setInVT(VirtualTerminal vt) {
+ void setInVT(const VirtualTerminal& vt) {
doCall(PRIF_SETINVT, vt.resId());
}
- void setOutVT(VirtualTerminal vt) {
+ void setOutVT(const VirtualTerminal& vt) {
doCall(PRIF_SETOUTVT, vt.resId());
}
bool authenticatePW(String user, String pw) {
diff --git a/Source/Library/Userland/Binding/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h
index df44124..6576c1c 100644
--- a/Source/Library/Userland/Binding/VirtualTerminal.class.h
+++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h
@@ -7,9 +7,10 @@
#include <Kbd.iface.h>
#include <OStream.proto.h>
+#include <IStream.proto.h>
#include <WChar.class.h>
-class VirtualTerminal : public RessourceCaller, public OStream {
+class VirtualTerminal : public RessourceCaller, public OStream, public IStream {
public:
static VirtualTerminal getIn() {
u32int id = RessourceCaller::sCall(VTIF_OBJTYPE, VTIF_SGETPRINVT);
@@ -30,6 +31,9 @@ class VirtualTerminal : public RessourceCaller, public OStream {
void write(const String &s) {
doCall(VTIF_WRITE, (u32int)&s);
}
+ String read() {
+ return String::unserialize(doCall(VTIF_READLINE, 1)) += "\n";
+ }
keypress_t getKeypress(bool show = true, bool block = true) {
keypress_t* ptr = (keypress_t*)doCall(VTIF_GETKEYPRESS, (show ? 1 : 0) | (block ? 2 : 0));
return *ptr;