Implemented IsCursorHidden

Removed PortLink usage where unnecessary


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2813 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2003-02-23 21:31:58 +00:00
parent 99ddcf1a1b
commit 16d1f45f81

View File

@ -370,18 +370,16 @@ BHandler* BApplication::ResolveSpecifier(BMessage* msg, int32 index,
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BApplication::ShowCursor() void BApplication::ShowCursor()
{ {
PortLink *link=new PortLink(fServerTo); // Because we're just sending an opcode, we can skip the PortLink and simply
link->SetOpCode(SHOW_CURSOR); // call write_port top the server communications port.
link->Flush(); write_port(fServerTo,SHOW_CURSOR,NULL,0);
delete link;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BApplication::HideCursor() void BApplication::HideCursor()
{ {
PortLink *link=new PortLink(fServerTo); // Because we're just sending an opcode, we can skip the PortLink and simply
link->SetOpCode(HIDE_CURSOR); // call write_port top the server communications port.
link->Flush(); write_port(fServerTo,HIDE_CURSOR,NULL,0);
delete link;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BApplication::ObscureCursor() void BApplication::ObscureCursor()
@ -394,13 +392,14 @@ void BApplication::ObscureCursor()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool BApplication::IsCursorHidden() const bool BApplication::IsCursorHidden() const
{ {
// TODO: talk to app_server PortLink::ReplyData data;
// Requires FlushWithReply(). Waiting until it has been updated. PortLink *link=new PortLink(fServerTo);
// Protocol: Setup link, set opcode to QUERY_CURSOR_HIDDEN and FlushWithReply link->SetOpCode(QUERY_CURSOR_HIDDEN);
// The replied message will be SERVER_TRUE if hidden, SERVER_FALSE if not. --DW link->FlushWithReply(&data);
delete link;
return false; // not implemented return (data.code==SERVER_TRUE)?true:false;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BApplication::SetCursor(const void* cursor) void BApplication::SetCursor(const void* cursor)
@ -757,10 +756,19 @@ void BApplication::InitData(const char* signature, status_t* error)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BApplication::BeginRectTracking(BRect r, bool trackWhole) void BApplication::BeginRectTracking(BRect r, bool trackWhole)
{ {
PortLink *link=new PortLink(fServerTo);
link->SetOpCode(BEGIN_RECT_TRACKING);
link->Attach(r);
link->Attach(trackWhole);
link->Flush();
delete link;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BApplication::EndRectTracking() void BApplication::EndRectTracking()
{ {
// Because we're just sending an opcode, we can skip the PortLink and simply
// call write_port top the server communications port.
write_port(fServerTo,END_RECT_TRACKING,NULL,0);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void BApplication::get_scs() void BApplication::get_scs()