seamless-x11.cpp revision e42f96d376f5a18f4c61212e47eadae813bb2a2b
/** @file
*
* Seamless mode:
* Linux guest.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/*****************************************************************************
* Header files *
*****************************************************************************/
#include <VBox/VBoxGuest.h>
#include "seamless-guest.h"
/*****************************************************************************
* Static functions *
*****************************************************************************/
unsigned long *nItems)
{
True /* only_if_exists */);
if (propNameAtom == None)
{
return VBoxGuestX11Pointer<unsigned char>(0);
}
int actFmt = 0;
unsigned long nBytesAfter = 0;
unsigned char *propVal = 0;
return VBoxGuestX11Pointer<unsigned char>(0);
return VBoxGuestX11Pointer<unsigned char>(propVal);
}
/**
* Initialise the guest and ensure that it is capable of handling seamless mode
*
* @returns true if it can handle seamless, false otherwise
*/
{
int rc = VINF_SUCCESS;
/** Dummy value for XXGetProperty */
unsigned long nItems;
if (0 != mObserver) /* Assertion */
{
LogRel(("VBoxService: ERROR: attempt to initialise seamless guest object twice!\n"));
return VERR_INTERNAL_ERROR;
}
{
LogRel(("VBoxService: seamless guest object failed to acquire a connection to the display.\n"));
return VERR_ACCESS_DENIED;
}
{
LogRel(("VBoxService: _NET_CLIENT_LIST property not supported by guest window manager. Seamless mode will not be enabled.\n"));
}
return rc;
}
/**
* Read information about currently visible windows in the guest and subscribe to X11
* events about changes to this information.
*
* @note This class does not contain its own event thread, so an external thread must
* call nextEvent() for as long as events are wished.
* @todo This function should switch the guest to fullscreen mode.
*/
int VBoxGuestSeamlessX11::start(void)
{
int rc = VINF_SUCCESS;
/** Dummy values for XShapeQueryExtension */
mEnabled = true;
return rc;
}
/** Stop reporting seamless events to the host. Free information about guest windows
and stop requesting updates. */
void VBoxGuestSeamlessX11::stop(void)
{
mEnabled = false;
}
void VBoxGuestSeamlessX11::monitorClientList(void)
{
}
void VBoxGuestSeamlessX11::unmonitorClientList(void)
{
}
void VBoxGuestSeamlessX11::rebuildWindowTree(void)
{
VBoxGuestX11Pointer<unsigned char> clientListRaw;
unsigned long nItems;
for (unsigned i = 0; i < nItems; ++i)
{
VBoxGuestX11Pointer<unsigned char> windowTypeRaw;
unsigned long ulCount;
WM_TYPE_PROP, &ulCount);
if ( (ulCount != 0)
{
}
}
}
{
int x, y;
/** Dummy value for XTranslateCoordinates */
{
return;
}
if (mSupportsShape)
{
{
cRects = 0;
}
}
}
/**
* Free all information in the tree of visible windows
*/
void VBoxGuestSeamlessX11::freeWindowTree(void)
{
/* We use post-increment in the operation to prevent the iterator from being invalidated. */
{
}
}
/**
* Waits for a position or shape-related event from guest windows
*
* @note Called from the guest event thread.
*/
void VBoxGuestSeamlessX11::nextEvent(void)
{
/* Start by sending information about the current window setup to the host. We do this
here because we want to send all such information from a single thread. */
{
case ConfigureNotify:
break;
case MapNotify:
break;
case PropertyNotify:
break;
case ShapeNotify:
break;
case UnmapNotify:
break;
default:
break;
}
}
/**
* Handle a configuration event in the seamless event thread by setting the new position.
*
* @param event the X11 event structure
*/
{
{
}
}
/**
* Handle a map event in the seamless event thread.
*
* @param event the X11 event structure
*/
{
{
}
}
/**
* If the list of client windows changes, rebuild the list.
*
* @param event the X11 event structure
*/
{
{
}
}
/**
* Handle a window shape change event in the seamless event thread.
*
* @param event the X11 event structure
*/
{
{
{
cRects = 0;
}
}
}
/**
* Handle an unmap event in the seamless event thread.
*
* @param event the X11 event structure
*/
{
{
}
}
/**
* Sends an updated list of visible rectangles to the host
*/
{
unsigned cRects = 0;
if (0 != mcRects)
{
}
{
{
{
{
}
}
else
{
++cRects;
}
}
}
return apRects;
}
/**
* Send a client event to wake up the X11 seamless event loop prior to stopping it.
*
* @note This function should only be called from the host event thread.
*/
bool VBoxGuestSeamlessX11::interruptEvent(void)
{
/* Message contents set to zero. */
reinterpret_cast<XEvent *>(&clientMessage)))
{
return true;
}
return false;
}