Implemented Screen::SetMode

Added Workspace::SetSpace
Removal of old, commented-out server emu code in ScreenDriver
Tweaks to ServerProtocol and ServerConfig to have all BApplication messages, main server port name
AppServer now works fully at prototype #3 level - really cool with ScreenDriver!


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2814 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2003-02-23 21:40:44 +00:00
parent 16d1f45f81
commit c26d77e634
9 changed files with 74 additions and 246 deletions
+2 -228
View File
@@ -183,166 +183,7 @@ void FrameBuffer::MessageReceived(BMessage *msg)
write_port(serverport,B_QUIT_REQUESTED,NULL,0);
break;
}
/*
#ifdef ENABLE_INPUT_SERVER_EMULATION
case 0x57: // up arrow
{
// Attach data:
// 1) int64 - time of mouse click
// 2) float - x coordinate of mouse click
// 3) float - y coordinate of mouse click
// 4) int32 - modifier keys down
// 5) int32 - buttons down
// 6) int32 - clicks
if(mousepos.y<=0)
{
mousepos.y=0;
break;
}
uint32 clicks=1; // can't get the # of clicks without a *lot* of extra work :(
int64 time=(int64)real_time_clock();
if(modifiers & B_SHIFT_KEY)
mousepos.y--;
else
{
mousepos.y-=10;
if(mousepos.y<0)
mousepos.y=0;
}
serverlink->SetOpCode(B_MOUSE_MOVED);
serverlink->Attach(&time, sizeof(int64));
serverlink->Attach(&mousepos.x,sizeof(float));
serverlink->Attach(&mousepos.y,sizeof(float));
serverlink->Attach(&servermods, sizeof(int32));
serverlink->Attach(&buttons, sizeof(uint32));
serverlink->Attach(&clicks, sizeof(uint32));
serverlink->Flush();
break;
}
case 0x62: // down arrow
{
// Attach data:
// 1) int64 - time of mouse click
// 2) float - x coordinate of mouse click
// 3) float - y coordinate of mouse click
// 4) int32 - modifier keys down
// 5) int32 - buttons down
// 6) int32 - clicks
if(mousepos.y>= (gcinfo.height-1))
{
mousepos.y=gcinfo.height-1;
break;
}
uint32 clicks=1; // can't get the # of clicks without a *lot* of extra work :(
int64 time=(int64)real_time_clock();
if(modifiers & B_SHIFT_KEY)
mousepos.y++;
else
{
mousepos.y+=10;
if(mousepos.y>gcinfo.height-1)
mousepos.y=gcinfo.height-1;
}
serverlink->SetOpCode(B_MOUSE_MOVED);
serverlink->Attach(&time, sizeof(int64));
serverlink->Attach(&mousepos.x,sizeof(float));
serverlink->Attach(&mousepos.y,sizeof(float));
serverlink->Attach(&servermods, sizeof(int32));
serverlink->Attach(&buttons, sizeof(uint32));
serverlink->Attach(&clicks, sizeof(uint32));
serverlink->Flush();
break;
}
case 0x61: // left arrow
{
// Attach data:
// 1) int64 - time of mouse click
// 2) float - x coordinate of mouse click
// 3) float - y coordinate of mouse click
// 4) int32 - modifier keys down
// 5) int32 - buttons down
// 6) int32 - clicks
if(mousepos.x<=0)
{
mousepos.x=0;
break;
}
uint32 clicks=1; // can't get the # of clicks without a *lot* of extra work :(
int64 time=(int64)real_time_clock();
if(modifiers & B_SHIFT_KEY)
mousepos.x--;
else
{
mousepos.x-=10;
if(mousepos.x<0)
mousepos.x=0;
}
serverlink->SetOpCode(B_MOUSE_MOVED);
serverlink->Attach(&time, sizeof(int64));
serverlink->Attach(&mousepos.x,sizeof(float));
serverlink->Attach(&mousepos.y,sizeof(float));
serverlink->Attach(&servermods, sizeof(int32));
serverlink->Attach(&buttons, sizeof(uint32));
serverlink->Attach(&clicks, sizeof(uint32));
serverlink->Flush();
break;
}
case 0x63: // right arrow
{
// Attach data:
// 1) int64 - time of mouse click
// 2) float - x coordinate of mouse click
// 3) float - y coordinate of mouse click
// 4) int32 - modifier keys down
// 5) int32 - buttons down
// 6) int32 - clicks
if(mousepos.x>= (gcinfo.width-1))
{
mousepos.x=gcinfo.width-1;
break;
}
uint32 clicks=1; // can't get the # of clicks without a *lot* of extra work :(
int64 time=(int64)real_time_clock();
if(modifiers & B_SHIFT_KEY)
mousepos.x++;
else
{
mousepos.x+=10;
if(mousepos.x>gcinfo.width-1)
mousepos.x=gcinfo.width-1;
}
serverlink->SetOpCode(B_MOUSE_MOVED);
serverlink->Attach(&time, sizeof(int64));
serverlink->Attach(&mousepos.x,sizeof(float));
serverlink->Attach(&mousepos.y,sizeof(float));
serverlink->Attach(&servermods, sizeof(int32));
serverlink->Attach(&buttons, sizeof(uint32));
serverlink->Attach(&clicks, sizeof(uint32));
serverlink->Flush();
break;
}
#endif // end server emu code
*/ default:
default:
break;
}
}
@@ -362,74 +203,7 @@ void FrameBuffer::MessageReceived(BMessage *msg)
break;
}
#endif
/* case B_MODIFIERS_CHANGED:
{
int32 modifiers;
if(msg->FindInt32("modifiers",&modifiers)==B_OK)
{
#ifdef ENABLE_INPUT_SERVER_EMULATION
uint32 clicks=1; // can't get the # of clicks without a *lot* of extra work :(
int64 time=(int64)real_time_clock();
// we need to be able to shift click & such, so we will construct
// a new modifiers value which excludes our mouse click keys
int32 servermods=0;
servermods|=modifiers & B_RIGHT_COMMAND_KEY;
servermods|=modifiers & B_RIGHT_OPTION_KEY;
servermods|=modifiers & B_RIGHT_CONTROL_KEY;
servermods|=modifiers & B_SHIFT_KEY;
if(modifiers & B_LEFT_OPTION_KEY)
{
buttons=B_PRIMARY_MOUSE_BUTTON;
serverlink->SetOpCode(B_MOUSE_DOWN);
serverlink->Attach(&time, sizeof(int64));
serverlink->Attach(&mousepos.x,sizeof(float));
serverlink->Attach(&mousepos.y,sizeof(float));
serverlink->Attach(&servermods, sizeof(uint32));
serverlink->Attach(&buttons, sizeof(uint32));
serverlink->Attach(&clicks, sizeof(uint32));
serverlink->Flush();
}
else
if(modifiers & B_LEFT_CONTROL_KEY)
{
buttons=B_SECONDARY_MOUSE_BUTTON;
serverlink->SetOpCode(B_MOUSE_DOWN);
serverlink->Attach(&time, sizeof(int64));
serverlink->Attach(&mousepos.x,sizeof(float));
serverlink->Attach(&mousepos.y,sizeof(float));
serverlink->Attach(&servermods, sizeof(uint32));
serverlink->Attach(&buttons, sizeof(uint32));
serverlink->Attach(&clicks, sizeof(uint32));
serverlink->Flush();
}
else
{
// well, we got this far so none of the buttons
// are down. set our mouse buttons to up and if this
// is a change, send a B_MOUSE_UP message
if(buttons>0)
{
serverlink->SetOpCode(B_MOUSE_UP);
serverlink->Attach(&time, sizeof(int64));
serverlink->Attach(&mousepos.x,sizeof(float));
serverlink->Attach(&mousepos.y,sizeof(float));
serverlink->Attach(&servermods, sizeof(uint32));
serverlink->Flush();
}
buttons=0;
}
#endif // end server emu code
}
break;
}
*/ default:
default:
BWindowScreen::MessageReceived(msg);
}
}