Moved dw_sync_data to a private header DirectWindowPrivate.h and renamed it to direct_window_sync_data.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15469 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2005, Haiku, Inc.
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef _DIRECT_WINDOW_PRIVATE_H
|
||||||
|
#define _DIRECT_WINDOW_PRIVATE_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <OS.h>
|
||||||
|
|
||||||
|
|
||||||
|
struct direct_window_sync_data {
|
||||||
|
area_id area;
|
||||||
|
sem_id disable_sem;
|
||||||
|
sem_id disable_sem_ack;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _DIRECT_WINDOW_PRIVATE_H
|
||||||
@@ -9,7 +9,9 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <DirectWindow.h>
|
#include <DirectWindow.h>
|
||||||
|
|
||||||
#include <clipping.h>
|
#include <clipping.h>
|
||||||
|
#include <DirectWindowPrivate.h>
|
||||||
|
|
||||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
# include <R5_AppServerLink.h>
|
# include <R5_AppServerLink.h>
|
||||||
@@ -28,15 +30,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// TODO: We'll want to move this to a private header,
|
|
||||||
// accessible by the app server.
|
|
||||||
struct dw_sync_data {
|
|
||||||
area_id area;
|
|
||||||
sem_id disableSem;
|
|
||||||
sem_id disableSemAck;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// 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
|
||||||
@@ -447,35 +440,34 @@ BDirectWindow::InitData()
|
|||||||
|
|
||||||
if (!Lock())
|
if (!Lock())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct dw_sync_data sync_data;
|
struct direct_window_sync_data syncData;
|
||||||
status_t status = B_ERROR;
|
status_t status = B_ERROR;
|
||||||
|
|
||||||
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
#ifdef HAIKU_TARGET_PLATFORM_BEOS
|
||||||
a_session->swrite_l(DW_GET_SYNC_DATA);
|
a_session->swrite_l(DW_GET_SYNC_DATA);
|
||||||
a_session->swrite_l(server_token);
|
a_session->swrite_l(server_token);
|
||||||
|
|
||||||
Flush();
|
Flush();
|
||||||
|
|
||||||
a_session->sread(sizeof(sync_data), &sync_data);
|
a_session->sread(sizeof(syncData), &syncData);
|
||||||
a_session->sread(sizeof(status), &status);
|
a_session->sread(sizeof(status), &status);
|
||||||
#else
|
#else
|
||||||
fLink->StartMessage(AS_DIRECT_WINDOW_GET_SYNC_DATA);
|
fLink->StartMessage(AS_DIRECT_WINDOW_GET_SYNC_DATA);
|
||||||
fLink->Attach<int32>(server_token);
|
|
||||||
|
|
||||||
int32 reply;
|
int32 reply;
|
||||||
if (fLink->FlushWithReply(reply) == B_OK
|
if (fLink->FlushWithReply(reply) == B_OK
|
||||||
&& reply == B_OK) {
|
&& reply == B_OK) {
|
||||||
fLink->Read<dw_sync_data>(&sync_data);
|
fLink->Read<direct_window_sync_data>(&syncData);
|
||||||
status = B_OK;
|
status = B_OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if DW_NEEDS_LOCKING
|
#if DW_NEEDS_LOCKING
|
||||||
direct_lock = 0;
|
direct_lock = 0;
|
||||||
direct_lock_count = 0;
|
direct_lock_count = 0;
|
||||||
@@ -485,20 +477,20 @@ BDirectWindow::InitData()
|
|||||||
if (direct_sem > 0)
|
if (direct_sem > 0)
|
||||||
dw_init_status |= DW_STATUS_SEM_CREATED;
|
dw_init_status |= DW_STATUS_SEM_CREATED;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
source_clipping_area = sync_data.area;
|
source_clipping_area = syncData.area;
|
||||||
disable_sem = sync_data.disableSem;
|
disable_sem = syncData.disable_sem;
|
||||||
disable_sem_ack = sync_data.disableSemAck;
|
disable_sem_ack = syncData.disable_sem_ack;
|
||||||
|
|
||||||
cloned_clipping_area = clone_area("Clone direct area", (void**)&buffer_desc,
|
cloned_clipping_area = clone_area("Clone direct area", (void**)&buffer_desc,
|
||||||
B_ANY_ADDRESS, B_READ_AREA, source_clipping_area);
|
B_ANY_ADDRESS, B_READ_AREA, source_clipping_area);
|
||||||
|
|
||||||
if (cloned_clipping_area > 0) {
|
if (cloned_clipping_area > 0) {
|
||||||
dw_init_status |= DW_STATUS_AREA_CLONED;
|
dw_init_status |= DW_STATUS_AREA_CLONED;
|
||||||
|
|
||||||
direct_deamon_id = spawn_thread(DirectDeamonFunc, "direct deamon",
|
direct_deamon_id = spawn_thread(DirectDeamonFunc, "direct deamon",
|
||||||
B_DISPLAY_PRIORITY, this);
|
B_DISPLAY_PRIORITY, this);
|
||||||
|
|
||||||
if (direct_deamon_id > 0) {
|
if (direct_deamon_id > 0) {
|
||||||
deamon_killer = false;
|
deamon_killer = false;
|
||||||
if (resume_thread(direct_deamon_id) == B_OK)
|
if (resume_thread(direct_deamon_id) == B_OK)
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
#include <WindowInfo.h>
|
#include <WindowInfo.h>
|
||||||
#include <WindowPrivate.h>
|
#include <WindowPrivate.h>
|
||||||
|
|
||||||
|
#include <DirectWindowPrivate.h>
|
||||||
#include <MessagePrivate.h>
|
#include <MessagePrivate.h>
|
||||||
|
|
||||||
#include "AppServer.h"
|
#include "AppServer.h"
|
||||||
@@ -119,14 +120,6 @@ struct dw_data {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// TODO: Copied from DirectWindow.cpp: Move to a common header
|
|
||||||
struct dw_sync_data {
|
|
||||||
area_id area;
|
|
||||||
sem_id disableSem;
|
|
||||||
sem_id disableSemAck;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Sets up the basic BWindow counterpart - you have to call Init() before
|
Sets up the basic BWindow counterpart - you have to call Init() before
|
||||||
you can actually use it, though.
|
you can actually use it, though.
|
||||||
@@ -1696,7 +1689,7 @@ ServerWindow::_DispatchViewMessage(int32 code,
|
|||||||
{
|
{
|
||||||
if (_EnableDirectWindowMode() == B_OK) {
|
if (_EnableDirectWindowMode() == B_OK) {
|
||||||
fLink.StartMessage(B_OK);
|
fLink.StartMessage(B_OK);
|
||||||
struct dw_sync_data syncData = {
|
struct direct_window_sync_data syncData = {
|
||||||
fDirectWindowData->direct_area,
|
fDirectWindowData->direct_area,
|
||||||
fDirectWindowData->direct_sem,
|
fDirectWindowData->direct_sem,
|
||||||
fDirectWindowData->direct_sem_ack
|
fDirectWindowData->direct_sem_ack
|
||||||
|
|||||||
Reference in New Issue
Block a user