mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
LibIPC+LibGfx: Templatize IPC encoding as well as decoding
Now most classes dictate how they are serialized and deserialized when transmitted across LibIPC sockets. This also makes the IPC compiler a bit simpler. :^)
This commit is contained in:
parent
cba4880301
commit
3775983dfe
10 changed files with 83 additions and 45 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibIPC/Decoder.h>
|
||||
#include <LibIPC/Encoder.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
@ -146,6 +147,12 @@ const LogStream& operator<<(const LogStream& stream, const Rect& value)
|
|||
|
||||
namespace IPC {
|
||||
|
||||
bool encode(Encoder& encoder, const Gfx::Rect& rect)
|
||||
{
|
||||
encoder << rect.location() << rect.size();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool decode(Decoder& decoder, Gfx::Rect& rect)
|
||||
{
|
||||
Gfx::Point point;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue