Window now talks nice-nice to app_server
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2903 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -53,13 +53,17 @@ BWindow::BWindow(BRect frame,
|
|||||||
{
|
{
|
||||||
Lock();
|
Lock();
|
||||||
fFrame = frame;
|
fFrame = frame;
|
||||||
SetTitle(title);
|
|
||||||
decompose_type(type,&fLook,&fFeel);
|
decompose_type(type,&fLook,&fFeel);
|
||||||
SetFlags(flags);
|
|
||||||
SetWorkspaces(workspace);
|
|
||||||
|
|
||||||
// MESSAGING STUFF - Adapted from DarkWyrms proto6 code
|
if(title)
|
||||||
// Names changed to match <Window.h>
|
{
|
||||||
|
fTitle=new char[strlen(title)];
|
||||||
|
strcpy(fTitle,title);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
fTitle=NULL;
|
||||||
|
fFlags=flags;
|
||||||
|
|
||||||
// Create a port on which to listen to messages
|
// Create a port on which to listen to messages
|
||||||
receive_port=create_port(50,"msgport");
|
receive_port=create_port(50,"msgport");
|
||||||
if(receive_port==B_BAD_VALUE || receive_port==B_NO_MORE_PORTS)
|
if(receive_port==B_BAD_VALUE || receive_port==B_NO_MORE_PORTS)
|
||||||
@@ -72,10 +76,7 @@ BWindow::BWindow(BRect frame,
|
|||||||
serverlink->Attach(&win,sizeof(BWindow*));
|
serverlink->Attach(&win,sizeof(BWindow*));
|
||||||
serverlink->Flush();
|
serverlink->Flush();
|
||||||
|
|
||||||
fUnused1 = true; // Haven't been Show()n yet. Show() must UnLock().
|
fShowLevel=0; // Hidden to start with.
|
||||||
// Knew I'd find a use for fUnused1 :)
|
|
||||||
|
|
||||||
fShowLevel = 0; // Hidden to start with.
|
|
||||||
|
|
||||||
// We create our serverlink utilizing our application's server port
|
// We create our serverlink utilizing our application's server port
|
||||||
// because the server's ServerApp will handle window creation
|
// because the server's ServerApp will handle window creation
|
||||||
@@ -93,20 +94,17 @@ BWindow::BWindow(BRect frame,
|
|||||||
serverlink->Attach((int32)flags);
|
serverlink->Attach((int32)flags);
|
||||||
serverlink->Attach(&receive_port,sizeof(port_id));
|
serverlink->Attach(&receive_port,sizeof(port_id));
|
||||||
serverlink->Attach((int32)workspace);
|
serverlink->Attach((int32)workspace);
|
||||||
|
if(fTitle)
|
||||||
serverlink->Attach(fTitle,sizeof(fTitle));
|
serverlink->Attach(fTitle,sizeof(fTitle));
|
||||||
|
else
|
||||||
|
serverlink->Attach(0L);
|
||||||
|
|
||||||
// Send and wait for ServerWindow port. Necessary here so we can respond to
|
// Send and wait for ServerWindow port. Necessary here so we can respond to
|
||||||
// messages as soon as Show() is called.
|
// messages as soon as Show() is called.
|
||||||
|
PortLink::ReplyData replydata;
|
||||||
int32 replycode;
|
serverlink->FlushWithReply(&replydata);
|
||||||
status_t replystat;
|
send_port=*((port_id*)replydata.buffer);
|
||||||
ssize_t replysize;
|
|
||||||
int8 *replybuffer;
|
|
||||||
replybuffer=serverlink->FlushWithReply(&replycode,&replystat,&replysize);
|
|
||||||
send_port=*((port_id*)replybuffer);
|
|
||||||
serverlink->SetPort(send_port);
|
serverlink->SetPort(send_port);
|
||||||
delete replybuffer;
|
|
||||||
serverlink->Flush();
|
|
||||||
|
|
||||||
top_view=new BView(frame.OffsetToCopy(0,0),"top_view",B_FOLLOW_ALL, B_WILL_DRAW);
|
top_view=new BView(frame.OffsetToCopy(0,0),"top_view",B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
top_view->owner=this;
|
top_view->owner=this;
|
||||||
@@ -116,7 +114,7 @@ BWindow::BWindow(BRect frame,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Not sure what to do here
|
// We've got some serious problems. uh-oh...
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -130,14 +128,17 @@ BWindow::BWindow(BRect frame,
|
|||||||
{
|
{
|
||||||
Lock();
|
Lock();
|
||||||
fFrame = frame;
|
fFrame = frame;
|
||||||
SetTitle(title);
|
if(title)
|
||||||
SetLook(look);
|
{
|
||||||
SetFeel(feel);
|
fTitle=new char[strlen(title)];
|
||||||
SetFlags(flags);
|
strcpy(fTitle,title);
|
||||||
SetWorkspaces(workspace);
|
}
|
||||||
|
else
|
||||||
|
fTitle=NULL;
|
||||||
|
fFlags=flags;
|
||||||
|
fLook=look;
|
||||||
|
fFeel=feel;
|
||||||
|
|
||||||
// MESSAGING STUFF - Adapted from DarkWyrms proto6 code
|
|
||||||
// Names changed to match <Window.h>
|
|
||||||
// Create a port on which to listen to messages
|
// Create a port on which to listen to messages
|
||||||
receive_port=create_port(50,"msgport");
|
receive_port=create_port(50,"msgport");
|
||||||
if(receive_port==B_BAD_VALUE || receive_port==B_NO_MORE_PORTS)
|
if(receive_port==B_BAD_VALUE || receive_port==B_NO_MORE_PORTS)
|
||||||
@@ -150,9 +151,6 @@ BWindow::BWindow(BRect frame,
|
|||||||
serverlink->Attach(&win,sizeof(BWindow*));
|
serverlink->Attach(&win,sizeof(BWindow*));
|
||||||
serverlink->Flush();
|
serverlink->Flush();
|
||||||
|
|
||||||
fUnused1 = true; // Haven't been Show()n yet. Show() must UnLock().
|
|
||||||
// Knew I'd find a use for fUnused1 :)
|
|
||||||
|
|
||||||
fShowLevel = 0; // Hidden to start with.
|
fShowLevel = 0; // Hidden to start with.
|
||||||
|
|
||||||
// We create our serverlink utilizing our application's server port
|
// We create our serverlink utilizing our application's server port
|
||||||
@@ -171,20 +169,17 @@ BWindow::BWindow(BRect frame,
|
|||||||
serverlink->Attach((int32)flags);
|
serverlink->Attach((int32)flags);
|
||||||
serverlink->Attach(&receive_port,sizeof(port_id));
|
serverlink->Attach(&receive_port,sizeof(port_id));
|
||||||
serverlink->Attach((int32)workspace);
|
serverlink->Attach((int32)workspace);
|
||||||
|
if(fTitle)
|
||||||
serverlink->Attach(fTitle,sizeof(fTitle));
|
serverlink->Attach(fTitle,sizeof(fTitle));
|
||||||
|
else
|
||||||
|
serverlink->Attach(0L);
|
||||||
|
|
||||||
// Send and wait for ServerWindow port. Necessary here so we can respond to
|
// Send and wait for ServerWindow port. Necessary here so we can respond to
|
||||||
// messages as soon as Show() is called.
|
// messages as soon as Show() is called.
|
||||||
|
PortLink::ReplyData replydata;
|
||||||
int32 replycode;
|
serverlink->FlushWithReply(&replydata);
|
||||||
status_t replystat;
|
send_port=*((port_id*)replydata.buffer);
|
||||||
ssize_t replysize;
|
|
||||||
int8 *replybuffer;
|
|
||||||
replybuffer=serverlink->FlushWithReply(&replycode,&replystat,&replysize);
|
|
||||||
send_port=*((port_id*)replybuffer);
|
|
||||||
serverlink->SetPort(send_port);
|
serverlink->SetPort(send_port);
|
||||||
delete replybuffer;
|
|
||||||
serverlink->Flush();
|
|
||||||
|
|
||||||
top_view=new BView(frame.OffsetToCopy(0,0),"top_view",B_FOLLOW_ALL, B_WILL_DRAW);
|
top_view=new BView(frame.OffsetToCopy(0,0),"top_view",B_FOLLOW_ALL, B_WILL_DRAW);
|
||||||
top_view->owner=this;
|
top_view->owner=this;
|
||||||
@@ -194,7 +189,7 @@ BWindow::BWindow(BRect frame,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Not sure what to do here
|
// We've got some serious problems. uh-oh...
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user