Re-enabled private SysCursor API and fixed build

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12753 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2005-05-21 12:50:04 +00:00
parent dfb10be5f9
commit ab83a5c4e0
2 changed files with 14 additions and 12 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ Preference Appearance :
FontMenu.cpp FontMenu.cpp
MenuView.cpp MenuView.cpp
PreviewDriver.cpp PreviewDriver.cpp
# SysCursorAPI.cpp SysCursorAPI.cpp
ColorWell.cpp ColorWell.cpp
ColorWhichItem.cpp ColorWhichItem.cpp
CursorWhichItem.cpp CursorWhichItem.cpp
+11 -9
View File
@@ -1,10 +1,9 @@
#include <PortLink.h> #include <PortLink.h>
#include <PortMessage.h>
#include <ServerProtocol.h> #include <ServerProtocol.h>
#include <OS.h> #include <OS.h>
#include "SysCursorAPI.h" #include "SysCursorAPI.h"
// TODO: tweak the BBitmap and BCursor headers // TODO R2: tweak the BBitmap and BCursor headers
void set_syscursor(cursor_which which, const BCursor *cursor) void set_syscursor(cursor_which which, const BCursor *cursor)
{ {
@@ -39,16 +38,19 @@ cursor_which get_syscursor(void)
port_id server=find_port(SERVER_PORT_NAME); port_id server=find_port(SERVER_PORT_NAME);
if(server!=B_NAME_NOT_FOUND) if(server!=B_NAME_NOT_FOUND)
{ {
PortMessage pmsg; int32 code;
BPortLink link(server);
PortLink link(server); link.StartMessage(AS_GET_SYSCURSOR);
link.SetOpCode(AS_GET_SYSCURSOR); link.GetNextReply(&code);
link.FlushWithReply(&pmsg);
if(code==SERVER_TRUE)
{
cursor_which which; cursor_which which;
pmsg.Read<cursor_which>(&which); link.Read<cursor_which>(&which);
return which; return which;
} }
}
return B_CURSOR_INVALID; return B_CURSOR_INVALID;
} }
@@ -57,8 +59,8 @@ void setcursor(cursor_which which)
port_id server=find_port(SERVER_PORT_NAME); port_id server=find_port(SERVER_PORT_NAME);
if(server!=B_NAME_NOT_FOUND) if(server!=B_NAME_NOT_FOUND)
{ {
PortLink link(server); BPortLink link(server);
link.SetOpCode(AS_SET_CURSOR_SYSTEM); link.StartMessage(AS_SET_CURSOR_SYSTEM);
link.Flush(); link.Flush();
} }
} }