History log of /haiku/headers/os/app/Message.h
Revision Date Author Comments
# fe88ae51 29-Aug-2020 John Scipione <jscipione@gmail.com>

AppKit: BMessage Add/Find/Get/Has/ReplaceNodeRef

This allows you to pass node_ref's around like you can entry_ref's.

Added node_ref_flatten(), node_ref_unflatten() and node_ref_swap() to
MessageUtils. These are close cousins to entry_ref_flatten(),
entry_ref_unflatten(), and entry_ref_swap() but for node_ref's.

Added B_NODE_REF_TYPE to TypeConstants.h in the Support Kit.

Added B_NODE_REF_TYPE to Debugger and ByteOrder in Support Kit,
B_NODE_REF_TYPE is treated the same as a B_REF_TYPE (entry_ref).

Add documentation for new NodeRef methods and B_NODE_REF_TYPE.

Change-Id: I32c6ed276bf1a7894a835b9fc9de5a882c35883c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3182
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 08a4536b 12-Dec-2017 Axel Dörfler <axeld@pinc-software.de>

BMessage: Added missing [Get|Set]Pointer()

* SetPointer() was declared, but not defined.


# 7f9368ca 09-Dec-2015 looncraz <looncraz@looncraz.net>

Set*UIColor, etc.

The inseparable changes necessary to support live color updating across the
system in a sane, safe, and performant manner.

BView gains:

HasSystemColors()
HasDefaultColors()
AdoptSystemColors()
AdoptParentColors()
AdoptViewColor(BView*)
SetViewUIColor(color_which, float tint)
SetHighUIColor(...
SetLowUIColor(...
ViewUIColor(float* tint)
HighUIColor(...
LowUIColor(...
DelayedInvalidate()

BWindow gains a simple helper method:
IsOffscreenWindow()

BMessage gains:

AddColor()
FindColor()
GetColor()
HasColor() * allegedly this API is deprecated, but I implemented it anyway
ReplaceColor()
SetColor()

Previous private ColorTools methods are made public and moved into GraphicsDefs:

mix_color, blend_color, disable_color

These are fully compatible with BeOS dan0 R5.1 methods and are just code cleanup
of BeOS example code under the OpenTracker license.

In addition, four new colors are created:
B_LINK_TEXT_COLOR
B_LINK_HOVER_COLOR
B_LINK_ACTIVE_COLOR
B_LINK_VISITED_COLOR

These changes are documented in their proper user documentation files.

In addition, due to a history rewrite, B_FOLLOW_LEFT_TOP has been defined and
used in lieu of B_FOLLOW_TOP | B_FOLLOW_LEFT and is included in this commit.

On the app_server side, the following has changed:

Add DelayedMessage - a system by which messages can be sent at a scheduled time,
and can also be merged according to set rules. A single thread is used to service the
message queue and multiple recipients can be set for each message.
Desktop gains the ability to add message ports to a DelayedMessage so that
said messages can target either all applications or all windows, as needed.

Desktop maintains a BMessage which is used to queue up all pending color changes
and the delayed messaging system is used to enact these changes after a short
period of time has passed. This prevents abuse and allows the system to merge
repeated set_ui_color events into one event for client applications, improving
performance drastically.

In addition, B_COLORS_UPDATED is sent to the BApplication, which forwards the message
to each BWindow. This is done to improve performance over having the app_server
independently informing each window.

Decorator changes are live now, which required some reworking.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# 7a9c0073 26-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

BMessage: add default parameter to GetString()/GetBool().

* It's likely that you want NULL/false when the data is not available
so you can now leave out the default value in that case.


# d33e4744 03-Jul-2013 Axel Dörfler <axeld@pinc-software.de>

IMAP: downloading mails is now working.

* Changed the way the attributes are written to make sure that everything
that can be written once is in fact written just once.
* The rename code in BMailProtocol::_ProcessFetchedHeader() was broken,
and caused the hang of the last commit.


# a6f1bc98 24-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

BMessage::ReplaceData: potential corruption on realloc fail

The method would update the field offsets first, and would not restore
them in case of realloc failure, leaving them pointing to the wrong
place.


# 20721297 22-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

BMessage: remove unimplemented GetPointer from headers and docs

* This was never implemented and no one noticed until now.
* A default value for a pointer doesn't make that much sense anyway, so
using the FindPointer method is fine.


# 8007a392 08-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

BMessage: add AddFlat taking a const BFlattenable

It seems the const was forgotten in the BeOS version. But there is no
reason not to have it.


# be902ac4 11-Jun-2014 John Scipione <jscipione@gmail.com>

App Kit: style changes.

No functional change intended.

Focused on documented classes only.

* Update copyright information.
* whitespace fixes.
* pointer style
* Rename some variables, msg => message, form => what
* Need consistent variable names to make documentation easier,
allows us to use \copydoc or \copydetails instead of repeating
ourselves over and over again.


# cf0a957f 19-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BMessage: Add {Add,Find}Strings()

They add a BStringList to/extract it from a B_STRING_TYPE field.


# a2f6e5ac 12-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added missing BMessage::{Get|Set}String() methods.

* Forgot to add those before accidentally.


# 6e50e79e 03-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added Get*()/Set*() methods like the ones from KMessage.


# 87e70090 02-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Style cleanup.


# 009fd257 26-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

Added BMessage::Append(), and new(std::nothrow_t).

* Append() copies all fields from the specified message.
* The nothrow operator new allows you to add BMessages to a BObjectList.


# 54cf3a72 14-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed sReplyPortInUse type from long to int32, so it be used with
atomic_add() also on 64 bit architectures.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42174 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eff23a81 13-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing header <Size.h>.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42166 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b526613 07-Feb-2011 Stephan Aßmus <superstippi@gmx.de>

Added another GetInfo() variant with which one can retrieve the count and
fixed size flag at once. Not sure if this can be merged into one of the
existing GetInfo() variants without breaking binary compatibility.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40374 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b1008df2 14-Jul-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Alex Wilson: Added convenience methods for storing BAlignment and BSize
in BMessages. Also added type codes for them in TypeConstants.h. Closes ticket
#6302. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37511 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e5150e28 08-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson (compilation fixes by myself): Extended the archiving/
unarchiving protocol to support archival of arbitrary object graphs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37431 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e0b7c61c 10-Sep-2009 Oliver Tappe <zooey@hirschkaefer.de>

Closing ticket #4465:
Net_server starts services by invoking fork() followed by exec(). If the latter
fails (for instance because the service isn't installed), the forked child is
invoking exit(). This in turn unloads libbe, triggering static cleanup code in
BMessage, which deletes a couple of message ports that were inherited from the
parent during the fork. After that, net_server was desparately missing those
ports and no longer worked reliably.
* in InitTerminateLibBe, we now register an atfork-(child-)handler, which
takes care to re-initialize the static reply ports used by BMessage code
* added BMessage::Private::StaticReInitForkedChild wrapper and
BMessage::_StaticReInitForkedChild() implementation which overwrites the
inherited port IDs with a set of own ports


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33050 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d7a16b23 31-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

* Fully switch to the Haiku message format so that it is also used for on-disk
storage.
* Remove reduntant information from the header (field_count vs. fields_size).
* Remove checksums previously used to validate the message passing by area
mechanism.
* Move variables that are purely used by the instance out of the header and into
the BMessage object.
* Use more sensible types for the different message fields.
* Reduce some field sizes to realistic values.
* Make size_t values into uint32 values so the message format will not change
when later moving to 64 bits.
* Pack the structures used for flat message storage so it doesn't change
because of padding.
* Fix message passing by area. It never worked because the created area was
never actually filled with any data!
* Some more allocation checks with graceful fallbacks (should be all now).
* Some more checks for negative index values (should also be all now).
* Make printing more inline with how the rest of the class works and make some
of the output more consistent.
* Also add the new unsigned types to PrintToStream() output.
* Fix printing of unknown types and invalid BMessages, it would always have
printed only the first entry respectively the same error.
* Added some clarifying comments.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32039 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e20dc8a7 22-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing convenience methods for unsigned integers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31187 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c6372b4 16-Oct-2008 Michael Lotz <mmlr@mlotz.ch>

Rename BMessage::CompareData() to HasSameData() as this makes more sense for the
bool return type. Did I mention this was an unstable Haiku extension?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28181 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b25b917 16-Oct-2008 Michael Lotz <mmlr@mlotz.ch>

Introduce BMessage::CompareData() which is a Haiku API extension. It compares
the data of two BMessages and allows recursive comparison (BMessage inside
BMessage). Note that using this API might require you to recompile your app in
the path to R1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28174 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a433b9fe 09-Mar-2008 Michael Lotz <mmlr@mlotz.ch>

Rewrite and activate message passing by area. Passing by area works now with
the new sematic of transfer_area so a message area is transfered into the right
teams' address space and it does not need to be cloned there anymore. Passing
by area is only used for messages bigger than a certain size (currently
hardcoded to 40KB) which should be somehow bound to the max port message size.
This makes passing large messages (i.e. > the port limit) possible, so for
example copy&paste of long text, image data, etc. should now work.
Got rid of the fClonedArea member as it is not necessary with the new design,
renamed shared_area to message_area in the private message_header, avoid
an unnecessary allocation of the header for the copy constructors, check
allocations in a few more places and some minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24321 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f9d99406 04-Jul-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed build under Dano (and probably Zeta, too); our headers used entry_ref resp.
BDirectory without declaring it first. Since that's an actual bug, I made the
changes in the Haiku headers, and copied them back to the build headers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21562 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9dbe170a 26-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Implemented direct message passing for local targets; this fixes a deadlock
with PostMessage() in case the message queue is full.
Some notes:
* for synchronous replies, we don't use this mechanism yet, but it could be
extended to do that as well.
* the code looks so complicated because we need a way to access the looper's
queue without locking it (to prevent deadlocks); like Dano's solution, I've
abused BTokenSpace to store a BDirectMessageTarget with a BHandler.
* we also need to decouple the lifetime of a looper's queue from its target,
as we cannot lock the looper, and therefore, can't guarantee it stays valid
as long as we're accessing it outside of BLooper.
* init_clipboard() now needs to be done after the global constructors have
been called - since sending messages now needs gDefaultTokens to be initialized.
Since this is done per image, it shouldn't cause any troubles, though.
* some minor cleanup, removed unused _msg_cache_cleanup_() and friends.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19968 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 67bdea52 10-Jul-2006 Jérôme Duval <korli@users.berlios.de>

hope no one minds with this Dano-like version of BMessage::PrintToStream()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18089 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bdbd1cb4 11-Mar-2006 Michael Lotz <mmlr@mlotz.ch>

Removing the USING_MESSAGE4 define.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16710 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2bf8fb3a 11-Mar-2006 Michael Lotz <mmlr@mlotz.ch>

Putting Message4 into place to become the new BMessage implementation. Will cleanup USING_MESSAGE4 now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16709 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 16ba0dc5 11-Mar-2006 Michael Lotz <mmlr@mlotz.ch>

Removing old BMessage implementation. Message4 will replace it in the next commit.
This will allow to fix message related problems like drag and drop and scripting.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16708 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ceb1e51 20-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
to your UserBuildConfig:
AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
target the client handler, while the other will target the preferred handler of the
client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15046 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1ba67cc8 16-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* almost rewrote BMessageQueue; simplified code, removed over-extensive documentation,
cleanup.
* made BMessageQueue::IsLocked() const - the non-const version is still provided
for binary compatibility.
* Both BMessageQueue::FindMessage() versions are now thread safe, the queue's BLocker
is now mutable to allow for this.
* renamed BMessage::link to fQueueLink as the "Message4" implementation uses it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14955 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 12119222 30-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

struct entry_ref was used without defining it.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14580 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 75393a98 22-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Named the fReplyTo struct so that we can create other vars of this type.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11449 a95241bf-73f2-0310-859d-f6bbb57e9c96


# efbea3a0 28-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved the functionality to flatten and unflatten a BMessage header into
a separate class. This allowed to improve _SendFlattenedMessage() to
deal properly with flattened BMessages as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 534ef684 28-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Turned _init_message_(), _delete_message_(), and _clean_msg_cache_() into
proper private static BMessage members and made them accessible through
BMessage::Private. Got rid of unused _reconstruct_message_().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11106 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 37787255 25-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for unflatting from flattened KMessages. At least when
a buffer is given.
* Added method for sending flattened messages. The KMessage support is
complete, but for BMessages this is a bit tricky. We currently unflatten
the BMessages and send those.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11060 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e9e500cb 25-Aug-2003 ejakowatz <ejakowatz@nowhere.fake>

Minor tweak to BHandler::UnlockLooper()
Added calls to _init_message_(), _delete_message_(), and
_msg_cache_cleanup() to InitTerminateLibBe.cpp
Finished first implementation of BMessage::SendReply(), BMessage::_send_(),
and BMessage::_send_message()
Add BMessage to app.src, removed BBlockCache from support.src.
New BMessage::Private class has functions for twiddling BMessage internals


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4371 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 80e96696 23-May-2003 ejakowatz <ejakowatz@nowhere.fake>

Little tweaks and fixes too numerous to count, but mostly involved with
adding entry_refs and BMessages. Lots of stuff for specifiers and also for
sending replies (with thanks to Mike Nordell).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3295 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9862b592 18-Mar-2003 ejakowatz <ejakowatz@nowhere.fake>

Resolved a minor conflict.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2952 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 13772dd6 16-Mar-2003 DarkWyrm <darkwyrm@gmail.com>

Tweaks to get it to build proplery


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2924 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 80a604c9 28-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

All things BMessage; initial check in.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@503 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7a9c00732a57d392157ba51895d74c1b7b4e7d76 26-Feb-2015 Axel Dörfler <axeld@pinc-software.de>

BMessage: add default parameter to GetString()/GetBool().

* It's likely that you want NULL/false when the data is not available
so you can now leave out the default value in that case.


# d33e4744df1542a1350f55c25ce7b691560d7345 03-Jul-2013 Axel Dörfler <axeld@pinc-software.de>

IMAP: downloading mails is now working.

* Changed the way the attributes are written to make sure that everything
that can be written once is in fact written just once.
* The rename code in BMailProtocol::_ProcessFetchedHeader() was broken,
and caused the hang of the last commit.


# a6f1bc984d9217836f2bb3f4fbfdda00205937b2 24-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

BMessage::ReplaceData: potential corruption on realloc fail

The method would update the field offsets first, and would not restore
them in case of realloc failure, leaving them pointing to the wrong
place.


# 207212972e96a9c3954d0d3ececcd85291b1e18a 22-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

BMessage: remove unimplemented GetPointer from headers and docs

* This was never implemented and no one noticed until now.
* A default value for a pointer doesn't make that much sense anyway, so
using the FindPointer method is fine.


# 8007a392cf1512972cb9e92ba64923c58e60d12b 08-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

BMessage: add AddFlat taking a const BFlattenable

It seems the const was forgotten in the BeOS version. But there is no
reason not to have it.


# be902ac4db5c9d0be72f6d54aa67b66e3dcc7eca 11-Jun-2014 John Scipione <jscipione@gmail.com>

App Kit: style changes.

No functional change intended.

Focused on documented classes only.

* Update copyright information.
* whitespace fixes.
* pointer style
* Rename some variables, msg => message, form => what
* Need consistent variable names to make documentation easier,
allows us to use \copydoc or \copydetails instead of repeating
ourselves over and over again.


# cf0a957ff6c0dea52e5790a67a8fd6a179e77fe2 19-Apr-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

BMessage: Add {Add,Find}Strings()

They add a BStringList to/extract it from a B_STRING_TYPE field.


# a2f6e5ac9c3f022f1c2afb29e6cc616e08d3adca 12-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added missing BMessage::{Get|Set}String() methods.

* Forgot to add those before accidentally.


# 6e50e79e543b83ed2983b23a018abd3caa93efaf 03-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added Get*()/Set*() methods like the ones from KMessage.


# 87e70090190405210aee50782485af39f0395f5c 02-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Style cleanup.


# 009fd2571533728ad3b0da9430341b4b7cff46e8 26-Oct-2012 Axel Dörfler <axeld@pinc-software.de>

Added BMessage::Append(), and new(std::nothrow_t).

* Append() copies all fields from the specified message.
* The nothrow operator new allows you to add BMessages to a BObjectList.


# 54cf3a72ba9b942fbe71fe4b3443c51ac0e4af01 14-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed sReplyPortInUse type from long to int32, so it be used with
atomic_add() also on 64 bit architectures.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42174 a95241bf-73f2-0310-859d-f6bbb57e9c96


# eff23a8157fad0e6752999b5c131abd3e8de4193 13-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing header <Size.h>.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42166 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2b526613151fb42f35f8a5b9da7e8cf66127a00a 07-Feb-2011 Stephan Aßmus <superstippi@gmx.de>

Added another GetInfo() variant with which one can retrieve the count and
fixed size flag at once. Not sure if this can be merged into one of the
existing GetInfo() variants without breaking binary compatibility.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40374 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b1008df2c2007091bdda65b6dbb8ba9362ffbd09 14-Jul-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Alex Wilson: Added convenience methods for storing BAlignment and BSize
in BMessages. Also added type codes for them in TypeConstants.h. Closes ticket
#6302. Thanks!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37511 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e5150e28472204582c41b3d3cd5b4eabdbef323e 08-Jul-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Alex Wilson (compilation fixes by myself): Extended the archiving/
unarchiving protocol to support archival of arbitrary object graphs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37431 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e0b7c61c46c65f6cdc85c3b8240b282f2d045f49 10-Sep-2009 Oliver Tappe <zooey@hirschkaefer.de>

Closing ticket #4465:
Net_server starts services by invoking fork() followed by exec(). If the latter
fails (for instance because the service isn't installed), the forked child is
invoking exit(). This in turn unloads libbe, triggering static cleanup code in
BMessage, which deletes a couple of message ports that were inherited from the
parent during the fork. After that, net_server was desparately missing those
ports and no longer worked reliably.
* in InitTerminateLibBe, we now register an atfork-(child-)handler, which
takes care to re-initialize the static reply ports used by BMessage code
* added BMessage::Private::StaticReInitForkedChild wrapper and
BMessage::_StaticReInitForkedChild() implementation which overwrites the
inherited port IDs with a set of own ports


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33050 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d7a16b238f2207547080ea7eb0f4c430b6f25049 31-Jul-2009 Michael Lotz <mmlr@mlotz.ch>

* Fully switch to the Haiku message format so that it is also used for on-disk
storage.
* Remove reduntant information from the header (field_count vs. fields_size).
* Remove checksums previously used to validate the message passing by area
mechanism.
* Move variables that are purely used by the instance out of the header and into
the BMessage object.
* Use more sensible types for the different message fields.
* Reduce some field sizes to realistic values.
* Make size_t values into uint32 values so the message format will not change
when later moving to 64 bits.
* Pack the structures used for flat message storage so it doesn't change
because of padding.
* Fix message passing by area. It never worked because the created area was
never actually filled with any data!
* Some more allocation checks with graceful fallbacks (should be all now).
* Some more checks for negative index values (should also be all now).
* Make printing more inline with how the rest of the class works and make some
of the output more consistent.
* Also add the new unsigned types to PrintToStream() output.
* Fix printing of unknown types and invalid BMessages, it would always have
printed only the first entry respectively the same error.
* Added some clarifying comments.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32039 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e20dc8a7b7be013af204c9deaa3d7bef6f65943d 22-Jun-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Added missing convenience methods for unsigned integers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31187 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c6372b44a0ee5f9f1d00977b442cbd844478c1e 16-Oct-2008 Michael Lotz <mmlr@mlotz.ch>

Rename BMessage::CompareData() to HasSameData() as this makes more sense for the
bool return type. Did I mention this was an unstable Haiku extension?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28181 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5b25b917f9716d088424b5602a6c5c3a7d3f4997 16-Oct-2008 Michael Lotz <mmlr@mlotz.ch>

Introduce BMessage::CompareData() which is a Haiku API extension. It compares
the data of two BMessages and allows recursive comparison (BMessage inside
BMessage). Note that using this API might require you to recompile your app in
the path to R1.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28174 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a433b9febfc466a18f81d297fd60c21e0d0e4690 09-Mar-2008 Michael Lotz <mmlr@mlotz.ch>

Rewrite and activate message passing by area. Passing by area works now with
the new sematic of transfer_area so a message area is transfered into the right
teams' address space and it does not need to be cloned there anymore. Passing
by area is only used for messages bigger than a certain size (currently
hardcoded to 40KB) which should be somehow bound to the max port message size.
This makes passing large messages (i.e. > the port limit) possible, so for
example copy&paste of long text, image data, etc. should now work.
Got rid of the fClonedArea member as it is not necessary with the new design,
renamed shared_area to message_area in the private message_header, avoid
an unnecessary allocation of the header for the copy constructors, check
allocations in a few more places and some minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24321 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f9d99406aea10fb5f1d100007bd006adf0467819 04-Jul-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed build under Dano (and probably Zeta, too); our headers used entry_ref resp.
BDirectory without declaring it first. Since that's an actual bug, I made the
changes in the Haiku headers, and copied them back to the build headers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21562 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9dbe170a694e59988263a752b746b6a82a5ff277 26-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

Implemented direct message passing for local targets; this fixes a deadlock
with PostMessage() in case the message queue is full.
Some notes:
* for synchronous replies, we don't use this mechanism yet, but it could be
extended to do that as well.
* the code looks so complicated because we need a way to access the looper's
queue without locking it (to prevent deadlocks); like Dano's solution, I've
abused BTokenSpace to store a BDirectMessageTarget with a BHandler.
* we also need to decouple the lifetime of a looper's queue from its target,
as we cannot lock the looper, and therefore, can't guarantee it stays valid
as long as we're accessing it outside of BLooper.
* init_clipboard() now needs to be done after the global constructors have
been called - since sending messages now needs gDefaultTokens to be initialized.
Since this is done per image, it shouldn't cause any troubles, though.
* some minor cleanup, removed unused _msg_cache_cleanup_() and friends.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19968 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 67bdea52ced05be62a2fc1410e430d30f2202253 10-Jul-2006 Jérôme Duval <korli@users.berlios.de>

hope no one minds with this Dano-like version of BMessage::PrintToStream()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18089 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bdbd1cb4412cb21b5c6ddbec72bd7f151d3f09cf 11-Mar-2006 Michael Lotz <mmlr@mlotz.ch>

Removing the USING_MESSAGE4 define.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16710 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2bf8fb3a96fb88396d466474b6c66888168376f7 11-Mar-2006 Michael Lotz <mmlr@mlotz.ch>

Putting Message4 into place to become the new BMessage implementation. Will cleanup USING_MESSAGE4 now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16709 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 16ba0dc5ca98127d39c627ae8888ea61d907efc8 11-Mar-2006 Michael Lotz <mmlr@mlotz.ch>

Removing old BMessage implementation. Message4 will replace it in the next commit.
This will allow to fix message related problems like drag and drop and scripting.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16708 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4ceb1e519c0447147b1d8b54a324bb7fedd3a606 20-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* reverted Adi's premature changes to BWindow and restored _DetermineTarget() and
task_looper() again.
* removed BMessenger::fPreferred - whenever you had to specify "usePreferred" separately,
you don't have to do that anymore - use B_PREFERRED_TOKEN instead.
* fixed BTokenSpace::GetToken() semantics: it will no longer touch the "object" argument
in case of failure.
* Introduced a BWindow::_DistributeMessage() that will be part of the event dispatcher
counterpart to the app_server (the other will be _DetermineTarget()).
* Made it easier to use Michael's Message4 implementation: just add the following line
to your UserBuildConfig:
AppendToConfigVar DEFINES : HAIKU_TOP src : USING_MESSAGE4 : global ;
* Introduced ServerWindow::HandlerMessenger() and FocusMessenger() - the first will
target the client handler, while the other will target the preferred handler of the
client looper (usually the view having focus).
* Fixed dano message unflattening in the Message4 code.
* Changed BMessage::PrintToStream() to no longer use macros in the Message4 implementation.
* I hope that's all - it's a huge change, but it's all connected.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15046 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1ba67cc8c65656c3ada7f150a3138cebc01a7f66 16-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

* almost rewrote BMessageQueue; simplified code, removed over-extensive documentation,
cleanup.
* made BMessageQueue::IsLocked() const - the non-const version is still provided
for binary compatibility.
* Both BMessageQueue::FindMessage() versions are now thread safe, the queue's BLocker
is now mutable to allow for this.
* renamed BMessage::link to fQueueLink as the "Message4" implementation uses it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14955 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 758b1d0e05fe1042cce6e00d194a147802d4f9be 12-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
Otherwise the an inner class with that name is considered as friend.
gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 12119222aa17577a5506564a298cf409a87bb797 30-Oct-2005 Axel Dörfler <axeld@pinc-software.de>

struct entry_ref was used without defining it.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14580 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 75393a987013e0bbd07eac62dfd4a7b72cc469ba 22-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Named the fReplyTo struct so that we can create other vars of this type.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11449 a95241bf-73f2-0310-859d-f6bbb57e9c96


# efbea3a07a535a8460afc7ca455a11f8d0923cbf 28-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Moved the functionality to flatten and unflatten a BMessage header into
a separate class. This allowed to improve _SendFlattenedMessage() to
deal properly with flattened BMessages as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11116 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 534ef684d970a6b8fdd6bd273b0ac00ffaa35433 28-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Turned _init_message_(), _delete_message_(), and _clean_msg_cache_() into
proper private static BMessage members and made them accessible through
BMessage::Private. Got rid of unused _reconstruct_message_().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11106 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 377872556ddb395fd885a3c2096c4e005e18b866 25-Jan-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added support for unflatting from flattened KMessages. At least when
a buffer is given.
* Added method for sending flattened messages. The KMessage support is
complete, but for BMessages this is a bit tricky. We currently unflatten
the BMessages and send those.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11060 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e9e500cb9eaa5061ac383f5093d08bbb65b142f8 25-Aug-2003 ejakowatz <ejakowatz@nowhere.fake>

Minor tweak to BHandler::UnlockLooper()
Added calls to _init_message_(), _delete_message_(), and
_msg_cache_cleanup() to InitTerminateLibBe.cpp
Finished first implementation of BMessage::SendReply(), BMessage::_send_(),
and BMessage::_send_message()
Add BMessage to app.src, removed BBlockCache from support.src.
New BMessage::Private class has functions for twiddling BMessage internals


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4371 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 80e966963f0265e159d6f964ecb4de54ee1dd678 23-May-2003 ejakowatz <ejakowatz@nowhere.fake>

Little tweaks and fixes too numerous to count, but mostly involved with
adding entry_refs and BMessages. Lots of stuff for specifiers and also for
sending replies (with thanks to Mike Nordell).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3295 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9862b5925d30f0bdf02af235db47211e6365cf26 18-Mar-2003 ejakowatz <ejakowatz@nowhere.fake>

Resolved a minor conflict.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2952 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 13772dd6bcc32f452920221f85ebbd0dfa62525f 16-Mar-2003 DarkWyrm <darkwyrm@gmail.com>

Tweaks to get it to build proplery


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2924 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 80a604c999182c6eb569b78fab13f4e83b6775f5 28-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

All things BMessage; initial check in.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@503 a95241bf-73f2-0310-859d-f6bbb57e9c96