Moved the port creation for app_server - input_server communication out of the DisplayDrivers and into the AppServer constructor. This may later needs to be moved into RootLayer if we want multiple user support.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12426 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2005-04-17 12:26:16 +00:00
parent 79e1fcbc00
commit 597c548ca3
7 changed files with 31 additions and 38 deletions
+25 -2
View File
@@ -91,8 +91,17 @@ AppServer::AppServer(void) : BApplication (SERVER_SIGNATURE)
AppServer::AppServer(void)
#endif
{
fMessagePort= create_port(200,SERVER_PORT_NAME);
fMessagePort= create_port(200, SERVER_PORT_NAME);
if (fMessagePort == B_NO_MORE_PORTS)
debugger("app_server could not create message port");
// Create the input port. The input_server will send it's messages here.
// TODO: If we want multiple user support we would need an individual
// port for each user and do the following for each RootLayer.
fServerInputPort = create_port(200, SERVER_INPUT_PORT);
if (fServerInputPort == B_NO_MORE_PORTS)
debugger("app_server could not create input port");
fAppList= new BList(0);
fQuittingServer= false;
make_decorator= NULL;
@@ -184,6 +193,20 @@ AppServer::AppServer(void)
resume_thread(fPicassoThreadID);
fDecoratorName="Default";
#if 0
// TODO: We are supposed to start the input_server, but it's a BApplication
// that depends on the registrar running, which is started after app_server
int32 arg_c = 1;
char **arg_v = (char **)malloc(sizeof(char *) * (arg_c + 1));
arg_v[0] = strdup("/system/servers/input_server");
arg_v[1] = NULL;
thread_id isThread = load_image(arg_c, (const char**)arg_v, (const char **)environ);
free(arg_v[0]);
resume_thread(isThread);
setpgid(isThread, 0);
#endif
}
/*!
+1
View File
@@ -57,6 +57,7 @@ private:
create_decorator *make_decorator;
port_id fMessagePort;
port_id fServerInputPort;
image_id fDecoratorID;
@@ -69,12 +69,6 @@ AccelerantDriver::AccelerantDriver()
card_fd = -1;
accelerant_image = -1;
mode_list = NULL;
// we need this under Haiku too, as it is where the input_server
// sends it's data to.
port_id serverInputPort = create_port(200, SERVER_INPUT_PORT);
if (serverInputPort == B_NO_MORE_PORTS)
debugger("AccelerantDriver: out of ports\n");
}
@@ -89,13 +89,6 @@ AccelerantHWInterface::AccelerantHWInterface()
fDisplayMode.virtual_width = 640;
fDisplayMode.virtual_height = 480;
fDisplayMode.space = B_RGB32;
// TODO: Move this to a more general place
// we need this under Haiku too, as it is where the input_server
// sends it's data to.
port_id serverInputPort = create_port(200, SERVER_INPUT_PORT);
if (serverInputPort == B_NO_MORE_PORTS)
debugger("AccelerantDriver: out of ports\n");
}
// destructor
-9
View File
@@ -123,15 +123,6 @@ DirectDriver::DirectDriver()
// We'll save this so that if we change the bit depth of the screen, we
// can change it back when the driver is shut down.
fSavedScreenMode=fCurrentScreenMode;
#ifdef ENABLE_INPUT_SERVER_EMULATION
port_id serverInputPort = create_port(200, SERVER_INPUT_PORT);
if (serverInputPort == B_NO_MORE_PORTS)
{
debugger("DirectDriver: out of ports\n");
return;
}
#endif
}
DirectDriver::~DirectDriver()
+3 -8
View File
@@ -82,15 +82,10 @@ VDView::VDView(BRect bounds)
SetViewColor(B_TRANSPARENT_32_BIT);
viewbmp=new BBitmap(bounds,B_RGBA32,true);
// This link for sending mouse messages to the OBAppServer.
// This link for sending mouse messages to the Haiku app_server.
// This is only to take the place of the Input Server.
port_id serverInputPort = create_port(200, SERVER_INPUT_PORT);
if (serverInputPort == B_NO_MORE_PORTS)
{
debugger("ViewDriver: out of ports\n");
return;
}
serverlink = new BPortLink(serverInputPort);
port_id input_port = find_port(SERVER_INPUT_PORT);
serverlink = new BPortLink(input_port);
// Create a cursor which isn't just a box
cursor=new BBitmap(BRect(0,0,20,20),B_RGBA32,true);
+2 -6
View File
@@ -146,12 +146,8 @@ CardView::CardView(BRect bounds)
// This link for sending mouse messages to the Haiku app_server.
// This is only to take the place of the input_server.
port_id serverInputPort = create_port(200, SERVER_INPUT_PORT);
if (serverInputPort == B_NO_MORE_PORTS) {
debugger("ViewHWInterface: out of ports\n");
return;
}
fServerLink = new BPortLink(serverInputPort);
port_id input_port = find_port(SERVER_INPUT_PORT);
fServerLink = new BPortLink(input_port);
}
CardView::~CardView()