*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/*-
*-----------------------------------------------------------------------
* XGrabWin.c - X11 Client Side interface to Window Grabber.
*
* This code uses the standard R3 extension mechanism for sending the grab or
* ungrab window requests. If the extension isn't present, it uses the un-used
* protocol if the server is from Sun.
*
* The global state is only relevant to one display. Multiple displays
* will have to be implemented via arrays of global data.
*-----------------------------------------------------------------------
*/
#define NEED_REPLIES
#define NEED_EVENTS
#include <string.h>
#include <unistd.h>
/* Unused requests */
#define BadCookie 0
static int X_WxExtensionCode;
static enum {
static void
{
int tmp;
return;
}
}
}
int
{
if (WxInitialized == NOT_INITIALIZED)
switch (WxInitialized) {
case USE_EXTENSION:
SyncHandle();
case USE_EXTRA_PROTOCOL:
SyncHandle();
case NOT_INITIALIZED:
case NOT_LOCAL_HOST:
return BadCookie;
}
return BadImplementation;
}
int
{
if (WxInitialized == NOT_INITIALIZED)
switch (WxInitialized) {
case USE_EXTENSION:
SyncHandle();
case USE_EXTRA_PROTOCOL:
SyncHandle();
case NOT_INITIALIZED:
case NOT_LOCAL_HOST:
return BadCookie;
}
return BadImplementation;
}
int
{
if (WxInitialized == NOT_INITIALIZED)
switch (WxInitialized) {
case USE_EXTENSION:
SyncHandle();
case USE_EXTRA_PROTOCOL:
case NOT_INITIALIZED:
case NOT_LOCAL_HOST:
return BadCookie;
}
return BadImplementation;
}
int
{
if (WxInitialized == NOT_INITIALIZED)
switch (WxInitialized) {
case USE_EXTENSION:
SyncHandle();
case USE_EXTRA_PROTOCOL:
case NOT_INITIALIZED:
case NOT_LOCAL_HOST:
return BadCookie;
}
return BadImplementation;
}
int
{
if (WxInitialized == NOT_INITIALIZED)
switch (WxInitialized) {
case USE_EXTENSION:
SyncHandle();
case USE_EXTRA_PROTOCOL:
case NOT_INITIALIZED:
case NOT_LOCAL_HOST:
return BadCookie;
}
return BadImplementation;
}
int
{
if (WxInitialized == NOT_INITIALIZED)
switch (WxInitialized) {
case USE_EXTENSION:
SyncHandle();
case USE_EXTRA_PROTOCOL:
case NOT_INITIALIZED:
case NOT_LOCAL_HOST:
return BadCookie;
}
return BadImplementation;
}
int
char *path)
{
if (WxInitialized == NOT_INITIALIZED)
switch (WxInitialized) {
case USE_EXTENSION:
SyncHandle();
return Success;
case USE_EXTRA_PROTOCOL:
case NOT_INITIALIZED:
case NOT_LOCAL_HOST:
return BadCookie;
}
return BadImplementation;
}
static int
WxError (
int mc)
{
if (_XErrorFunction != NULL) {
}
exit(1);
/*NOTREACHED*/
}