From 314a1024466022744b0d0936be034cfa12fec86d Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sun, 1 May 2005 06:25:50 +0000 Subject: [PATCH] Implemented BPrivateScreen::SetMode() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12522 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/PrivateScreen.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/kits/interface/PrivateScreen.cpp b/src/kits/interface/PrivateScreen.cpp index fa50198aba..efe0942763 100644 --- a/src/kits/interface/PrivateScreen.cpp +++ b/src/kits/interface/PrivateScreen.cpp @@ -24,8 +24,8 @@ // Description: BPrivateScreen is the class which does the real work // for the proxy class BScreen (it interacts with the app server). //------------------------------------------------------------------------------ - #include + #include #include "AppServerLink.h" @@ -263,6 +263,9 @@ BPrivateScreen::GetModeList(display_mode **mode_list, uint32 *count) status_t BPrivateScreen::GetMode(uint32 workspace, display_mode *mode) { + if (mode == NULL) + return B_BAD_VALUE; + BAppServerLink link; link.StartMessage(AS_SCREEN_GET_MODE); link.Attach(ID()); @@ -289,18 +292,23 @@ BPrivateScreen::GetMode(uint32 workspace, display_mode *mode) status_t BPrivateScreen::SetMode(uint32 workspace, display_mode *mode, bool makeDefault) { - // TODO: Implement - status_t status = B_ERROR; - /* + if (mode == NULL) + return B_BAD_VALUE; + BAppServerLink link; - PortMessage reply; - link.SetOpCode(AS_SET_MODE); + link.StartMessage(AS_SCREEN_SET_MODE); + link.Attach(ID()); link.Attach(workspace); link.Attach(*mode); link.Attach(makeDefault); - link.FlushWithReply(&reply); - reply.Read(&status); - */ + + int32 code = SERVER_FALSE; + link.FlushWithReply(&code); + + status_t status = B_ERROR; + if (code == SERVER_TRUE) + link.Read(&status); + return status; }