From 866580161b826443bed3862b8315cefd505de37c Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Tue, 20 Oct 2009 18:10:29 +0200 Subject: We now have call tables for ressources. instead of adding calls to ressource in the constructor. --- Source/Library/Interface/Process.iface.h | 8 +++---- Source/Library/Interface/Thread.iface.h | 6 ++--- Source/Library/Interface/VirtualTerminal.iface.h | 17 +++++++++----- Source/Library/Userland/Binding/Process.class.h | 10 ++++---- Source/Library/Userland/Binding/Thread.class.h | 8 +++---- .../Userland/Binding/VirtualTerminal.class.h | 27 +++++++++++++++------- 6 files changed, 46 insertions(+), 30 deletions(-) (limited to 'Source/Library') diff --git a/Source/Library/Interface/Process.iface.h b/Source/Library/Interface/Process.iface.h index 0956679..fe70833 100644 --- a/Source/Library/Interface/Process.iface.h +++ b/Source/Library/Interface/Process.iface.h @@ -1,9 +1,9 @@ #ifndef DEF_PROCESS_IFACE_H #define DEF_PROCESS_IFACE_H -#define PR_IFACE_OBJTYPE 0x20 -#define PR_IFACE_EXIT 0x01 -#define PR_IFACE_ALLOCPAGE 0x02 -#define PR_IFACE_FREEPAGE 0x03 +#define PRIF_OBJTYPE 0x20 +#define PRIF_EXIT 0x01 +#define PRIF_ALLOCPAGE 0x02 +#define PRIF_FREEPAGE 0x03 #endif diff --git a/Source/Library/Interface/Thread.iface.h b/Source/Library/Interface/Thread.iface.h index 2a64924..ac572b4 100644 --- a/Source/Library/Interface/Thread.iface.h +++ b/Source/Library/Interface/Thread.iface.h @@ -1,8 +1,8 @@ #ifndef DEF_THREAD_IFACE_H #define DEF_THREAD_IFACE_H -#define TH_IFACE_OBJTYPE 0x21 -#define TH_IFACE_SLEEP 0x01 -#define TH_IFACE_FINISH 0x02 +#define THIF_OBJTYPE 0x21 +#define THIF_SLEEP 0x01 +#define THIF_FINISH 0x02 #endif diff --git a/Source/Library/Interface/VirtualTerminal.iface.h b/Source/Library/Interface/VirtualTerminal.iface.h index 1525b6c..528e9e5 100644 --- a/Source/Library/Interface/VirtualTerminal.iface.h +++ b/Source/Library/Interface/VirtualTerminal.iface.h @@ -1,12 +1,17 @@ #ifndef DEF_VITRUALTERMINAL_IFACE_H #define DEF_VITRUALTERMINAL_IFACE_H -#define VT_IFACE_OBJTYPE 0x10 -#define VT_IFACE_PUT 0x01 -#define VT_IFACE_WRITEHEX 0x02 -#define VT_IFACE_WRITEDEC 0x03 -#define VT_IFACE_WRITE 0x04 +#define VTIF_OBJTYPE 0x10 +#define VTIF_PUT 0x01 +#define VTIF_WRITEHEX 0x02 +#define VTIF_WRITEDEC 0x03 +#define VTIF_WRITE 0x04 -#define VT_IFACE_READLINE 0x05 +#define VTIF_READLINE 0x05 + +#define VTIF_SETCOLOR 0x10 +#define VTIF_SETCSRLINE 0x11 +#define VTIF_SETCSRCOL 0x12 +#define VTIF_ISBOXED 0x13 #endif diff --git a/Source/Library/Userland/Binding/Process.class.h b/Source/Library/Userland/Binding/Process.class.h index 88af9d6..e532ad3 100644 --- a/Source/Library/Userland/Binding/Process.class.h +++ b/Source/Library/Userland/Binding/Process.class.h @@ -5,18 +5,18 @@ class Process : public RessourceCaller { public: static Process get() { - u32int id = RessourceCaller::getObjId(PR_IFACE_OBJTYPE); + u32int id = RessourceCaller::getObjId(PRIF_OBJTYPE); return Process(id); } - Process(u32int id) : RessourceCaller(id, PR_IFACE_OBJTYPE) {} + Process(u32int id) : RessourceCaller(id, PRIF_OBJTYPE) {} void exit() { - doCall(PR_IFACE_EXIT); + doCall(PRIF_EXIT); } void allocPage(u32int pos) { - doCall(PR_IFACE_ALLOCPAGE, pos); + doCall(PRIF_ALLOCPAGE, pos); } void freePage(u32int pos) { - doCall(PR_IFACE_FREEPAGE, pos); + doCall(PRIF_FREEPAGE, pos); } }; diff --git a/Source/Library/Userland/Binding/Thread.class.h b/Source/Library/Userland/Binding/Thread.class.h index beef9c5..1a354d3 100644 --- a/Source/Library/Userland/Binding/Thread.class.h +++ b/Source/Library/Userland/Binding/Thread.class.h @@ -5,15 +5,15 @@ class Thread : public RessourceCaller { public: static Thread get() { - u32int id = RessourceCaller::getObjId(TH_IFACE_OBJTYPE); + u32int id = RessourceCaller::getObjId(THIF_OBJTYPE); return Thread(id); } - Thread(u32int id) : RessourceCaller(id, TH_IFACE_OBJTYPE) {} + Thread(u32int id) : RessourceCaller(id, THIF_OBJTYPE) {} void sleep(u32int msecs) { - doCall(TH_IFACE_SLEEP, msecs); + doCall(THIF_SLEEP, msecs); } void finish(u32int errcode) { - doCall(TH_IFACE_FINISH, errcode); + doCall(THIF_FINISH, errcode); } }; diff --git a/Source/Library/Userland/Binding/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h index 67683b8..4329c86 100644 --- a/Source/Library/Userland/Binding/VirtualTerminal.class.h +++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h @@ -8,26 +8,37 @@ class VirtualTerminal : public RessourceCaller { public: static VirtualTerminal get() { - u32int id = RessourceCaller::getObjId(VT_IFACE_OBJTYPE); + u32int id = RessourceCaller::getObjId(VTIF_OBJTYPE); return VirtualTerminal(id); } - VirtualTerminal(u32int id) : RessourceCaller(id, VT_IFACE_OBJTYPE) {} + VirtualTerminal(u32int id) : RessourceCaller(id, VTIF_OBJTYPE) {} void writeHex(u32int number) { - doCall(VT_IFACE_WRITEHEX, number); + doCall(VTIF_WRITEHEX, number); } void writeDec(s64int number) { - doCall(VT_IFACE_WRITEDEC, (number >> 32), number); + doCall(VTIF_WRITEDEC, (number >> 32), number); } void write(String s) { - Serialized a = s.serialize(); - doCall(VT_IFACE_WRITE, a); + doCall(VTIF_WRITE, (u32int)&s); } String readLine() { - return String::unserialize(doCall(VT_IFACE_READLINE)); + return String::unserialize(doCall(VTIF_READLINE)); + } + void setColor(u8int fg, u8int bg = 0xFF) { + doCall(VTIF_SETCOLOR, (fg << 8) | bg); + } + void setCsrLine(u32int line) { + doCall(VTIF_SETCSRLINE, line); + } + void setCsrCol(u32int col) { + doCall(VTIF_SETCSRCOL, col); + } + bool isBoxed() { + return doCall(VTIF_ISBOXED) != 0; } void put(WChar c) { - doCall(VT_IFACE_PUT, c); + doCall(VTIF_PUT, c); } }; -- cgit v1.2.3