Implemented BPrivateScreen::ReadBitmap(), but the guts are still missing
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13665 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
#include <Rect.h>
|
#include <Rect.h>
|
||||||
|
|
||||||
|
class BPrivateScreen;
|
||||||
class BWindow;
|
class BWindow;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -92,7 +93,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
friend class BView;
|
friend class BView;
|
||||||
friend class BApplication;
|
friend class BApplication;
|
||||||
friend void _get_screen_bitmap_(BBitmap *, BRect, bool);
|
friend class BPrivateScreen;
|
||||||
|
//friend void _get_screen_bitmap_(BBitmap *, BRect, bool);
|
||||||
|
|
||||||
virtual void _ReservedBitmap1();
|
virtual void _ReservedBitmap1();
|
||||||
virtual void _ReservedBitmap2();
|
virtual void _ReservedBitmap2();
|
||||||
|
|||||||
@@ -150,6 +150,8 @@ enum {
|
|||||||
AS_GET_DESKTOP_COLOR,
|
AS_GET_DESKTOP_COLOR,
|
||||||
AS_SET_DESKTOP_COLOR,
|
AS_SET_DESKTOP_COLOR,
|
||||||
|
|
||||||
|
AS_READ_BITMAP,
|
||||||
|
|
||||||
AS_GET_RETRACE_SEMAPHORE,
|
AS_GET_RETRACE_SEMAPHORE,
|
||||||
AS_GET_ACCELERANT_INFO,
|
AS_GET_ACCELERANT_INFO,
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
// Description: BPrivateScreen is the class which does the real work
|
// Description: BPrivateScreen is the class which does the real work
|
||||||
// for the proxy class BScreen (it interacts with the app server).
|
// for the proxy class BScreen (it interacts with the app server).
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
#include <Bitmap.h>
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
@@ -198,6 +199,9 @@ BPrivateScreen::ColorMap()
|
|||||||
status_t
|
status_t
|
||||||
BPrivateScreen::GetBitmap(BBitmap **bitmap, bool drawCursor, BRect *bound)
|
BPrivateScreen::GetBitmap(BBitmap **bitmap, bool drawCursor, BRect *bound)
|
||||||
{
|
{
|
||||||
|
if (bitmap == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
@@ -206,8 +210,26 @@ BPrivateScreen::GetBitmap(BBitmap **bitmap, bool drawCursor, BRect *bound)
|
|||||||
status_t
|
status_t
|
||||||
BPrivateScreen::ReadBitmap(BBitmap *bitmap, bool drawCursor, BRect *bound)
|
BPrivateScreen::ReadBitmap(BBitmap *bitmap, bool drawCursor, BRect *bound)
|
||||||
{
|
{
|
||||||
// TODO: Implement
|
if (bitmap == NULL)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
BRect rect;
|
||||||
|
if (bound != NULL)
|
||||||
|
rect = *bound;
|
||||||
|
else
|
||||||
|
rect = Frame();
|
||||||
|
|
||||||
|
BPrivate::AppServerLink link;
|
||||||
|
link.StartMessage(AS_READ_BITMAP);
|
||||||
|
link.Attach<int32>(bitmap->get_server_token());
|
||||||
|
link.Attach<bool>(drawCursor);
|
||||||
|
link.Attach<BRect>(rect);
|
||||||
|
|
||||||
|
int32 code;
|
||||||
|
if (link.FlushWithReply(code) < B_OK || code != SERVER_TRUE)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2160,6 +2160,30 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case AS_READ_BITMAP:
|
||||||
|
{
|
||||||
|
STRACE(("ServerApp %s: AS_READ_BITMAP\n", Signature()));
|
||||||
|
int32 bitmapToken;
|
||||||
|
link.Read<int32>(&bitmapToken);
|
||||||
|
|
||||||
|
bool drawCursor = true;
|
||||||
|
link.Read<bool>(&drawCursor);
|
||||||
|
|
||||||
|
BRect bounds;
|
||||||
|
link.Read<BRect>(&bounds);
|
||||||
|
|
||||||
|
ServerBitmap *bitmap = FindBitmap(bitmapToken);
|
||||||
|
if (bitmap != NULL) {
|
||||||
|
fLink.StartMessage(SERVER_TRUE);
|
||||||
|
// TODO: Implement for real
|
||||||
|
} 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",
|
||||||
Signature(), MsgCodeToBString(code).String());
|
Signature(), MsgCodeToBString(code).String());
|
||||||
|
|||||||
Reference in New Issue
Block a user