BScreen's GetMode(), Frame() and ColorSpace() should work now.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12511 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-04-29 20:32:05 +00:00
parent 718c1fc525
commit 34c39bf046
+12 -15
View File
@@ -28,11 +28,9 @@
#include <Window.h> #include <Window.h>
#include <stdlib.h> #include <stdlib.h>
#include "AppServerLink.h"
#include "PrivateScreen.h" #include "PrivateScreen.h"
#include "ServerProtocol.h"
// TODO: As you'll have seen, we sometimes include the screen_id to the app server
// request, sometimes not. I think the screen_id is not needed if we send the workspace
// index.
// TODO: We should define this somewhere else // TODO: We should define this somewhere else
@@ -105,7 +103,7 @@ BPrivateScreen::Frame()
// If something goes wrong, we just return this rectangle. // If something goes wrong, we just return this rectangle.
BRect rect(0, 0, 0, 0); BRect rect(0, 0, 0, 0);
display_mode mode; display_mode mode;
if (GetMode(B_ALL_WORKSPACES, &mode) == B_OK) if (GetMode(B_CURRENT_WORKSPACE, &mode) == B_OK)
rect.Set(0, 0, (float)mode.virtual_width - 1, (float)mode.virtual_height - 1); rect.Set(0, 0, (float)mode.virtual_width - 1, (float)mode.virtual_height - 1);
return rect; return rect;
@@ -265,21 +263,20 @@ BPrivateScreen::GetModeList(display_mode **mode_list, uint32 *count)
status_t status_t
BPrivateScreen::GetMode(uint32 workspace, display_mode *mode) BPrivateScreen::GetMode(uint32 workspace, display_mode *mode)
{ {
// TODO: Implement
status_t status = B_ERROR;
/*
BAppServerLink link; BAppServerLink link;
PortMessage reply; link.StartMessage(AS_SCREEN_GET_MODE);
display_mode currentMode; link.Attach<screen_id>(ID());
link.SetOpCode(AS_GET_MODE);
link.Attach<uint32>(workspace); link.Attach<uint32>(workspace);
link.Flush();
link.FlushWithReply(&reply); display_mode currentMode;
reply.Read<display_mode>(&currentMode); link.Read<display_mode>(&currentMode);
reply.Read<status_t>(&status);
status_t status = B_ERROR;
link.Read<status_t>(&status);
if (status == B_OK && mode) if (status == B_OK && mode)
*mode = currentMode; *mode = currentMode;
*/
return status; return status;
} }