R6.6 is the Xorg base-line

parent cb6ef07b
/* $Xorg: EVI.c,v 1.3 2000/08/17 19:47:55 cpqbld Exp $ */
/************************************************************
Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#include "X.h"
#include "Xproto.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "dix.h"
#define _XEVI_SERVER_
#include "XEVIstr.h"
#include "EVIstruct.h"
static unsigned char XEVIReqCode = 0;
static EviPrivPtr eviPriv;
static int
ProcEVIQueryVersion(ClientPtr client)
{
REQUEST(xEVIQueryVersionReq);
xEVIQueryVersionReply rep;
register int n;
REQUEST_SIZE_MATCH (xEVIQueryVersionReq);
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.majorVersion = XEVI_MAJOR_VERSION;
rep.minorVersion = XEVI_MAJOR_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swaps(&rep.majorVersion, n);
swaps(&rep.minorVersion, n);
}
WriteToClient(client, sizeof (xEVIQueryVersionReply), (char *)&rep);
return (client->noClientException);
}
#define swapEviInfo(eviInfo, l) \
{ \
int l1 = l; \
xExtendedVisualInfo *eviInfo1 = eviInfo; \
while (l1-- > 0) { \
swapl(&eviInfo1->core_visual_id, n); \
swapl(&eviInfo1->transparency_value, n); \
swaps(&eviInfo1->num_colormap_conflicts, n); \
eviInfo1++; \
} \
}
#define swapVisual(visual, l) \
{ \
int l1 = l; \
VisualID32 *visual1 = visual; \
while (l1-- > 0) { \
swapl(visual1, n); \
visual1++; \
} \
}
static int
ProcEVIGetVisualInfo(ClientPtr client)
{
REQUEST(xEVIGetVisualInfoReq);
xEVIGetVisualInfoReply rep;
int n, n_conflict, n_info, sz_info, sz_conflict;
VisualID32 *conflict;
xExtendedVisualInfo *eviInfo;
int status;
REQUEST_FIXED_SIZE(xEVIGetVisualInfoReq, stuff->n_visual * sz_VisualID32);
status = eviPriv->getVisualInfo((VisualID32 *)&stuff[1], (int)stuff->n_visual,
&eviInfo, &n_info, &conflict, &n_conflict);
if (status != Success)
return status;
sz_info = n_info * sz_xExtendedVisualInfo;
sz_conflict = n_conflict * sz_VisualID32;
rep.type = X_Reply;
rep.n_info = n_info;
rep.n_conflicts = n_conflict;
rep.sequenceNumber = client->sequence;
rep.length = (sz_info + sz_conflict) >> 2;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.n_info, n);
swapl(&rep.n_conflicts, n);
swapEviInfo(eviInfo, n_info);
swapVisual(conflict, n_conflict);
}
WriteToClient(client, sz_xEVIGetVisualInfoReply, (char *)&rep);
WriteToClient(client, sz_info, (char *)eviInfo);
WriteToClient(client, sz_conflict, (char *)conflict);
eviPriv->freeVisualInfo(eviInfo, conflict);
return (client->noClientException);
}
static int
ProcEVIDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_EVIQueryVersion:
return ProcEVIQueryVersion (client);
case X_EVIGetVisualInfo:
return ProcEVIGetVisualInfo (client);
default:
return BadRequest;
}
}
static int
SProcEVIQueryVersion(client)
ClientPtr client;
{
REQUEST(xEVIQueryVersionReq);
int n;
swaps(&stuff->length, n);
return ProcEVIQueryVersion(client);
}
static int
SProcEVIGetVisualInfo(ClientPtr client)
{
register int n;
REQUEST(xEVIGetVisualInfoReq);
swaps(&stuff->length, n);
return ProcEVIGetVisualInfo(client);
}
static int
SProcEVIDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data)
{
case X_EVIQueryVersion:
return SProcEVIQueryVersion (client);
case X_EVIGetVisualInfo:
return SProcEVIGetVisualInfo (client);
default:
return BadRequest;
}
}
/*ARGSUSED*/
static void
EVIResetProc(ExtensionEntry *extEntry)
{
eviDDXReset();
}
/****************
* XEVIExtensionInit
*
* Called from InitExtensions in main() or from QueryExtension() if the
* extension is dynamically loaded.
*
****************/
void
EVIExtensionInit(void)
{
ExtensionEntry *extEntry, *AddExtension();
if (extEntry = AddExtension(EVINAME, 0, 0,
ProcEVIDispatch,
SProcEVIDispatch,
EVIResetProc, StandardMinorOpcode))
{
XEVIReqCode = (unsigned char)extEntry->base;
eviPriv = eviDDXInit();
}
}
/* $Xorg: EVIstruct.h,v 1.3 2000/08/17 19:47:55 cpqbld Exp $ */
/************************************************************
Copyright (c) 1997 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
documentation, and that the name of Silicon Graphics not be
used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
#ifndef EVI_STRUCT_H
#define EVI_STRUCT_H
/*
******************************************************************************
** Per-ddx data
******************************************************************************
*/
typedef int (*GetVisualInfoProc)(
#if NeedNestedPrototypes
VisualID32*,
int,
xExtendedVisualInfo**,
int*,
VisualID32**,
int*
#endif
);
typedef void (*FreeVisualInfoProc)(
#if NeedNestedPrototypes
xExtendedVisualInfo*,
VisualID32*
#endif
);
typedef struct _EviPrivRec {
GetVisualInfoProc getVisualInfo;
FreeVisualInfoProc freeVisualInfo;
} EviPrivRec, *EviPrivPtr;
extern EviPrivPtr eviDDXInit();
extern void eviDDXReset();
#endif /* EVI_STRUCT_H */
There are several code fragments that need to be placed in the device
dependent part of the server. These are described below. These code
fragments are device and implementation dependent.
This code fragment should go in your ddx InitInput() routine:
#ifdef XTESTEXT1
extern KeyCode xtest_command_key;
#endif
#ifdef XTESTEXT1
xtest_command_key = <whatever-is-a-good-keycode-for-your-keyboard>;
#endif
This code fragment should go at the front of the file that handles
keyboards:
#ifdef XTESTEXT1
/*
* defined in xtestext1di.c
*/
extern int on_steal_input;
extern Bool XTestStealKeyData();
#endif XTESTEXT1
This code fragment should go in the function that parses input from the
keyboard or pointer after you know what input action has occurred, but before
you have told the server about it. If conditionalizes the actual function
call to pass the information on:
#ifdef XTESTEXT1
if (!on_steal_input ||
XTestStealKeyData(code, direction, dev_type, x, y))
#endif /* XTESTEXT1 */
handle_device_event(...);
This code fragment should go in the function that handles mouse motion after
you have figured out how much the mouse has moved:
#ifdef XTESTEXT1
if (on_steal_input)
XTestStealMotionData(dx, dy, dev, x, y);
#endif XTESTEXT1
This code fragment should go at the front of the os-specific code where
you wait (by doing a select on the socket in our implementation) for
something to happen:
#ifdef XTESTEXT1
extern int playback_on;
void XTestComputeWaitTime();
#endif XTESTEXT1
These code fragments should go in the os-specific code on both sides of
where you wait (by doing a select on the socket in our implementation)
for something to happen:
#ifdef XTESTEXT1
if (playback_on)
XTestComputeWaitTime(wt = &waittime);
#endif XTESTEXT1
... code to do select ...
WakeupHandler(i, LastSelectMask);
#ifdef XTESTEXT1
if (playback_on)
i = XTestProcessInputAction(i, &waittime);
#endif XTESTEXT1
You also need to implement the following routines (documentation
is needed; for now, see server/ddx/hp/hp/x_hil.c):
void
XTestGenerateEvent(dev_type, keycode, keystate, mousex, mousey)
int dev_type;
int keycode;
int keystate;
int mousex;
int mousey;
void
XTestGetPointerPos(fmousex, fmousey)
short *fmousex, *fmousey;
void
XTestJumpPointer(jx, jy, dev_type)
int jx;
int jy;
int dev_type;
version-1
# $Xorg: SecurityPolicy,v 1.3 2000/08/17 19:47:56 cpqbld Exp $
# The site policy fields are interpreted by the XC-QUERY-SECURITY-1
# authorization protocol. The values are arbitrary and site-specific.
# Refer to the Security Extension Specification for the usage of the policies.
#sitepolicy A
#sitepolicy B
#sitepolicy C
# Property access rules:
# property <property> <window> <permissions>
# <window> ::= any | root | <propertyselector>
# <propertyselector> ::= <property> | <property>=<value>
# <permissions> :== [ <operation> | <action> | <space> ]*
# <operation> :== r | w | d
# r read
# w write
# d delete
# <action> :== a | i | e
# a allow
# i ignore
# e error
# Allow reading of application resources, but not writing.
property RESOURCE_MANAGER root ar iw
property SCREEN_RESOURCES root ar iw
# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
# and allowing access may give away too much information.
property CUT_BUFFER0 root irw
property CUT_BUFFER1 root irw
property CUT_BUFFER2 root irw
property CUT_BUFFER3 root irw
property CUT_BUFFER4 root irw
property CUT_BUFFER5 root irw
property CUT_BUFFER6 root irw
property CUT_BUFFER7 root irw
# If you are using Motif, you probably want these.
property _MOTIF_DEFAULT_BINDINGS root ar iw
property _MOTIF_DRAG_WINDOW root ar iw
property _MOTIF_DRAG_TARGETS any ar iw
property _MOTIF_DRAG_ATOMS any ar iw
property _MOTIF_DRAG_ATOM_PAIRS any ar iw
# If you are running CDE you also need these
property _MOTIF_WM_INFO root arw
property TT_SESSION root irw
property WM_ICON_SIZE root irw
property "SDT Pixel Set" any irw
# The next two rules let xwininfo -tree work when untrusted.
property WM_NAME any ar
# Allow read of WM_CLASS, but only for windows with WM_NAME.
# This might be more restrictive than necessary, but demonstrates
# the <required property> facility, and is also an attempt to
# say "top level windows only."
property WM_CLASS WM_NAME ar
# These next three let xlsclients work untrusted. Think carefully
# before including these; giving away the client machine name and command
# may be exposing too much.
property WM_STATE WM_NAME ar
property WM_CLIENT_MACHINE WM_NAME ar
property WM_COMMAND WM_NAME ar
# To let untrusted clients use the standard colormaps created by
# xstdcmap, include these lines.
property RGB_DEFAULT_MAP root ar
property RGB_BEST_MAP root ar
property RGB_RED_MAP root ar
property RGB_GREEN_MAP root ar
property RGB_BLUE_MAP root ar
property RGB_GRAY_MAP root ar
# To let untrusted clients use the color management database created
# by xcmsdb, include these lines.
property XDCCC_LINEAR_RGB_CORRECTION root ar
property XDCCC_LINEAR_RGB_MATRICES root ar
property XDCCC_GRAY_SCREENWHITEPOINT root ar
property XDCCC_GRAY_CORRECTION root ar
# To let untrusted clients use the overlay visuals that many vendors
# support, include this line.
property SERVER_OVERLAY_VISUALS root ar
This diff is collapsed.
/* $Xorg: bigreq.c,v 1.4 2001/02/09 02:04:32 xorgcvs Exp $ */
/*
Copyright 1992, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice 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 OPEN GROUP 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.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
#include "X.h"
#include "Xproto.h"
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "bigreqstr.h"
static unsigned char XBigReqCode;
static int ProcBigReqDispatch();
static void BigReqResetProc();
void
BigReqExtensionInit()
{
ExtensionEntry *extEntry, *AddExtension();
if (extEntry = AddExtension(XBigReqExtensionName, 0, 0,
ProcBigReqDispatch, ProcBigReqDispatch,
BigReqResetProc, StandardMinorOpcode))
XBigReqCode = (unsigned char)extEntry->base;
DeclareExtensionSecurity(XBigReqExtensionName, TRUE);
}
/*ARGSUSED*/
static void
BigReqResetProc (extEntry)
ExtensionEntry *extEntry;
{
}
static int
ProcBigReqDispatch (client)
register ClientPtr client;
{