seamless-x11.h revision 3b3b3f38fab88ab36be8fef50a2a1edb7fca7e51
/** @file
*
* Seamless mode:
* Linux guest.
*/
/*
* Copyright (C) 2006-2007 Oracle Corporation
*
* 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.
*/
#ifndef __Additions_linux_seamless_x11_h
# define __Additions_linux_seamless_x11_h
#include "seamless-guest.h"
#define WM_TYPE_PROP "_NET_WM_WINDOW_TYPE"
#define WM_TYPE_DESKTOP_PROP "_NET_WM_WINDOW_TYPE_DESKTOP"
/* This is defined wrong in my X11 header files! */
#define VBoxShapeNotify 64
/** Structure containing information about a guest window's position and visible area.
Used inside of VBoxGuestWindowList. */
struct VBoxGuestWinInfo {
/** Header structure for insertion into an AVL tree */
/** Is the window currently mapped? */
bool mhasShape;
/** Co-ordinates in the guest screen. */
/** Window dimensions. */
/** Number of rectangles used to represent the visible area. */
int mcRects;
/** Rectangles representing the visible area. These must be allocated
* by XMalloc and will be freed automatically if non-null when the class
* is destroyed. */
/** Constructor. */
/** Destructor */
{
if (mpRects)
}
// We don't want a copy constructor or assignment operator
VBoxGuestWinInfo(const VBoxGuestWinInfo&);
};
/** Callback type used for "DoWithAll" calls */
/** Pointer to VBOXGUESTWINCALLBACK */
typedef VBOXGUESTWINCALLBACK *PVBOXGUESTWINCALLBACK;
{
return VINF_SUCCESS;
}
/**
* This class is just a wrapper around a map of structures containing
* information about the windows on the guest system. It has a function for
* adding a structure (see addWindow) and one for removing it by window
* handle (see removeWindow).
*/
{
// We don't want a copy constructor or an assignment operator
VBoxGuestWindowList(const VBoxGuestWindowList&);
// Private class members
// Constructor
// Destructor
{
/** @todo having this inside the container class hard codes that the
* elements have to be allocated with the "new" operator, and
* I don't see a need to require this. */
}
// Standard operations
{
}
{
}
{
pvParam);
}
{
LogRelFlowFunc(("\n"));
pRects);
LogRelFlowFunc(("returning\n"));
}
{
LogRelFlowFunc(("called\n"));
}
};
{
// We don't want a copy constructor or assignment operator
VBoxGuestSeamlessX11(const VBoxGuestSeamlessX11&);
// Private member variables
/** Pointer to the observer class. */
/** Our connection to the X11 display we are running on. */
/** Class to keep track of visible guest windows. */
/** The current set of seamless rectangles. */
/** The current number of seamless rectangles. */
int mcRects;
/** Do we support the X shaped window extension? */
bool mSupportsShape;
/** Is seamless mode currently enabled? */
bool mEnabled;
/** Have there been changes since the last time we sent a notification? */
bool mChanged;
// Private methods
// Methods to manage guest window information
/**
* Store information about a desktop window and register for structure events on it.
* If it is mapped, go through the list of it's children and add information about
* mapped children to the tree of visible windows, making sure that those windows are
* not already in our list of desktop windows.
*
* @param hWin the window concerned - should be a "desktop" window
*/
void monitorClientList(void);
void unmonitorClientList(void);
void rebuildWindowTree(void);
void freeWindowTree(void);
void updateHostSeamlessInfo(void);
int updateRects(void);
/**
* Initialise the guest and ensure that it is capable of handling seamless mode
* @param pObserver Observer class to connect host and guest interfaces
*
* @returns iprt status code
*/
/**
* Shutdown seamless event monitoring.
*/
void uninit(void)
{
if (0 != mObserver)
{
stop();
}
mObserver = 0;
}
/**
* Initialise seamless event reporting in the guest.
*
* @returns IPRT status code
*/
int start(void);
/** Stop reporting seamless events. */
void stop(void);
/** Get the current list of visible rectangles. */
/** Get the number of visible rectangles in the current list */
size_t getRectCount(void);
/** Process next event in the guest event queue - called by the event thread. */
void nextEvent(void);
/** Wake up the event thread if it is waiting for an event so that it can exit. */
bool interruptEvent(void);
/* Methods to handle X11 events. These are public so that the unit test
* can call them. */
VBoxGuestSeamlessX11(void)
{
{
uninit();
}
catch(...) {}
if (mDisplay)
}
};
#endif /* __Additions_linux_seamless_x11_h not defined */