Added client side implementation of BDirectWindow (haiku). I hope I didn't break the build on Dano. If it's the case, please tell me.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13842 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -312,6 +312,11 @@ enum {
|
|||||||
AS_LAYER_SET_PATTERN,
|
AS_LAYER_SET_PATTERN,
|
||||||
AS_SET_CURRENT_LAYER,
|
AS_SET_CURRENT_LAYER,
|
||||||
|
|
||||||
|
// BDirectWindow codes
|
||||||
|
AS_DW_GET_SYNC_DATA,
|
||||||
|
AS_DW_SUPPORTS_WINDOW_MODE,
|
||||||
|
AS_DW_SET_FULLSCREEN,
|
||||||
|
|
||||||
// TODO: Move these elsewhere. They don't need to
|
// TODO: Move these elsewhere. They don't need to
|
||||||
// be shared with libbe
|
// be shared with libbe
|
||||||
// app_server internal communication
|
// app_server internal communication
|
||||||
|
|||||||
@@ -17,6 +17,9 @@
|
|||||||
#ifdef COMPILE_FOR_R5
|
#ifdef COMPILE_FOR_R5
|
||||||
#include <R5_AppServerLink.h>
|
#include <R5_AppServerLink.h>
|
||||||
#include <R5_Session.h>
|
#include <R5_Session.h>
|
||||||
|
#define DW_GET_SYNC_DATA 0x880
|
||||||
|
#define DW_SET_FULLSCREEN 0x881
|
||||||
|
#define DW_SUPPORTS_WINDOW_MODE 0xF2C
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Compiling for DANO/Zeta is broken as it doesn't have BRegion::set_size()
|
// Compiling for DANO/Zeta is broken as it doesn't have BRegion::set_size()
|
||||||
@@ -24,6 +27,10 @@
|
|||||||
#warning "##### Building BDirectWindow for TARGET_PLATFORM=dano (DANO/Zeta) is broken #####"
|
#warning "##### Building BDirectWindow for TARGET_PLATFORM=dano (DANO/Zeta) is broken #####"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
#include <AppServerLink.h>
|
||||||
|
#include <ServerProtocol.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO: We'll want to move this to a private header,
|
// TODO: We'll want to move this to a private header,
|
||||||
// accessible by the app server.
|
// accessible by the app server.
|
||||||
@@ -35,13 +42,6 @@ struct dw_sync_data
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// TODO: These commands are used by the BeOS R5 app_server.
|
|
||||||
// Change this when our app_server supports BDirectWindow
|
|
||||||
#define DW_GET_SYNC_DATA 0x880
|
|
||||||
#define DW_SET_FULLSCREEN 0x881
|
|
||||||
#define DW_SUPPORTS_WINDOW_MODE 0xF2C
|
|
||||||
|
|
||||||
|
|
||||||
// We don't need this kind of locking, since the directDeamonFunc
|
// We don't need this kind of locking, since the directDeamonFunc
|
||||||
// doesn't access critical shared data.
|
// doesn't access critical shared data.
|
||||||
#define DW_NEEDS_LOCKING 0
|
#define DW_NEEDS_LOCKING 0
|
||||||
@@ -307,13 +307,23 @@ BDirectWindow::SetFullScreen(bool enable)
|
|||||||
status_t fullScreen;
|
status_t fullScreen;
|
||||||
a_session->sread(sizeof(status_t), &fullScreen);
|
a_session->sread(sizeof(status_t), &fullScreen);
|
||||||
a_session->sread(sizeof(status_t), &status);
|
a_session->sread(sizeof(status_t), &status);
|
||||||
|
full_screen_enable = enable;
|
||||||
|
#endif
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
|
||||||
|
fLink->StartMessage(AS_DW_SET_FULLSCREEN);
|
||||||
|
fLink->Attach<int32>(server_token); // useless ?
|
||||||
|
fLink->Attach<bool>(enable);
|
||||||
|
|
||||||
|
int32 code;
|
||||||
|
if (fLink->FlushWithReply(code) == B_OK
|
||||||
|
&& code == SERVER_TRUE) {
|
||||||
|
status = B_OK;
|
||||||
|
full_screen_enable = enable;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|
||||||
// TODO: Revisit this when we move to our app_server
|
|
||||||
// Currently the full screen/window status is set
|
|
||||||
// even if something goes wrong
|
|
||||||
full_screen_enable = enable;
|
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -329,17 +339,27 @@ BDirectWindow::IsFullScreen() const
|
|||||||
bool
|
bool
|
||||||
BDirectWindow::SupportsWindowMode(screen_id id)
|
BDirectWindow::SupportsWindowMode(screen_id id)
|
||||||
{
|
{
|
||||||
int32 result = 0;
|
|
||||||
|
|
||||||
#ifdef COMPILE_FOR_R5
|
#ifdef COMPILE_FOR_R5
|
||||||
|
int32 result = 0;
|
||||||
_BAppServerLink_ link;
|
_BAppServerLink_ link;
|
||||||
link.fSession->swrite_l(DW_SUPPORTS_WINDOW_MODE);
|
link.fSession->swrite_l(DW_SUPPORTS_WINDOW_MODE);
|
||||||
link.fSession->swrite_l(id.id);
|
link.fSession->swrite_l(id.id);
|
||||||
link.fSession->sync();
|
link.fSession->sync();
|
||||||
link.fSession->sread(sizeof(result), &result);
|
link.fSession->sread(sizeof(result), &result);
|
||||||
|
return result & true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return result & true;
|
#ifdef __HAIKU__
|
||||||
|
BPrivate::AppServerLink link;
|
||||||
|
link.StartMessage(AS_DW_SUPPORTS_WINDOW_MODE);
|
||||||
|
link.Attach<screen_id>(id);
|
||||||
|
int32 reply;
|
||||||
|
if (link.FlushWithReply(reply) == B_OK
|
||||||
|
&& reply == SERVER_TRUE)
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -456,6 +476,18 @@ BDirectWindow::InitData()
|
|||||||
a_session->sread(sizeof(status), &status);
|
a_session->sread(sizeof(status), &status);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
fLink->StartMessage(AS_DW_GET_SYNC_DATA);
|
||||||
|
fLink->Attach<int32>(server_token);
|
||||||
|
|
||||||
|
int32 reply;
|
||||||
|
if (fLink->FlushWithReply(reply) == B_OK
|
||||||
|
&& reply == SERVER_TRUE) {
|
||||||
|
fLink->Read<dw_sync_data>(&sync_data);
|
||||||
|
status = B_OK;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
SubDir OBOS_TOP src kits game ;
|
SubDir OBOS_TOP src kits game ;
|
||||||
|
|
||||||
|
UsePrivateHeaders app ;
|
||||||
UsePrivateHeaders interface ;
|
UsePrivateHeaders interface ;
|
||||||
UsePrivateHeaders input ;
|
UsePrivateHeaders input ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user