From bba0335bbea81519beafb7fec1979a0abbd8a7ea Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 01 Oct 2002 14:27:17 +0000 Subject: 5th try initial checkin of X11 Opie stuff it features an IPC Server the client is todo this will become the OPIE X11 department including alternative QPEApplication, QCOP replacement --- (limited to 'x11/ipc/common/ocoppacket.h') diff --git a/x11/ipc/common/ocoppacket.h b/x11/ipc/common/ocoppacket.h new file mode 100644 index 0000000..490ff03 --- a/dev/null +++ b/x11/ipc/common/ocoppacket.h @@ -0,0 +1,64 @@ +/* GPL!*/ + +#ifndef OPIE_OCOP_PACKET_H +#define OPIE_OCOP_PACKET_H + +#include +#include + +/** + * This is the head which will be sent + * in advance to every packet + */ +struct OCOPHead { + int magic; + int type; + int chlen; + int funclen; + int datalen; +}; + +/** + * This is the basic packet we will + * use for the communication between server + * and client + */ +class OCOPPacket { +public: + enum Type { + Register = 0, Unregister, Call, + Method, Reply, RegisterChannel, + UnregisterChannel, Return, Signal, + IsRegistered + }; + /** + * the c'tor + * type the Type of this packet + * the Channel + * the header of the function + * the data inside a QByteArray + */ + OCOPPacket( int type, const QCString& channel = QCString(), + const QCString& header = QCString(), + const QByteArray& array = QByteArray() ); + + QByteArray toByteArray()const; + int type()const; + QCString channel()const; + QCString header()const; + QByteArray content()const; + OCOPHead head()const; + + void setType( int type ); + void setChannel( const QCString& ); + void setHeader(const QCString& ); + void setContent( const QByteArray& ); + +private: + int m_type; + QCString m_channel; + QCString m_header; + QByteArray m_content; +}; + +#endif -- cgit v0.9.0.2