Stephan already implemented the needed support for dpms stuff too, so why not implementing the client methods too?
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13274 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -142,6 +142,10 @@ enum {
|
||||
|
||||
AS_GET_RETRACE_SEMAPHORE,
|
||||
AS_GET_ACCELERANT_INFO,
|
||||
|
||||
AS_SET_DPMS,
|
||||
AS_GET_DPMS_STATE,
|
||||
AS_GET_DPMS_CAPABILITIES,
|
||||
|
||||
// Global function call defs
|
||||
AS_SET_UI_COLORS,
|
||||
|
||||
@@ -390,6 +390,9 @@ BPrivateScreen::GetPixelClockLimits(display_mode *mode, uint32 *low, uint32 *hig
|
||||
status_t
|
||||
BPrivateScreen::GetTimingConstraints(display_timing_constraints *dtc)
|
||||
{
|
||||
if (dtc == NULL)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
BPrivate::AppServerLink link;
|
||||
link.StartMessage(AS_GET_TIMING_CONSTRAINTS);
|
||||
link.Attach<screen_id>(ID());
|
||||
@@ -407,33 +410,30 @@ BPrivateScreen::GetTimingConstraints(display_timing_constraints *dtc)
|
||||
status_t
|
||||
BPrivateScreen::SetDPMS(uint32 dpmsState)
|
||||
{
|
||||
status_t status = B_ERROR;
|
||||
/*
|
||||
BPrivate::AppServerLink link;
|
||||
PortMessage reply;
|
||||
link.SetOpCode(AS_SET_DPMS);
|
||||
link.StartMessage(AS_SET_DPMS);
|
||||
link.Attach<screen_id>(ID());
|
||||
link.Attach<uint32>(dpmsState);
|
||||
link.FlushWithReply(&reply);
|
||||
reply.Read<status_t>(&status);
|
||||
*/
|
||||
return status;
|
||||
int32 reply;
|
||||
if (link.FlushWithReply(reply) == B_OK && reply == SERVER_TRUE)
|
||||
return B_OK;
|
||||
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
uint32
|
||||
BPrivateScreen::DPMSState()
|
||||
{
|
||||
// TODO: Implement
|
||||
uint32 state = 0;
|
||||
/*
|
||||
|
||||
BPrivate::AppServerLink link;
|
||||
PortMessage reply;
|
||||
link.SetOpCode(AS_GET_DPMS_STATE);
|
||||
link.StartMessage(AS_GET_DPMS_STATE);
|
||||
link.Attach<screen_id>(ID());
|
||||
link.FlushWithReply(&reply);
|
||||
reply.Read<uint32>(&state);
|
||||
*/
|
||||
int32 reply;
|
||||
if (link.FlushWithReply(reply) == B_OK && reply == SERVER_TRUE)
|
||||
link.Read<uint32>(&state);
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -441,16 +441,15 @@ BPrivateScreen::DPMSState()
|
||||
uint32
|
||||
BPrivateScreen::DPMSCapabilites()
|
||||
{
|
||||
// TODO: Implement
|
||||
uint32 capabilities = 0;
|
||||
/*
|
||||
|
||||
BPrivate::AppServerLink link;
|
||||
PortMessage reply;
|
||||
link.SetOpCode(AS_GET_DPMS_CAPABILITIES);
|
||||
link.StartMessage(AS_GET_DPMS_CAPABILITIES);
|
||||
link.Attach<screen_id>(ID());
|
||||
link.FlushWithReply(&reply);
|
||||
reply.Read<uint32>(&capabilities);
|
||||
*/
|
||||
int32 reply;
|
||||
if (link.FlushWithReply(reply) == B_OK && reply == SERVER_TRUE)
|
||||
link.Read<uint32>(&capabilities);
|
||||
|
||||
return capabilities;
|
||||
}
|
||||
|
||||
|
||||
@@ -2047,6 +2047,53 @@ status_t ret = B_ERROR;
|
||||
break;
|
||||
}
|
||||
|
||||
case AS_SET_DPMS:
|
||||
{
|
||||
STRACE(("ServerApp %s: AS_SET_DPMS\n", fSignature.String()));
|
||||
screen_id id;
|
||||
link.Read<screen_id>(&id);
|
||||
|
||||
uint32 mode;
|
||||
link.Read<uint32>(&mode);
|
||||
|
||||
if (gDesktop->GetHWInterface()->SetDPMSMode(mode) == B_OK)
|
||||
fLink.StartMessage(SERVER_TRUE);
|
||||
else
|
||||
fLink.StartMessage(SERVER_FALSE);
|
||||
|
||||
fLink.Flush();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AS_GET_DPMS_STATE:
|
||||
{
|
||||
STRACE(("ServerApp %s: AS_GET_DPMS_STATE\n", fSignature.String()));
|
||||
|
||||
screen_id id;
|
||||
link.Read<screen_id>(&id);
|
||||
|
||||
uint32 state = gDesktop->GetHWInterface()->DPMSMode();
|
||||
fLink.StartMessage(SERVER_TRUE);
|
||||
fLink.Attach<uint32>(state);
|
||||
fLink.Flush();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case AS_GET_DPMS_CAPABILITIES:
|
||||
{
|
||||
STRACE(("ServerApp %s: AS_GET_DPMS_CAPABILITIES\n", fSignature.String()));
|
||||
screen_id id;
|
||||
link.Read<screen_id>(&id);
|
||||
|
||||
uint32 capabilities = gDesktop->GetHWInterface()->DPMSCapabilities();
|
||||
fLink.StartMessage(SERVER_TRUE);
|
||||
fLink.Attach<uint32>(capabilities);
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
printf("ServerApp %s received unhandled message code offset %s\n",
|
||||
fSignature.String(), MsgCodeToBString(code).String());
|
||||
|
||||
Reference in New Issue
Block a user