more BScreen related stuff
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13270 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -133,14 +133,16 @@ enum {
|
|||||||
AS_PROPOSE_MODE,
|
AS_PROPOSE_MODE,
|
||||||
AS_GET_MODE_LIST,
|
AS_GET_MODE_LIST,
|
||||||
|
|
||||||
AS_SCREEN_GET_COLORMAP,
|
AS_GET_PIXEL_CLOCK_LIMITS,
|
||||||
|
AS_GET_TIMING_CONSTRAINTS,
|
||||||
|
|
||||||
|
AS_SCREEN_GET_COLORMAP,
|
||||||
AS_GET_DESKTOP_COLOR,
|
AS_GET_DESKTOP_COLOR,
|
||||||
AS_SET_DESKTOP_COLOR,
|
AS_SET_DESKTOP_COLOR,
|
||||||
|
|
||||||
AS_GET_RETRACE_SEMAPHORE,
|
AS_GET_RETRACE_SEMAPHORE,
|
||||||
AS_GET_ACCELERANT_INFO,
|
AS_GET_ACCELERANT_INFO,
|
||||||
|
|
||||||
// Global function call defs
|
// Global function call defs
|
||||||
AS_SET_UI_COLORS,
|
AS_SET_UI_COLORS,
|
||||||
AS_GET_UI_COLORS,
|
AS_GET_UI_COLORS,
|
||||||
|
|||||||
@@ -152,24 +152,6 @@ BPrivateScreen::WaitForRetrace(bigtime_t timeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sem_id
|
|
||||||
BPrivateScreen::RetraceSemaphore()
|
|
||||||
{
|
|
||||||
sem_id id = B_BAD_SEM_ID;
|
|
||||||
|
|
||||||
BPrivate::AppServerLink link;
|
|
||||||
link.StartMessage(AS_GET_RETRACE_SEMAPHORE);
|
|
||||||
link.Attach<screen_id>(ID());
|
|
||||||
int32 reply;
|
|
||||||
if (link.FlushWithReply(reply) == B_OK
|
|
||||||
&& reply == SERVER_TRUE)
|
|
||||||
link.Read<sem_id>(&id);
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint8
|
uint8
|
||||||
BPrivateScreen::IndexForColor(uint8 red, uint8 green, uint8 blue, uint8 alpha)
|
BPrivateScreen::IndexForColor(uint8 red, uint8 green, uint8 blue, uint8 alpha)
|
||||||
{
|
{
|
||||||
@@ -385,7 +367,22 @@ BPrivateScreen::GetDeviceInfo(accelerant_device_info *info)
|
|||||||
status_t
|
status_t
|
||||||
BPrivateScreen::GetPixelClockLimits(display_mode *mode, uint32 *low, uint32 *high)
|
BPrivateScreen::GetPixelClockLimits(display_mode *mode, uint32 *low, uint32 *high)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
if (mode == NULL || low == NULL || high == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
BPrivate::AppServerLink link;
|
||||||
|
link.StartMessage(AS_GET_PIXEL_CLOCK_LIMITS);
|
||||||
|
link.Attach<screen_id>(ID());
|
||||||
|
link.Attach<display_mode>(*mode);
|
||||||
|
|
||||||
|
int32 code;
|
||||||
|
if (link.FlushWithReply(code) == B_OK && code == SERVER_TRUE) {
|
||||||
|
link.Read<uint32>(low);
|
||||||
|
link.Read<uint32>(high);
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,7 +390,16 @@ BPrivateScreen::GetPixelClockLimits(display_mode *mode, uint32 *low, uint32 *hig
|
|||||||
status_t
|
status_t
|
||||||
BPrivateScreen::GetTimingConstraints(display_timing_constraints *dtc)
|
BPrivateScreen::GetTimingConstraints(display_timing_constraints *dtc)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
BPrivate::AppServerLink link;
|
||||||
|
link.StartMessage(AS_GET_TIMING_CONSTRAINTS);
|
||||||
|
link.Attach<screen_id>(ID());
|
||||||
|
|
||||||
|
int32 code;
|
||||||
|
if (link.FlushWithReply(code) == B_OK && code == SERVER_TRUE) {
|
||||||
|
link.Read<display_timing_constraints>(dtc);
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -487,6 +493,24 @@ BPrivateScreen::get_screen_desc(screen_desc *desc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// private methods
|
||||||
|
sem_id
|
||||||
|
BPrivateScreen::RetraceSemaphore()
|
||||||
|
{
|
||||||
|
sem_id id = B_BAD_SEM_ID;
|
||||||
|
|
||||||
|
BPrivate::AppServerLink link;
|
||||||
|
link.StartMessage(AS_GET_RETRACE_SEMAPHORE);
|
||||||
|
link.Attach<screen_id>(ID());
|
||||||
|
int32 reply;
|
||||||
|
if (link.FlushWithReply(reply) == B_OK
|
||||||
|
&& reply == SERVER_TRUE)
|
||||||
|
link.Read<sem_id>(&id);
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BPrivateScreen::BPrivateScreen()
|
BPrivateScreen::BPrivateScreen()
|
||||||
:
|
:
|
||||||
fColorMap(NULL),
|
fColorMap(NULL),
|
||||||
|
|||||||
@@ -2006,7 +2006,47 @@ status_t ret = B_ERROR;
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case AS_GET_TIMING_CONSTRAINTS:
|
||||||
|
{
|
||||||
|
STRACE(("ServerApp %s: get timing constraints\n", fSignature.String()));
|
||||||
|
// We aren't using the screen_id for now...
|
||||||
|
screen_id id;
|
||||||
|
link.Read<screen_id>(&id);
|
||||||
|
display_timing_constraints constraints;
|
||||||
|
if (gDesktop->GetHWInterface()->GetTimingConstraints(&constraints) == B_OK) {
|
||||||
|
fLink.StartMessage(SERVER_TRUE);
|
||||||
|
fLink.Attach<display_timing_constraints>(constraints);
|
||||||
|
} else
|
||||||
|
fLink.StartMessage(SERVER_FALSE);
|
||||||
|
|
||||||
|
fLink.Flush();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case AS_GET_PIXEL_CLOCK_LIMITS:
|
||||||
|
{
|
||||||
|
STRACE(("ServerApp %s: get pixel clock limits\n", fSignature.String()));
|
||||||
|
// We aren't using the screen_id for now...
|
||||||
|
screen_id id;
|
||||||
|
link.Read<screen_id>(&id);
|
||||||
|
display_mode mode;
|
||||||
|
link.Read<display_mode>(&mode);
|
||||||
|
|
||||||
|
uint32 low, high;
|
||||||
|
if (gDesktop->GetHWInterface()->GetPixelClockLimits(&mode, &low, &high) == B_OK) {
|
||||||
|
fLink.StartMessage(SERVER_TRUE);
|
||||||
|
fLink.Attach<uint32>(low);
|
||||||
|
fLink.Attach<uint32>(high);
|
||||||
|
} else
|
||||||
|
fLink.StartMessage(SERVER_FALSE);
|
||||||
|
|
||||||
|
fLink.Flush();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("ServerApp %s received unhandled message code offset %s\n",
|
printf("ServerApp %s received unhandled message code offset %s\n",
|
||||||
fSignature.String(), MsgCodeToBString(code).String());
|
fSignature.String(), MsgCodeToBString(code).String());
|
||||||
|
|||||||
Reference in New Issue
Block a user