*Doh* Always check the build _before_ checking in, not after. *sigh*
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2949 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -19,6 +19,7 @@ Server app_server :
|
|||||||
RectUtils.cpp
|
RectUtils.cpp
|
||||||
RGBColor.cpp
|
RGBColor.cpp
|
||||||
SystemPalette.cpp
|
SystemPalette.cpp
|
||||||
|
Utils.cpp
|
||||||
|
|
||||||
# Manager Classes
|
# Manager Classes
|
||||||
AppServer.cpp
|
AppServer.cpp
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ServerProtocol.h>
|
#include <ServerProtocol.h>
|
||||||
#include "SMessage.h"
|
|
||||||
|
|
||||||
#include "BitmapManager.h"
|
#include "BitmapManager.h"
|
||||||
#include "CursorManager.h"
|
#include "CursorManager.h"
|
||||||
@@ -247,9 +246,8 @@ printf("ServerApp %s:Server shutdown notification received\n",app->_signature.St
|
|||||||
// because the server was asked to quit. Thus, we
|
// because the server was asked to quit. Thus, we
|
||||||
// ask all apps to quit. This is NOT the same as system
|
// ask all apps to quit. This is NOT the same as system
|
||||||
// shutdown and will happen only in testing
|
// shutdown and will happen only in testing
|
||||||
BMessage *shutdown=new BMessage(B_QUIT_REQUESTED);
|
// BMessage *shutdown=new BMessage(B_QUIT_REQUESTED);
|
||||||
shutdown->fPreferred=true;
|
// SendMessage(app->_sender,shutdown);
|
||||||
SendMessage(app->_sender,shutdown);
|
|
||||||
#ifdef DEBUG_SERVERAPP
|
#ifdef DEBUG_SERVERAPP
|
||||||
printf("ServerApp %s:Sent server shutdown message to BApp\n",app->_signature.String());
|
printf("ServerApp %s:Sent server shutdown message to BApp\n",app->_signature.String());
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#include "Utils.h"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Send a BMessage to a Looper target
|
||||||
|
\param port Receiver port of the targeted Looper
|
||||||
|
\param BMessage to send
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
if(!message)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ssize_t flatsize=message->FlattenedSize();
|
||||||
|
char *buffer=new char[flatsize];
|
||||||
|
|
||||||
|
if(message->Flatten(buffer,flatsize)==B_OK)
|
||||||
|
write_port(port, message->what, buffer,flatsize);
|
||||||
|
|
||||||
|
delete buffer;
|
||||||
|
delete message;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
#ifndef UTILS_H_
|
||||||
|
#define UTILS_H_
|
||||||
|
|
||||||
|
#include <Message.h>
|
||||||
|
#include <OS.h>
|
||||||
|
|
||||||
|
void SendMessage(port_id port, BMessage *message);
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user