Added print debug code to a number of classes
SendMessage allows for target specification Included BMessage friend classes to allow building whilst they are absent from BMessage.cpp More window-related code added git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3004 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,10 +8,15 @@
|
||||
This SendMessage takes ownership of the message sent, so deleting them after this
|
||||
call is unnecessary. Passing an invalid port will have unpredictable results.
|
||||
*/
|
||||
void SendMessage(port_id port, BMessage *message)
|
||||
void SendMessage(port_id port, BMessage *message, int32 target)
|
||||
{
|
||||
if(!message)
|
||||
return;
|
||||
|
||||
if(target==-1)
|
||||
_set_message_target_(message,target,true);
|
||||
else
|
||||
_set_message_target_(message,target,false);
|
||||
|
||||
ssize_t flatsize=message->FlattenedSize();
|
||||
char *buffer=new char[flatsize];
|
||||
@@ -22,3 +27,34 @@ void SendMessage(port_id port, BMessage *message)
|
||||
delete buffer;
|
||||
delete message;
|
||||
}
|
||||
|
||||
/*
|
||||
Below are friend functions for BMessage which currently are not in the Message.cpp
|
||||
that we need to send messages to BLoopers and such. Placed here to allow compilation.
|
||||
*/
|
||||
void _set_message_target_(BMessage *msg, int32 target, bool preferred)
|
||||
{
|
||||
if (preferred)
|
||||
{
|
||||
msg->fTarget = -1;
|
||||
msg->fPreferred = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
msg->fTarget = target;
|
||||
msg->fPreferred = false;
|
||||
}
|
||||
}
|
||||
|
||||
int32 _get_message_target_(BMessage *msg)
|
||||
{
|
||||
if (msg->fPreferred)
|
||||
return -1;
|
||||
else
|
||||
return msg->fTarget;
|
||||
}
|
||||
|
||||
bool _use_preferred_target_(BMessage *msg)
|
||||
{
|
||||
return msg->fPreferred;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user