diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-20 18:10:29 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-20 18:10:29 +0200 |
commit | 866580161b826443bed3862b8315cefd505de37c (patch) | |
tree | 23c3f87fe43d82c47af01c908d8a056785f9217f /Source/Library | |
parent | 0cca2d68451849b5ea96a3620566fd0b42dde3c0 (diff) | |
download | Melon-866580161b826443bed3862b8315cefd505de37c.tar.gz Melon-866580161b826443bed3862b8315cefd505de37c.zip |
We now have call tables for ressources.
instead of adding calls to ressource in the constructor.
Diffstat (limited to 'Source/Library')
-rw-r--r-- | Source/Library/Interface/Process.iface.h | 8 | ||||
-rw-r--r-- | Source/Library/Interface/Thread.iface.h | 6 | ||||
-rw-r--r-- | Source/Library/Interface/VirtualTerminal.iface.h | 17 | ||||
-rw-r--r-- | Source/Library/Userland/Binding/Process.class.h | 10 | ||||
-rw-r--r-- | Source/Library/Userland/Binding/Thread.class.h | 8 | ||||
-rw-r--r-- | Source/Library/Userland/Binding/VirtualTerminal.class.h | 27 |
6 files changed, 46 insertions, 30 deletions
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); } }; |