BMessage: implemented KMessage reply.

* When you receive a message from a KMessage, and reply to it,
  it will automatically reply as KMessage, too.
* This allows to communicate with BLoopers from within the kernel
  or libroot.so.
This commit is contained in:
Axel Dörfler
2015-05-13 23:06:51 +02:00
parent 446d4dca66
commit 5ce80a78c9
5 changed files with 69 additions and 10 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2009, Haiku Inc. All rights reserved.
* Copyright 2005-2015, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -8,6 +8,7 @@
#ifndef _MESSAGE_PRIVATE_H_
#define _MESSAGE_PRIVATE_H_
#include <Message.h>
#include <Messenger.h>
#include <MessengerPrivate.h>
@@ -30,7 +31,8 @@ enum {
MESSAGE_FLAG_WAS_DELIVERED = 0x0010,
MESSAGE_FLAG_HAS_SPECIFIERS = 0x0020,
MESSAGE_FLAG_WAS_DROPPED = 0x0040,
MESSAGE_FLAG_PASS_BY_AREA = 0x0080
MESSAGE_FLAG_PASS_BY_AREA = 0x0080,
MESSAGE_FLAG_REPLY_AS_KMESSAGE = 0x0100
};
+3
View File
@@ -40,6 +40,9 @@ public:
static status_t Unflatten(uint32 format, BMessage* into,
BDataIO* stream);
static status_t ConvertToKMessage(const BMessage* from,
KMessage& to);
private:
static status_t _ConvertFromKMessage(const KMessage* from,
BMessage* to);
+4 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2005-2010, Haiku Inc. All rights reserved.
* Copyright 2005-2015, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@@ -8,6 +8,7 @@
#ifndef _MESSAGE_PRIVATE_H_
#define _MESSAGE_PRIVATE_H_
#include <Message.h>
#include <Messenger.h>
#include <MessengerPrivate.h>
@@ -30,7 +31,8 @@ enum {
MESSAGE_FLAG_WAS_DELIVERED = 0x0010,
MESSAGE_FLAG_HAS_SPECIFIERS = 0x0020,
MESSAGE_FLAG_WAS_DROPPED = 0x0040,
MESSAGE_FLAG_PASS_BY_AREA = 0x0080
MESSAGE_FLAG_PASS_BY_AREA = 0x0080,
MESSAGE_FLAG_REPLY_AS_KMESSAGE = 0x0100
};