* Renamed direct window commands
* Removed unused cruft from ServerProtocol.h git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15468 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
fc70d6db87
commit
ab6a6bed3a
@ -7,8 +7,8 @@
|
||||
* Jérôme Duval, jerome.duval@free.fr
|
||||
*/
|
||||
|
||||
#ifndef _APPSERVER_PROTOCOL_
|
||||
#define _APPSERVER_PROTOCOL_
|
||||
#ifndef _APP_SERVER_PROTOCOL_H_
|
||||
#define _APP_SERVER_PROTOCOL_H_
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
@ -314,27 +314,11 @@ enum {
|
||||
AS_SET_CURRENT_LAYER,
|
||||
|
||||
// BDirectWindow codes
|
||||
AS_DW_GET_SYNC_DATA,
|
||||
AS_DW_SUPPORTS_WINDOW_MODE,
|
||||
AS_DW_SET_FULLSCREEN,
|
||||
AS_DIRECT_WINDOW_GET_SYNC_DATA,
|
||||
AS_DIRECT_WINDOW_SUPPORTS_WINDOW_MODE,
|
||||
AS_DIRECT_WINDOW_SET_FULLSCREEN,
|
||||
|
||||
AS_LAST_CODE
|
||||
};
|
||||
|
||||
#define AS_PATTERN_SIZE 8
|
||||
#define AS_SET_COLOR_MSG_SIZE 8+4
|
||||
#define AS_STROKE_ARC_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_STROKE_BEZIER_MSG_SIZE 8+8*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_STROKE_ELLIPSE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_STROKE_LINE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_STROKE_RECT_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_STROKE_ROUNDRECT_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_STROKE_TRIANGLE_MSG_SIZE 8+10*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_FILL_ARC_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_FILL_BEZIER_MSG_SIZE 8+8*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_FILL_ELLIPSE_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_FILL_RECT_MSG_SIZE 8+4*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_FILL_ROUNDRECT_MSG_SIZE 8+6*sizeof(float)+AS_PATTERN_SIZE
|
||||
#define AS_FILL_TRIANGLE_MSG_SIZE 8+10*sizeof(float)+AS_PATTERN_SIZE
|
||||
|
||||
#endif
|
||||
#endif // _APP_SERVER_PROTOCOL_H_
|
||||
|
@ -299,16 +299,14 @@ BDirectWindow::SetFullScreen(bool enable)
|
||||
a_session->sread(sizeof(status_t), &status);
|
||||
full_screen_enable = enable;
|
||||
#else
|
||||
fLink->StartMessage(AS_DW_SET_FULLSCREEN);
|
||||
fLink->StartMessage(AS_DIRECT_WINDOW_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;
|
||||
status_t status = B_ERROR;
|
||||
if (fLink->FlushWithReply(status) == B_OK
|
||||
&& status == B_OK)
|
||||
full_screen_enable = enable;
|
||||
}
|
||||
#endif
|
||||
Unlock();
|
||||
|
||||
@ -337,11 +335,12 @@ BDirectWindow::SupportsWindowMode(screen_id id)
|
||||
return result & true;
|
||||
#else
|
||||
BPrivate::AppServerLink link;
|
||||
link.StartMessage(AS_DW_SUPPORTS_WINDOW_MODE);
|
||||
link.StartMessage(AS_DIRECT_WINDOW_SUPPORTS_WINDOW_MODE);
|
||||
link.Attach<screen_id>(id);
|
||||
|
||||
int32 reply;
|
||||
if (link.FlushWithReply(reply) == B_OK
|
||||
&& reply == SERVER_TRUE)
|
||||
&& reply == B_OK)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
@ -461,7 +460,7 @@ BDirectWindow::InitData()
|
||||
a_session->sread(sizeof(sync_data), &sync_data);
|
||||
a_session->sread(sizeof(status), &status);
|
||||
#else
|
||||
fLink->StartMessage(AS_DW_GET_SYNC_DATA);
|
||||
fLink->StartMessage(AS_DIRECT_WINDOW_GET_SYNC_DATA);
|
||||
fLink->Attach<int32>(server_token);
|
||||
|
||||
int32 reply;
|
||||
|
@ -1683,12 +1683,17 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
||||
break;
|
||||
}
|
||||
|
||||
case AS_DW_GET_SYNC_DATA:
|
||||
{
|
||||
// TODO: Use token or get rid of it.
|
||||
int32 serverToken;
|
||||
link.Read<int32>(&serverToken);
|
||||
// BDirectWindow communication
|
||||
|
||||
case AS_DIRECT_WINDOW_SUPPORTS_WINDOW_MODE:
|
||||
// TODO: How to determine this?
|
||||
fLink.StartMessage(B_OK);
|
||||
fLink.Attach<bool>(true);
|
||||
fLink.Flush();
|
||||
break;
|
||||
|
||||
case AS_DIRECT_WINDOW_GET_SYNC_DATA:
|
||||
{
|
||||
if (_EnableDirectWindowMode() == B_OK) {
|
||||
fLink.StartMessage(B_OK);
|
||||
struct dw_sync_data syncData = {
|
||||
@ -2224,19 +2229,21 @@ ServerWindow::MakeWindowLayer(BRect frame, const char* name,
|
||||
status_t
|
||||
ServerWindow::_EnableDirectWindowMode()
|
||||
{
|
||||
if (fDirectWindowData != NULL)
|
||||
return B_ERROR; // already in direct window mode
|
||||
|
||||
if (fDirectWindowData != NULL) {
|
||||
// already in direct window mode
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
fDirectWindowData = new (nothrow) dw_data;
|
||||
if (fDirectWindowData == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
|
||||
if (!fDirectWindowData->IsValid()) {
|
||||
delete fDirectWindowData;
|
||||
fDirectWindowData = NULL;
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user