tstSeamlessX11.cpp revision 8a79dd83c526885ecefc1e106f184ddb89cfe7a6
/** @file
* Linux seamless guest additions simulator in host.
*/
/*
* Copyright (C) 2007-2011 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.
*/
#include <stdlib.h> /* exit() */
#include <iprt/initterm.h>
#include <iprt/semaphore.h>
#include <VBox/VBoxGuestLib.h>
#include "../seamless.h"
static RTSEMEVENT eventSem;
{
for (unsigned i = 0; i < cRects; ++i)
{
RTPrintf(" xLeft: %d yTop: %d xRight: %d yBottom: %d\n",
}
return VINF_SUCCESS;
}
int VbglR3SeamlessSetCap(bool bState)
{
: "Seamless capability unset");
return VINF_SUCCESS;
}
{
RTPrintf("IRQ filter mask changed. Or mask: 0x%x. Not mask: 0x%x\n",
return VINF_SUCCESS;
}
{
static bool active = false;
int rc = VINF_SUCCESS;
if (!active)
{
active = true;
}
else
return rc;
}
{
}
int VbglR3InterruptEventWaits(void)
{
return RTSemEventSignal(eventSem);
}
/**
* Xlib error handler for certain errors that we can't avoid.
*/
{
char errorText[1024];
{
/* This can be triggered if a guest application destroys a window before we notice. */
RTPrintf("ignoring BadAtom error and returning\n");
return 0;
}
RTPrintf("An X Window protocol error occurred: %s\n"
" Request code: %d\n"
" Minor code: %d\n"
" Serial number of the failed request: %d\n\n"
"exiting.\n",
exit(1);
}
{
int rc = VINF_SUCCESS;
char ach[2];
RTPrintf("VirtualBox guest additions X11 seamless mode testcase\n");
if (0 == XInitThreads())
{
RTPrintf("Failed to initialise X11 threading, exiting.\n");
exit(1);
}
/* Set an X11 error handler, so that we don't die when we get unavoidable errors. */
RTPrintf("\nType Ctrl-C to exit...\n");
/** Our instance of the seamless class. */
LogRel(("Starting seamless Guest Additions...\n"));
if (rc != VINF_SUCCESS)
{
}
return rc;
}