From 466871cc9312e373b9fa698cd1e28587b06702f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 13 Nov 2005 20:05:42 +0000 Subject: [PATCH] Implemented GetBitmap() - only client side, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14904 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/PrivateScreen.cpp | 32 ++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/kits/interface/PrivateScreen.cpp b/src/kits/interface/PrivateScreen.cpp index 033d96c555..c20bf7cde6 100644 --- a/src/kits/interface/PrivateScreen.cpp +++ b/src/kits/interface/PrivateScreen.cpp @@ -24,15 +24,17 @@ // Description: BPrivateScreen is the class which does the real work // for the proxy class BScreen (it interacts with the app server). //------------------------------------------------------------------------------ +#include "AppServerLink.h" +#include "PrivateScreen.h" +#include "ServerProtocol.h" + #include #include #include -#include +#include -#include "AppServerLink.h" -#include "PrivateScreen.h" -#include "ServerProtocol.h" +#include // TODO: We should define this somewhere else @@ -197,13 +199,25 @@ BPrivateScreen::ColorMap() status_t -BPrivateScreen::GetBitmap(BBitmap **bitmap, bool drawCursor, BRect *bound) +BPrivateScreen::GetBitmap(BBitmap **_bitmap, bool drawCursor, BRect *bounds) { - if (bitmap == NULL) + if (_bitmap == NULL) return B_BAD_VALUE; - - // TODO: Implement - return B_ERROR; + + BBitmap* bitmap = new (std::nothrow) BBitmap(Frame(), ColorSpace()); + if (bitmap == NULL) + return B_NO_MEMORY; + + status_t status = bitmap->InitCheck(); + if (status == B_OK) + status = ReadBitmap(bitmap, drawCursor, bounds); + if (status != B_OK) { + delete bitmap; + return status; + } + + *_bitmap = bitmap; + return B_OK; }