summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:07 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-26 22:49:07 +0000
commit0097b6fe2d1739e46e4e7726aaa481b6dc84870c (patch)
tree5e279fda13b69a02c684338ee803defbda33ab08 /Xext
parentc57959ad6a4c0f5329762f401fd7871ffb2ee90c (diff)
merge latest (4.3.99.16) from XFree86 (vendor) branch
Diffstat (limited to 'Xext')
-rw-r--r--Xext/EVI.c29
-rw-r--r--Xext/EVIstruct.h15
-rw-r--r--Xext/appgroup.c181
-rw-r--r--Xext/appgroup.h10
-rw-r--r--Xext/bigreq.c19
-rw-r--r--Xext/cup.c59
-rw-r--r--Xext/dpms.c14
-rw-r--r--Xext/dpmsproc.h4
-rw-r--r--Xext/dpmsstubs.c6
-rw-r--r--Xext/fontcache.c12
-rw-r--r--Xext/mbuf.c38
-rw-r--r--Xext/mbufbf.c39
-rw-r--r--Xext/mitmisc.c15
-rw-r--r--Xext/panoramiX.c155
-rw-r--r--Xext/panoramiX.h3
-rw-r--r--Xext/panoramiXSwap.c25
-rw-r--r--Xext/panoramiXh.h78
-rw-r--r--Xext/panoramiXprocs.c98
-rw-r--r--Xext/sampleEVI.c9
-rw-r--r--Xext/saver.c165
-rw-r--r--Xext/security.c162
-rw-r--r--Xext/shape.c43
-rw-r--r--Xext/shm.c53
-rw-r--r--Xext/sleepuntil.c16
-rw-r--r--Xext/sleepuntil.h6
-rw-r--r--Xext/sync.c79
-rw-r--r--Xext/xcmisc.c16
-rw-r--r--Xext/xf86bigfont.c39
-rw-r--r--Xext/xprint.c45
-rw-r--r--Xext/xres.c15
-rw-r--r--Xext/xtest.c58
-rw-r--r--Xext/xtest1dd.c41
-rw-r--r--Xext/xtest1dd.h30
-rw-r--r--Xext/xtest1di.c32
-rw-r--r--Xext/xvdisp.c18
-rw-r--r--Xext/xvdisp.h3
-rw-r--r--Xext/xvmain.c34
-rw-r--r--Xext/xvmc.c2
-rw-r--r--Xext/xvmcext.h4
39 files changed, 873 insertions, 797 deletions
diff --git a/Xext/EVI.c b/Xext/EVI.c
index aa3734b02..09aa03b64 100644
--- a/Xext/EVI.c
+++ b/Xext/EVI.c
@@ -21,7 +21,7 @@ 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.
********************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/EVI.c,v 3.9 2001/10/28 03:32:50 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/EVI.c,v 3.11 2003/10/28 23:08:43 tsi Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -31,8 +31,13 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define _XEVI_SERVER_
#include "XEVIstr.h"
#include "EVIstruct.h"
+#include "modinit.h"
+
+#if 0
static unsigned char XEVIReqCode = 0;
+#endif
static EviPrivPtr eviPriv;
+
static int
ProcEVIQueryVersion(ClientPtr client)
{
@@ -74,6 +79,7 @@ ProcEVIQueryVersion(ClientPtr client)
visual1++; \
} \
}
+
static int
ProcEVIGetVisualInfo(ClientPtr client)
{
@@ -109,6 +115,7 @@ ProcEVIGetVisualInfo(ClientPtr client)
eviPriv->freeVisualInfo(eviInfo, conflict);
return (client->noClientException);
}
+
static int
ProcEVIDispatch(ClientPtr client)
{
@@ -122,15 +129,16 @@ ProcEVIDispatch(ClientPtr client)
return BadRequest;
}
}
+
static int
-SProcEVIQueryVersion(client)
-ClientPtr client;
+SProcEVIQueryVersion(ClientPtr client)
{
REQUEST(xEVIQueryVersionReq);
int n;
swaps(&stuff->length, n);
return ProcEVIQueryVersion(client);
}
+
static int
SProcEVIGetVisualInfo(ClientPtr client)
{
@@ -139,6 +147,7 @@ SProcEVIGetVisualInfo(ClientPtr client)
swaps(&stuff->length, n);
return ProcEVIGetVisualInfo(client);
}
+
static int
SProcEVIDispatch(ClientPtr client)
{
@@ -153,12 +162,14 @@ SProcEVIDispatch(ClientPtr client)
return BadRequest;
}
}
+
/*ARGSUSED*/
static void
EVIResetProc(ExtensionEntry *extEntry)
{
eviDDXReset();
}
+
/****************
* XEVIExtensionInit
*
@@ -167,15 +178,21 @@ EVIResetProc(ExtensionEntry *extEntry)
*
****************/
void
-EVIExtensionInit(void)
+EVIExtensionInit(INITARGS)
{
+#if 0
ExtensionEntry *extEntry;
+
if ((extEntry = AddExtension(EVINAME, 0, 0,
ProcEVIDispatch,
SProcEVIDispatch,
- EVIResetProc, StandardMinorOpcode)))
- {
+ EVIResetProc, StandardMinorOpcode))) {
XEVIReqCode = (unsigned char)extEntry->base;
+#else
+ if (AddExtension(EVINAME, 0, 0,
+ ProcEVIDispatch, SProcEVIDispatch,
+ EVIResetProc, StandardMinorOpcode)) {
+#endif
eviPriv = eviDDXInit();
}
}
diff --git a/Xext/EVIstruct.h b/Xext/EVIstruct.h
index 9bb24b0d2..dfe4423f8 100644
--- a/Xext/EVIstruct.h
+++ b/Xext/EVIstruct.h
@@ -21,33 +21,36 @@ 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.
********************************************************/
+/* $XFree86: xc/programs/Xserver/Xext/EVIstruct.h,v 3.6 2003/11/17 22:20:26 dawes Exp $ */
+
#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();
+
+extern EviPrivPtr eviDDXInit(void);
+extern void eviDDXReset(void);
+
#endif /* EVI_STRUCT_H */
diff --git a/Xext/appgroup.c b/Xext/appgroup.c
index 37e6ee0bc..8718e3630 100644
--- a/Xext/appgroup.c
+++ b/Xext/appgroup.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/appgroup.c,v 1.9 2001/12/17 20:52:25 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/appgroup.c,v 1.11 2003/10/28 23:08:43 tsi Exp $ */
/*
Copyright 1996, 1998, 2001 The Open Group
@@ -39,6 +39,7 @@ from The Open Group.
#include "servermd.h"
#define _XAG_SERVER_
#include "Xagstr.h"
+#include "Xagsrv.h"
#define _SECURITY_SERVER
#include "security.h"
#include "Xfuncproto.h"
@@ -49,6 +50,9 @@ from The Open Group.
#include <stdio.h>
+#include "modinit.h"
+#include "appgroup.h"
+
typedef struct _AppGroupRec {
struct _AppGroupRec* next;
XID appgroupId;
@@ -65,11 +69,14 @@ typedef struct _AppGroupRec {
char* ConnectionInfo;
} AppGroupRec, *AppGroupPtr;
-static int ProcXagDispatch (), SProcXagDispatch ();
-static void XagResetProc ();
+static int ProcXagDispatch(ClientPtr client);
+static int SProcXagDispatch(ClientPtr client);
+static void XagResetProc(ExtensionEntry* extEntry);
+#if 0
static unsigned char XagReqCode = 0;
static int XagErrorBase;
+#endif
static int XagCallbackRefCount = 0;
static RESTYPE RT_APPGROUP;
@@ -80,9 +87,9 @@ extern char* ConnectionInfo;
extern int connBlockScreenStart;
static
-int XagAppGroupFree (what, id)
- pointer what;
- XID id; /* unused */
+int XagAppGroupFree(
+ pointer what,
+ XID id) /* unused */
{
int i;
AppGroupPtr pAppGrp = (AppGroupPtr) what;
@@ -113,10 +120,10 @@ int XagAppGroupFree (what, id)
}
/* static */
-void XagClientStateChange (pcbl, nulldata, calldata)
- CallbackListPtr* pcbl;
- pointer nulldata;
- pointer calldata;
+void XagClientStateChange(
+ CallbackListPtr* pcbl,
+ pointer nulldata,
+ pointer calldata)
{
SecurityAuthorizationPtr pAuth;
NewClientInfoRec* pci = (NewClientInfoRec*) calldata;
@@ -217,8 +224,9 @@ void XagClientStateChange (pcbl, nulldata, calldata)
}
void
-XagExtensionInit ()
+XagExtensionInit(INITARGS)
{
+#if 0
ExtensionEntry* extEntry;
if ((extEntry = AddExtension (XAGNAME,
@@ -230,14 +238,23 @@ XagExtensionInit ()
StandardMinorOpcode))) {
XagReqCode = (unsigned char)extEntry->base;
XagErrorBase = extEntry->errorBase;
+#else
+ if (AddExtension (XAGNAME,
+ 0,
+ XagNumberErrors,
+ ProcXagDispatch,
+ SProcXagDispatch,
+ XagResetProc,
+ StandardMinorOpcode)) {
+#endif
RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
}
}
/*ARGSUSED*/
static
-void XagResetProc (extEntry)
- ExtensionEntry* extEntry;
+void XagResetProc(
+ ExtensionEntry* extEntry)
{
DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL);
XagCallbackRefCount = 0;
@@ -245,8 +262,8 @@ void XagResetProc (extEntry)
}
static
-int ProcXagQueryVersion (client)
- register ClientPtr client;
+int ProcXagQueryVersion(
+ register ClientPtr client)
{
/* REQUEST (xXagQueryVersionReq); */
xXagQueryVersionReply rep;
@@ -269,11 +286,11 @@ int ProcXagQueryVersion (client)
}
static
-void ProcessAttr (pAppGrp, client, attrib_mask, attribs)
- AppGroupPtr pAppGrp;
- ClientPtr client;
- unsigned int attrib_mask;
- CARD32* attribs;
+void ProcessAttr(
+ AppGroupPtr pAppGrp,
+ ClientPtr client,
+ unsigned int attrib_mask,
+ CARD32* attribs)
{
int i;
@@ -307,8 +324,8 @@ void ProcessAttr (pAppGrp, client, attrib_mask, attribs)
}
static
-void CreateConnectionInfo (pAppGrp)
- AppGroupPtr pAppGrp;
+void CreateConnectionInfo(
+ AppGroupPtr pAppGrp)
{
xWindowRoot* rootp;
xWindowRoot* roots[MAXSCREENS];
@@ -368,11 +385,11 @@ void CreateConnectionInfo (pAppGrp)
}
static
-AppGroupPtr CreateAppGroup (client, appgroupId, attrib_mask, attribs)
- ClientPtr client;
- XID appgroupId;
- unsigned int attrib_mask;
- CARD32* attribs;
+AppGroupPtr CreateAppGroup(
+ ClientPtr client,
+ XID appgroupId,
+ unsigned int attrib_mask,
+ CARD32* attribs)
{
AppGroupPtr pAppGrp;
@@ -396,10 +413,10 @@ AppGroupPtr CreateAppGroup (client, appgroupId, attrib_mask, attribs)
}
static
-int AttrValidate (client, attrib_mask, pAppGrp)
- ClientPtr client;
- int attrib_mask;
- AppGroupPtr pAppGrp;
+int AttrValidate(
+ ClientPtr client,
+ int attrib_mask,
+ AppGroupPtr pAppGrp)
{
WindowPtr pWin;
int idepth, ivids, found;
@@ -439,8 +456,8 @@ int AttrValidate (client, attrib_mask, pAppGrp)
}
/* static */
-int ProcXagCreate (client)
- register ClientPtr client;
+int ProcXagCreate (
+ register ClientPtr client)
{
REQUEST (xXagCreateReq);
AppGroupPtr pAppGrp;
@@ -471,8 +488,8 @@ int ProcXagCreate (client)
}
/* static */
-int ProcXagDestroy (client)
- register ClientPtr client;
+int ProcXagDestroy(
+ register ClientPtr client)
{
AppGroupPtr pAppGrp;
REQUEST (xXagDestroyReq);
@@ -488,8 +505,8 @@ int ProcXagDestroy (client)
}
static
-int ProcXagGetAttr (client)
- register ClientPtr client;
+int ProcXagGetAttr(
+ register ClientPtr client)
{
AppGroupPtr pAppGrp;
REQUEST (xXagGetAttrReq);
@@ -524,8 +541,8 @@ int ProcXagGetAttr (client)
}
static
-int ProcXagQuery (client)
- register ClientPtr client;
+int ProcXagQuery(
+ register ClientPtr client)
{
ClientPtr pClient;
AppGroupPtr pAppGrp;
@@ -556,8 +573,8 @@ int ProcXagQuery (client)
}
static
-int ProcXagCreateAssoc (client)
- register ClientPtr client;
+int ProcXagCreateAssoc(
+ register ClientPtr client)
{
REQUEST (xXagCreateAssocReq);
@@ -579,8 +596,8 @@ int ProcXagCreateAssoc (client)
}
static
-int ProcXagDestroyAssoc (client)
- register ClientPtr client;
+int ProcXagDestroyAssoc(
+ register ClientPtr client)
{
/* REQUEST (xXagDestroyAssocReq); */
@@ -590,8 +607,8 @@ int ProcXagDestroyAssoc (client)
}
static
-int ProcXagDispatch (client)
- register ClientPtr client;
+int ProcXagDispatch (
+ register ClientPtr client)
{
REQUEST (xReq);
switch (stuff->data)
@@ -616,8 +633,8 @@ int ProcXagDispatch (client)
}
static
-int SProcXagQueryVersion (client)
- register ClientPtr client;
+int SProcXagQueryVersion(
+ register ClientPtr client)
{
register int n;
REQUEST(xXagQueryVersionReq);
@@ -626,8 +643,8 @@ int SProcXagQueryVersion (client)
}
static
-int SProcXagCreate (client)
- ClientPtr client;
+int SProcXagCreate(
+ ClientPtr client)
{
register int n;
REQUEST (xXagCreateReq);
@@ -640,8 +657,8 @@ int SProcXagCreate (client)
}
static
-int SProcXagDestroy (client)
- ClientPtr client;
+int SProcXagDestroy(
+ ClientPtr client)
{
register int n;
REQUEST (xXagDestroyReq);
@@ -652,8 +669,8 @@ int SProcXagDestroy (client)
}
static
-int SProcXagGetAttr (client)
- ClientPtr client;
+int SProcXagGetAttr(
+ ClientPtr client)
{
register int n;
REQUEST (xXagGetAttrReq);
@@ -664,8 +681,8 @@ int SProcXagGetAttr (client)
}
static
-int SProcXagQuery (client)
- ClientPtr client;
+int SProcXagQuery(
+ ClientPtr client)
{
register int n;
REQUEST (xXagQueryReq);
@@ -676,8 +693,8 @@ int SProcXagQuery (client)
}
static
-int SProcXagCreateAssoc (client)
- ClientPtr client;
+int SProcXagCreateAssoc(
+ ClientPtr client)
{
register int n;
REQUEST (xXagCreateAssocReq);
@@ -690,8 +707,8 @@ int SProcXagCreateAssoc (client)
}
static
-int SProcXagDestroyAssoc (client)
- ClientPtr client;
+int SProcXagDestroyAssoc(
+ ClientPtr client)
{
register int n;
REQUEST (xXagDestroyAssocReq);
@@ -702,8 +719,8 @@ int SProcXagDestroyAssoc (client)
}
static
-int SProcXagDispatch (client)
- register ClientPtr client;
+int SProcXagDispatch(
+ register ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data)
@@ -727,20 +744,20 @@ int SProcXagDispatch (client)
}
}
-Colormap XagDefaultColormap (client)
- ClientPtr client;
+Colormap XagDefaultColormap(
+ ClientPtr client)
{
return (client->appgroup ? client->appgroup->default_colormap : None);
}
-VisualID XagRootVisual (client)
- ClientPtr client;
+VisualID XagRootVisual(
+ ClientPtr client)
{
return (client->appgroup ? client->appgroup->root_visual : 0);
}
-ClientPtr XagLeader (client)
- ClientPtr client;
+ClientPtr XagLeader(
+ ClientPtr client)
{
return (client->appgroup ? client->appgroup->leader : NULL);
}
@@ -750,9 +767,9 @@ ClientPtr XagLeader (client)
* We don't want to send it to the leader when the window is on a different
* screen, e.g. a print screen.
*/
-Bool XagIsControlledRoot (client, pParent)
- ClientPtr client;
- WindowPtr pParent;
+Bool XagIsControlledRoot(
+ ClientPtr client,
+ WindowPtr pParent)
{
if (client->appgroup) {
if (client->appgroup->single_screen &&
@@ -766,11 +783,11 @@ Bool XagIsControlledRoot (client, pParent)
return FALSE;
}
-void XagConnectionInfo (client, conn_prefix, conn_info, num_screen)
- ClientPtr client;
- xConnSetupPrefix** conn_prefix;
- char** conn_info;
- int* num_screen;
+void XagConnectionInfo(
+ ClientPtr client,
+ xConnSetupPrefix** conn_prefix,
+ char** conn_info,
+ int* num_screen)
{
if (client->appgroup && client->appgroup->ConnectionInfo) {
*conn_prefix = &client->appgroup->connSetupPrefix;
@@ -779,15 +796,15 @@ void XagConnectionInfo (client, conn_prefix, conn_info, num_screen)
}
}
-XID XagId (client)
- ClientPtr client;
+XID XagId(
+ ClientPtr client)
{
return (client->appgroup ? client->appgroup->appgroupId : 0);
}
-void XagGetDeltaInfo (client, buf)
- ClientPtr client;
- CARD32* buf;
+void XagGetDeltaInfo(
+ ClientPtr client,
+ CARD32* buf)
{
*buf++ = (CARD32) client->appgroup->default_root;
*buf++ = (CARD32) client->appgroup->root_visual;
@@ -796,8 +813,8 @@ void XagGetDeltaInfo (client, buf)
*buf = (CARD32) client->appgroup->white_pixel;
}
-void XagCallClientStateChange (client)
- ClientPtr client;
+void XagCallClientStateChange(
+ ClientPtr client)
{
if (appGrpList) {
NewClientInfoRec clientinfo;
diff --git a/Xext/appgroup.h b/Xext/appgroup.h
new file mode 100644
index 000000000..d292cf509
--- /dev/null
+++ b/Xext/appgroup.h
@@ -0,0 +1,10 @@
+/* $XFree86: xc/programs/Xserver/Xext/appgroup.h,v 1.1 2003/07/16 01:38:28 dawes Exp $ */
+
+void XagClientStateChange(
+ CallbackListPtr* pcbl,
+ pointer nulldata,
+ pointer calldata);
+int ProcXagCreate (
+ register ClientPtr client);
+int ProcXagDestroy(
+ register ClientPtr client);
diff --git a/Xext/bigreq.c b/Xext/bigreq.c
index 0d2dc5178..ae73783d9 100644
--- a/Xext/bigreq.c
+++ b/Xext/bigreq.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/Xext/bigreq.c,v 3.5 2001/12/14 19:58:48 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/bigreq.c,v 3.9 2003/11/17 22:20:26 dawes Exp $ */
#define NEED_EVENTS
#include "X.h"
@@ -36,26 +36,35 @@ from The Open Group.
#include "dixstruct.h"
#include "extnsionst.h"
#include "bigreqstr.h"
+#include "opaque.h"
+#include "modinit.h"
+#if 0
static unsigned char XBigReqCode;
+#endif
static void BigReqResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static DISPATCH_PROC(ProcBigReqDispatch);
void
-BigReqExtensionInit()
+BigReqExtensionInit(INITARGS)
{
+#if 0
ExtensionEntry *extEntry;
if ((extEntry = AddExtension(XBigReqExtensionName, 0, 0,
ProcBigReqDispatch, ProcBigReqDispatch,
BigReqResetProc, StandardMinorOpcode)) != 0)
XBigReqCode = (unsigned char)extEntry->base;
+#else
+ (void) AddExtension(XBigReqExtensionName, 0, 0,
+ ProcBigReqDispatch, ProcBigReqDispatch,
+ BigReqResetProc, StandardMinorOpcode);
+#endif
+
DeclareExtensionSecurity(XBigReqExtensionName, TRUE);
}
@@ -84,7 +93,7 @@ ProcBigReqDispatch (client)
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
- rep.max_request_size = MAX_BIG_REQUEST_SIZE;
+ rep.max_request_size = maxBigRequestSize;
if (client->swapped) {
swaps(&rep.sequenceNumber, n);
swapl(&rep.max_request_size, n);
diff --git a/Xext/cup.c b/Xext/cup.c
index 2159417bb..70c6fa610 100644
--- a/Xext/cup.c
+++ b/Xext/cup.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/Xext/cup.c,v 1.10 2001/12/14 19:58:48 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/cup.c,v 1.12 2003/10/28 23:08:43 tsi Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
@@ -47,11 +47,16 @@ in this Software without prior written authorization from The Open Group.
#include "xf86_ansic.h"
#endif
-static int ProcDispatch (), SProcDispatch ();
-static void ResetProc ();
+#include "modinit.h"
+static int ProcDispatch(ClientPtr client);
+static int SProcDispatch(ClientPtr client);
+static void ResetProc(ExtensionEntry* extEntry);
+
+#if 0
static unsigned char ReqCode = 0;
static int ErrorBase;
+#endif
#if defined(WIN32) || defined(TESTWIN32)
#define HAVE_SPECIAL_DESKTOP_COLORS
@@ -123,8 +128,9 @@ static xColorItem citems[] = {
#define NUM_DESKTOP_COLORS (sizeof citems / sizeof citems[0])
void
-XcupExtensionInit ()
+XcupExtensionInit (INITARGS)
{
+#if 0
ExtensionEntry* extEntry;
if ((extEntry = AddExtension (XCUPNAME,
@@ -137,20 +143,29 @@ XcupExtensionInit ()
ReqCode = (unsigned char)extEntry->base;
ErrorBase = extEntry->errorBase;
}
+#else
+ (void) AddExtension (XCUPNAME,
+ 0,
+ XcupNumberErrors,
+ ProcDispatch,
+ SProcDispatch,
+ ResetProc,
+ StandardMinorOpcode);
+#endif
/* PC servers initialize the desktop colors (citems) here! */
}
/*ARGSUSED*/
static
-void ResetProc (extEntry)
- ExtensionEntry* extEntry;
+void ResetProc(
+ ExtensionEntry* extEntry)
{
}
static
-int ProcQueryVersion (client)
- register ClientPtr client;
+int ProcQueryVersion(
+ register ClientPtr client)
{
/* REQUEST (xXcupQueryVersionReq); */
xXcupQueryVersionReply rep;
@@ -173,8 +188,8 @@ int ProcQueryVersion (client)
}
static
-int ProcGetReservedColormapEntries (client)
- register ClientPtr client;
+int ProcGetReservedColormapEntries(
+ register ClientPtr client)
{
REQUEST (xXcupGetReservedColormapEntriesReq);
xXcupGetReservedColormapEntriesReply rep;
@@ -206,8 +221,8 @@ int ProcGetReservedColormapEntries (client)
}
static
-int ProcStoreColors (client)
- register ClientPtr client;
+int ProcStoreColors(
+ register ClientPtr client)
{
REQUEST (xXcupStoreColorsReq);
ColormapPtr pcmp;
@@ -265,8 +280,8 @@ int ProcStoreColors (client)
}
static
-int ProcDispatch (client)
- register ClientPtr client;
+int ProcDispatch(
+ register ClientPtr client)
{
REQUEST (xReq);
switch (stuff->data)
@@ -283,8 +298,8 @@ int ProcDispatch (client)
}
static
-int SProcQueryVersion (client)
- register ClientPtr client;
+int SProcQueryVersion(
+ register ClientPtr client)
{
register int n;
@@ -294,8 +309,8 @@ int SProcQueryVersion (client)
}
static
-int SProcGetReservedColormapEntries (client)
- ClientPtr client;
+int SProcGetReservedColormapEntries(
+ ClientPtr client)
{
register int n;
@@ -307,8 +322,8 @@ int SProcGetReservedColormapEntries (client)
}
static
-int SProcXcupStoreColors (client)
- ClientPtr client;
+int SProcXcupStoreColors(
+ ClientPtr client)
{
register int n;
int count;
@@ -325,8 +340,8 @@ int SProcXcupStoreColors (client)
}
static
-int SProcDispatch (client)
- register ClientPtr client;
+int SProcDispatch(
+ register ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data)
diff --git a/Xext/dpms.c b/Xext/dpms.c
index 23c377fb4..584c32b22 100644
--- a/Xext/dpms.c
+++ b/Xext/dpms.c
@@ -33,7 +33,7 @@ Equipment Corporation.
* @(#)RCSfile: dpms.c,v Revision: 1.1.4.5 (DEC) Date: 1996/03/04 15:27:00
*/
-/* $XFree86: xc/programs/Xserver/Xext/dpms.c,v 3.9 2001/10/28 03:32:50 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/dpms.c,v 3.11 2003/10/28 23:08:43 tsi Exp $ */
#include "X.h"
#include "Xproto.h"
@@ -46,8 +46,11 @@ Equipment Corporation.
#include "dpms.h"
#include "dpmsstr.h"
#include "dpmsproc.h"
+#include "modinit.h"
+#if 0
static unsigned char DPMSCode;
+#endif
static DISPATCH_PROC(ProcDPMSDispatch);
static DISPATCH_PROC(SProcDPMSDispatch);
static DISPATCH_PROC(ProcDPMSGetVersion);
@@ -69,15 +72,20 @@ static DISPATCH_PROC(SProcDPMSCapable);
static void DPMSResetProc(ExtensionEntry* extEntry);
void
-DPMSExtensionInit()
+DPMSExtensionInit(INITARGS)
{
+#if 0
ExtensionEntry *extEntry;
if ((extEntry = AddExtension(DPMSExtensionName, 0, 0,
ProcDPMSDispatch, SProcDPMSDispatch,
DPMSResetProc, StandardMinorOpcode)))
DPMSCode = (unsigned char)extEntry->base;
- return;
+#else
+ (void) AddExtension(DPMSExtensionName, 0, 0,
+ ProcDPMSDispatch, SProcDPMSDispatch,
+ DPMSResetProc, StandardMinorOpcode);
+#endif
}
/*ARGSUSED*/
diff --git a/Xext/dpmsproc.h b/Xext/dpmsproc.h
index 1b045cc7c..b8260491e 100644
--- a/Xext/dpmsproc.h
+++ b/Xext/dpmsproc.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/dpmsproc.h,v 1.3 2001/10/28 03:32:50 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/dpmsproc.h,v 1.4 2003/07/16 01:38:29 dawes Exp $ */
/* Prototypes for functions that the DDX must provide */
@@ -6,7 +6,7 @@
#define _DPMSPROC_H_
void DPMSSet(int level);
-int DPMSGet(int *level);
+int DPMSGet(int *plevel);
Bool DPMSSupported(void);
#endif
diff --git a/Xext/dpmsstubs.c b/Xext/dpmsstubs.c
index ac1ee352a..bc85c16ca 100644
--- a/Xext/dpmsstubs.c
+++ b/Xext/dpmsstubs.c
@@ -26,10 +26,12 @@ dealings in this Software without prior written authorization from Digital
Equipment Corporation.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/dpmsstubs.c,v 3.4 2001/01/17 22:13:15 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/dpmsstubs.c,v 3.5 2003/07/16 01:38:29 dawes Exp $ */
typedef int Bool;
+#include "dpmsproc.h"
+
#define FALSE 0
Bool DPMSSupported(void)
@@ -37,7 +39,7 @@ Bool DPMSSupported(void)
return FALSE;
}
-int DPSMGet(int *level)
+int DPMSGet(int *plevel)
{
return -1;
}
diff --git a/Xext/fontcache.c b/Xext/fontcache.c
index cad7dcfba..7c3f5a800 100644
--- a/Xext/fontcache.c
+++ b/Xext/fontcache.c
@@ -27,7 +27,7 @@
*
* Id: fontcache.c,v 1.12 1999/01/31 13:47:45 akiyama Exp $
*/
-/* $XFree86: xc/programs/Xserver/Xext/fontcache.c,v 1.5 2000/02/23 20:29:39 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/fontcache.c,v 1.8 2003/11/17 22:20:26 dawes Exp $ */
/* THIS IS NOT AN X CONSORTIUM STANDARD */
@@ -47,13 +47,12 @@
#include "Xfuncproto.h"
#include "swaprep.h"
+#include "modinit.h"
static int miscErrorBase;
static void FontCacheResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry* /* extEntry */
-#endif
);
static DISPATCH_PROC(ProcFontCacheDispatch);
@@ -67,11 +66,12 @@ static DISPATCH_PROC(SProcFontCacheGetCacheStatistics);
static DISPATCH_PROC(SProcFontCacheQueryVersion);
static DISPATCH_PROC(SProcFontCacheChangeCacheSettings);
+#if 0
static unsigned char FontCacheReqCode = 0;
-
+#endif
void
-FontCacheExtensionInit()
+FontCacheExtensionInit(INITARGS)
{
ExtensionEntry* extEntry;
@@ -83,7 +83,9 @@ FontCacheExtensionInit()
SProcFontCacheDispatch,
FontCacheResetProc,
StandardMinorOpcode))) {
+#if 0
FontCacheReqCode = (unsigned char)extEntry->base;
+#endif
miscErrorBase = extEntry->errorBase;
}
}
diff --git a/Xext/mbuf.c b/Xext/mbuf.c
index 16a59e58e..4308037be 100644
--- a/Xext/mbuf.c
+++ b/Xext/mbuf.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/mbuf.c,v 3.14 2001/12/14 19:58:49 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/mbuf.c,v 3.16 2003/11/17 22:20:26 dawes Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -61,50 +61,40 @@ in this Software without prior written authorization from The Open Group.
#define ValidEventMasks (ExposureMask|MultibufferClobberNotifyMask|MultibufferUpdateNotifyMask)
+#if 0
static unsigned char MultibufferReqCode;
+#endif
static int MultibufferEventBase;
static int MultibufferErrorBase;
int MultibufferScreenIndex = -1;
int MultibufferWindowIndex = -1;
static void PerformDisplayRequest (
-#if NeedFunctionPrototypes
MultibuffersPtr * /* ppMultibuffers */,
MultibufferPtr * /* pMultibuffer */,
int /* nbuf */
-#endif
);
static Bool QueueDisplayRequest (
-#if NeedFunctionPrototypes
ClientPtr /* client */,
TimeStamp /* activateTime */
-#endif
);
static void BumpTimeStamp (
-#if NeedFunctionPrototypes
TimeStamp * /* ts */,
CARD32 /* inc */
-#endif
);
static void AliasMultibuffer (
-#if NeedFunctionPrototypes
MultibuffersPtr /* pMultibuffers */,
int /* i */
-#endif
);
static void RecalculateMultibufferOtherEvents (
-#if NeedFunctionPrototypes
MultibufferPtr /* pMultibuffer */
-#endif
);
static int EventSelectForMultibuffer(
-#if NeedFunctionPrototypes
MultibufferPtr /* pMultibuffer */,
ClientPtr /* client */,
Mask /* mask */
-#endif
);
/*
@@ -113,10 +103,8 @@ static int EventSelectForMultibuffer(
*/
RESTYPE MultibufferDrawableResType;
static int MultibufferDrawableDelete (
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
/*
* The per-buffer data can be found as a resource with this type.
@@ -125,10 +113,8 @@ static int MultibufferDrawableDelete (
*/
static RESTYPE MultibufferResType;
static int MultibufferDelete (
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
/*
@@ -137,10 +123,8 @@ static int MultibufferDelete (
*/
static RESTYPE MultibuffersResType;
static int MultibuffersDelete (
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
/*
@@ -149,10 +133,8 @@ static int MultibuffersDelete (
*/
static RESTYPE OtherClientResType;
static int OtherClientDelete (
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
/****************
@@ -187,44 +169,32 @@ static DISPATCH_PROC(SProcSetBufferAttributes);
static DISPATCH_PROC(SProcSetMBufferAttributes);
static void MultibufferResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static void SClobberNotifyEvent(
-#if NeedFunctionPrototypes
xMbufClobberNotifyEvent * /* from */,
xMbufClobberNotifyEvent * /* to */
-# endif
);
static void SUpdateNotifyEvent(
-#if NeedFunctionPrototypes
xMbufUpdateNotifyEvent * /* from */,
xMbufUpdateNotifyEvent * /* to */
-#endif
);
static Bool MultibufferPositionWindow(
-#if NeedFunctionPrototypes
WindowPtr /* pWin */,
int /* x */,
int /* y */
-#endif
);
static void SetupBackgroundPainter (
-#if NeedFunctionPrototypes
WindowPtr /* pWin */,
GCPtr /* pGC */
-#endif
);
static int DeliverEventsToMultibuffer (
-#if NeedFunctionPrototypes
MultibufferPtr /* pMultibuffer */,
xEvent * /* pEvents */,
int /* count */,
Mask /* filter */
-#endif
);
void
@@ -279,7 +249,9 @@ MultibufferExtensionInit()
ProcMultibufferDispatch, SProcMultibufferDispatch,
MultibufferResetProc, StandardMinorOpcode)))
{
+#if 0
MultibufferReqCode = (unsigned char)extEntry->base;
+#endif
MultibufferEventBase = extEntry->eventBase;
MultibufferErrorBase = extEntry->errorBase;
EventSwapVector[MultibufferEventBase + MultibufferClobberNotify] = (EventSwapPtr) SClobberNotifyEvent;
diff --git a/Xext/mbufbf.c b/Xext/mbufbf.c
index 925745712..99400c90a 100644
--- a/Xext/mbufbf.c
+++ b/Xext/mbufbf.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/mbufbf.c,v 3.4 2001/12/14 19:58:49 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/mbufbf.c,v 3.6 2003/11/10 18:21:42 tsi Exp $ */
/*
Copyright 1989, 1998 The Open Group
@@ -243,7 +243,7 @@ bufMultibufferInit(pScreen, pMBScreen)
pMBPriv->rgnChanged = TRUE;
REGION_INIT(pScreen, &pMBPriv->backBuffer, &box, 1);
REGION_INIT(pScreen, &pMBPriv->subtractRgn, &box, 1);
- REGION_INIT(pScreen, &pMBPriv->unionRgn, NullBox, 0);
+ REGION_NULL(pScreen, &pMBPriv->unionRgn);
/* Misc functions */
pMBPriv->CopyBufferBits = bufCopyBufferBitsFunc[pScreen->myNum];
@@ -778,7 +778,7 @@ bufPostValidateTree(pParent, pChild, kind)
pUnionRgn);
/* Paint gained and lost backbuffer areas in select plane */
- REGION_INIT(pScreen, &exposed, NullBox, 0);
+ REGION_NULL(pScreen, &exposed);
REGION_SUBTRACT(pScreen, &exposed, pSubtractRgn, pUnionRgn);
(* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane,
&exposed, FRONT_BUFFER);
@@ -793,33 +793,6 @@ bufPostValidateTree(pParent, pChild, kind)
}
}
-/* XXX - Knows region internals. */
-
-static Bool
-RegionsEqual(reg1, reg2)
- RegionPtr reg1;
- RegionPtr reg2;
-{
- int i;
- BoxPtr rects1, rects2;
-
- if (reg1->extents.x1 != reg2->extents.x1) return FALSE;
- if (reg1->extents.x2 != reg2->extents.x2) return FALSE;
- if (reg1->extents.y1 != reg2->extents.y1) return FALSE;
- if (reg1->extents.y2 != reg2->extents.y2) return FALSE;
- if (REGION_NUM_RECTS(reg1) != REGION_NUM_RECTS(reg2)) return FALSE;
-
- rects1 = REGION_RECTS(reg1);
- rects2 = REGION_RECTS(reg2);
- for (i = 0; i != REGION_NUM_RECTS(reg1); i++) {
- if (rects1[i].x1 != rects2[i].x1) return FALSE;
- if (rects1[i].x2 != rects2[i].x2) return FALSE;
- if (rects1[i].y1 != rects2[i].y1) return FALSE;
- if (rects1[i].y2 != rects2[i].y2) return FALSE;
- }
- return TRUE;
-}
-
/*
* If the window is multibuffered and displaying the backbuffer,
* add the old clipList to the subtractRgn and add the new clipList
@@ -849,7 +822,7 @@ bufClipNotify(pWin, dx,dy)
{
RegionPtr pOldClipList = (RegionPtr) pMBWindow->devPrivate.ptr;
- if (! RegionsEqual(pOldClipList, &pWin->clipList))
+ if (! REGION_EQUAL(pScreen, pOldClipList, &pWin->clipList))
{
if (pMBWindow->displayedMultibuffer == BACK_BUFFER)
{
@@ -940,8 +913,8 @@ bufWindowExposures(pWin, prgn, other_exposed)
/* miWindowExposures munges prgn and other_exposed. */
if (handleBuffers)
{
- REGION_INIT(pScreen, &tmp_rgn, NullBox, 0);
- REGION_COPY(pScreen, &tmp_rgn,prgn);
+ REGION_NULL(pScreen, &tmp_rgn);
+ REGION_COPY(pScreen, &tmp_rgn, prgn);
}
UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, WindowExposures);
diff --git a/Xext/mitmisc.c b/Xext/mitmisc.c
index b6038edba..b911d7ff5 100644
--- a/Xext/mitmisc.c
+++ b/Xext/mitmisc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/mitmisc.c,v 3.4 2001/12/14 19:58:49 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/mitmisc.c,v 3.7 2003/11/17 22:20:26 dawes Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -38,15 +38,16 @@ in this Software without prior written authorization from The Open Group.
#include "extnsionst.h"
#define _MITMISC_SERVER_
#include "mitmiscstr.h"
+#include "modinit.h"
extern Bool permitOldBugs;
+#if 0
static unsigned char MITReqCode;
+#endif
static void MITResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static DISPATCH_PROC(ProcMITDispatch);
@@ -57,14 +58,20 @@ static DISPATCH_PROC(SProcMITGetBugMode);
static DISPATCH_PROC(SProcMITSetBugMode);
void
-MITMiscExtensionInit()
+MITMiscExtensionInit(INITARGS)
{
+#if 0
ExtensionEntry *extEntry;
if ((extEntry = AddExtension(MITMISCNAME, 0, 0,
ProcMITDispatch, SProcMITDispatch,
MITResetProc, StandardMinorOpcode)) != 0)
MITReqCode = (unsigned char)extEntry->base;
+#else
+ (void) AddExtension(MITMISCNAME, 0, 0,
+ ProcMITDispatch, SProcMITDispatch,
+ MITResetProc, StandardMinorOpcode);
+#endif
}
/*ARGSUSED*/
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index fb0b9c541..89a8a2d2e 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -23,7 +23,7 @@ shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from Digital
Equipment Corporation.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/panoramiX.c,v 3.32 2002/08/01 00:30:34 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/panoramiX.c,v 3.38 2003/11/10 18:21:43 tsi Exp $ */
#define NEED_REPLIES
#include <stdio.h>
@@ -50,9 +50,12 @@ Equipment Corporation.
#ifdef RENDER
#include "picturestr.h"
#endif
+#include "modinit.h"
+#if 0
static unsigned char PanoramiXReqCode = 0;
+#endif
/*
* PanoramiX data declarations
*/
@@ -62,14 +65,13 @@ int PanoramiXPixHeight = 0;
int PanoramiXNumScreens = 0;
PanoramiXData *panoramiXdataPtr = NULL;
+RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
+static int PanoramiXNumDepths;
+static DepthPtr PanoramiXDepths;
+static int PanoramiXNumVisuals;
+static VisualPtr PanoramiXVisuals;
-RegionRec PanoramiXScreenRegion;
-
-int PanoramiXNumDepths;
-DepthPtr PanoramiXDepths;
-int PanoramiXNumVisuals;
-VisualPtr PanoramiXVisuals;
/* We support at most 256 visuals */
XID *PanoramiXVisualTable = NULL;
@@ -79,57 +81,23 @@ unsigned long XRT_PIXMAP;
unsigned long XRT_GC;
unsigned long XRT_COLORMAP;
-
-int (* SavedProcVector[256]) ();
-ScreenInfo *GlobalScrInfo;
-
-static int panoramiXGeneration;
-static int ProcPanoramiXDispatch();
/*
* Function prototypes
*/
+static int panoramiXGeneration;
+static int ProcPanoramiXDispatch(ClientPtr client);
+
static void PanoramiXResetProc(ExtensionEntry*);
/*
- * External references for data variables
+ * External references for functions and data variables
*/
-extern int SProcPanoramiXDispatch();
-extern char *ConnectionInfo;
-extern int connBlockScreenStart;
-extern xConnSetupPrefix connSetupPrefix;
-
-/*
- * Server dispatcher function replacements
- */
+#include "panoramiXh.h"
-int PanoramiXCreateWindow(), PanoramiXChangeWindowAttributes();
-int PanoramiXDestroyWindow(), PanoramiXDestroySubwindows();
-int PanoramiXChangeSaveSet(), PanoramiXReparentWindow();
-int PanoramiXMapWindow(), PanoramiXMapSubwindows();
-int PanoramiXUnmapWindow(), PanoramiXUnmapSubwindows();
-int PanoramiXConfigureWindow(), PanoramiXCirculateWindow();
-int PanoramiXGetGeometry(), PanoramiXTranslateCoords();
-int PanoramiXCreatePixmap(), PanoramiXFreePixmap();
-int PanoramiXCreateGC(), PanoramiXChangeGC();
-int PanoramiXCopyGC(), PanoramiXCopyColormapAndFree();
-int PanoramiXSetDashes(), PanoramiXSetClipRectangles();
-int PanoramiXFreeGC(), PanoramiXClearToBackground();
-int PanoramiXCopyArea(), PanoramiXCopyPlane();
-int PanoramiXPolyPoint(), PanoramiXPolyLine();
-int PanoramiXPolySegment(), PanoramiXPolyRectangle();
-int PanoramiXPolyArc(), PanoramiXFillPoly();
-int PanoramiXPolyFillArc(), PanoramiXPolyFillRectangle();
-int PanoramiXPutImage(), PanoramiXGetImage();
-int PanoramiXPolyText8(), PanoramiXPolyText16();
-int PanoramiXImageText8(), PanoramiXImageText16();
-int PanoramiXCreateColormap(), PanoramiXFreeColormap();
-int PanoramiXInstallColormap(), PanoramiXUninstallColormap();
-int PanoramiXAllocColor(), PanoramiXAllocNamedColor();
-int PanoramiXAllocColorCells(), PanoramiXStoreNamedColor();
-int PanoramiXFreeColors(), PanoramiXStoreColors();
-int PanoramiXAllocColorPlanes();
+int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
+ScreenInfo *GlobalScrInfo = NULL;
static int PanoramiXGCIndex = -1;
static int PanoramiXScreenIndex = -1;
@@ -460,7 +428,7 @@ void PanoramiXExtensionInit(int argc, char *argv[])
int i;
Bool success = FALSE;
ExtensionEntry *extEntry;
- ScreenPtr pScreen;
+ ScreenPtr pScreen = screenInfo.screens[0];
PanoramiXScreenPtr pScreenPriv;
int w, h;
@@ -483,7 +451,10 @@ void PanoramiXExtensionInit(int argc, char *argv[])
ErrorF("PanoramiXExtensionInit(): failed to AddExtension\n");
break;
}
+
+#if 0
PanoramiXReqCode = (unsigned char)extEntry->base;
+#endif
/*
* First make sure all the basic allocations succeed. If not,
@@ -539,14 +510,16 @@ void PanoramiXExtensionInit(int argc, char *argv[])
}
- REGION_INIT(pScreen, &PanoramiXScreenRegion, NullBox, 1);
+ REGION_NULL(pScreen, &PanoramiXScreenRegion);
for (i = 0; i < PanoramiXNumScreens; i++) {
BoxRec TheBox;
+ pScreen = screenInfo.screens[i];
+
panoramiXdataPtr[i].x = dixScreenOrigins[i].x;
panoramiXdataPtr[i].y = dixScreenOrigins[i].y;
- panoramiXdataPtr[i].width = (screenInfo.screens[i])->width;
- panoramiXdataPtr[i].height = (screenInfo.screens[i])->height;
+ panoramiXdataPtr[i].width = pScreen->width;
+ panoramiXdataPtr[i].height = pScreen->height;
TheBox.x1 = panoramiXdataPtr[i].x;
TheBox.x2 = TheBox.x1 + panoramiXdataPtr[i].width;
@@ -646,7 +619,6 @@ Bool PanoramiXCreateConnectionBlock(void)
int old_width, old_height;
float width_mult, height_mult;
xWindowRoot *root;
- xConnSetup *setup;
xVisualType *visual;
xDepth *depth;
VisualPtr pVisual;
@@ -692,7 +664,6 @@ Bool PanoramiXCreateConnectionBlock(void)
screenInfo.numScreens = i;
- setup = (xConnSetup *) ConnectionInfo;
root = (xWindowRoot *) (ConnectionInfo + connBlockScreenStart);
length = connBlockScreenStart + sizeof(xWindowRoot);
@@ -764,19 +735,54 @@ void PanoramiXConsolidate(void)
int i, j, k;
VisualPtr pVisual, pVisual2;
ScreenPtr pScreen, pScreen2;
- PanoramiXRes *root, *defmap;
+ DepthPtr pDepth, pDepth2;
+ PanoramiXRes *root, *defmap, *saver;
+ Bool foundDepth, missingDepth;
if(!PanoramiXVisualTable)
PanoramiXVisualTable = xcalloc(256 * MAXSCREENS, sizeof(XID));
pScreen = screenInfo.screens[0];
pVisual = pScreen->visuals;
+ pDepth = pScreen->allowedDepths;
PanoramiXNumDepths = 0;
PanoramiXDepths = xcalloc(pScreen->numDepths,sizeof(DepthRec));
PanoramiXNumVisuals = 0;
PanoramiXVisuals = xcalloc(pScreen->numVisuals,sizeof(VisualRec));
+ for (i = 0; i < pScreen->numDepths; i++, pDepth++) {
+ missingDepth = FALSE;
+ for (j = 1; j < PanoramiXNumScreens; j++) {
+ pScreen2 = screenInfo.screens[j];
+ pDepth2 = pScreen2->allowedDepths;
+
+ foundDepth = FALSE;
+ for (k = 0; k < pScreen2->numDepths; k++, pDepth2++) {
+ if(pDepth2->depth == pDepth->depth) {
+ foundDepth = TRUE;
+ break;
+ }
+ }
+
+ if(!foundDepth) {
+ missingDepth = TRUE;
+ break;
+ }
+ }
+
+ if(!missingDepth) {
+ PanoramiXDepths[PanoramiXNumDepths].depth = pDepth->depth;
+ PanoramiXDepths[PanoramiXNumDepths].numVids = 0;
+ if(pDepth->numVids)
+ PanoramiXDepths[PanoramiXNumDepths].vids =
+ xalloc(sizeof(VisualID) * pDepth->numVids);
+ else
+ PanoramiXDepths[PanoramiXNumDepths].vids = NULL;
+ PanoramiXNumDepths++;
+ }
+ }
+
for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
PanoramiXVisualTable[pVisual->vid * MAXSCREENS] = pVisual->vid;
@@ -796,23 +802,12 @@ void PanoramiXConsolidate(void)
(pVisual->offsetGreen == pVisual2->offsetGreen) &&
(pVisual->offsetBlue == pVisual2->offsetBlue))
{
- Bool AlreadyUsed = FALSE;
-#if 0
-/* Open GL should do this reduction, not us */
- for (l = 0; l < 256; l++) {
- if (pVisual2->vid ==
- PanoramiXVisualTable[(l * MAXSCREENS) + j])
- {
- AlreadyUsed = TRUE;
- break;
- }
- }
-#endif
- if (!AlreadyUsed) {
+ /* We merely assign the first visual that matches. OpenGL
+ will need to get involved at some point if you want
+ match GLX visuals */
PanoramiXVisualTable[(pVisual->vid * MAXSCREENS) + j] =
pVisual2->vid;
break;
- }
}
}
}
@@ -827,8 +822,6 @@ void PanoramiXConsolidate(void)
/* if it does, make sure it's in the list of supported depths and visuals */
if(PanoramiXVisualTable[pVisual->vid * MAXSCREENS]) {
- Bool GotIt = FALSE;
-
PanoramiXVisuals[PanoramiXNumVisuals].vid = pVisual->vid;
PanoramiXVisuals[PanoramiXNumVisuals].class = pVisual->class;
PanoramiXVisuals[PanoramiXNumVisuals].bitsPerRGBValue = pVisual->bitsPerRGBValue;
@@ -846,18 +839,9 @@ void PanoramiXConsolidate(void)
if (PanoramiXDepths[j].depth == pVisual->nplanes) {
PanoramiXDepths[j].vids[PanoramiXDepths[j].numVids] = pVisual->vid;
PanoramiXDepths[j].numVids++;
- GotIt = TRUE;
break;
}
}
-
- if (!GotIt) {
- PanoramiXDepths[PanoramiXNumDepths].depth = pVisual->nplanes;
- PanoramiXDepths[PanoramiXNumDepths].numVids = 1;
- PanoramiXDepths[PanoramiXNumDepths].vids = xalloc(sizeof(VisualID) * 256);
- PanoramiXDepths[PanoramiXNumDepths].vids[0] = pVisual->vid;
- PanoramiXNumDepths++;
- }
}
}
@@ -866,14 +850,22 @@ void PanoramiXConsolidate(void)
root->type = XRT_WINDOW;
defmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
defmap->type = XRT_COLORMAP;
+ saver = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes));
+ saver->type = XRT_WINDOW;
+
for (i = 0; i < PanoramiXNumScreens; i++) {
root->info[i].id = WindowTable[i]->drawable.id;
root->u.win.class = InputOutput;
+ root->u.win.root = TRUE;
+ saver->info[i].id = savedScreenInfo[i].wid;
+ saver->u.win.class = InputOutput;
+ saver->u.win.root = TRUE;
defmap->info[i].id = (screenInfo.screens[i])->defColormap;
}
AddResource(root->info[0].id, XRT_WINDOW, root);
+ AddResource(saver->info[0].id, XRT_WINDOW, saver);
AddResource(defmap->info[0].id, XRT_COLORMAP, defmap);
}
@@ -1134,6 +1126,7 @@ XineramaGetImageData(
BoxRec SrcBox, *pbox;
int x, y, w, h, i, j, nbox, size, sizeNeeded, ScratchPitch, inOut, depth;
DrawablePtr pDraw = pDrawables[0];
+ ScreenPtr pScreen = pDraw->pScreen;
char *ScratchMem = NULL;
size = 0;
@@ -1149,7 +1142,7 @@ XineramaGetImageData(
SrcBox.y2 = SrcBox.y1 + height;
REGION_INIT(pScreen, &SrcRegion, &SrcBox, 1);
- REGION_INIT(pScreen, &GrabRegion, NullBox, 1);
+ REGION_NULL(pScreen, &GrabRegion);
depth = (format == XYPixmap) ? 1 : pDraw->depth;
diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index 670a45364..d01b0b854 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -19,7 +19,7 @@
* or in FAR 52.227-19, as applicable. *
* *
*****************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.5 2001/01/03 02:54:17 keithp Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/panoramiX.h,v 1.6 2003/03/23 04:56:02 mvojkovi Exp $ */
/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
@@ -52,6 +52,7 @@ typedef struct {
struct {
char visibility;
char class;
+ char root;
} win;
struct {
Bool shared;
diff --git a/Xext/panoramiXSwap.c b/Xext/panoramiXSwap.c
index e78624187..e3ea803e6 100644
--- a/Xext/panoramiXSwap.c
+++ b/Xext/panoramiXSwap.c
@@ -23,7 +23,7 @@ shall not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from Digital
Equipment Corporation.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/panoramiXSwap.c,v 3.8 2001/08/23 13:01:36 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/panoramiXSwap.c,v 3.10 2003/09/13 21:33:03 dawes Exp $ */
#include <stdio.h>
#include "X.h"
@@ -47,28 +47,7 @@ Equipment Corporation.
#include "panoramiXproto.h"
#include "panoramiXsrv.h"
#include "globals.h"
-
-
-/*
- * External references for data variables
- */
-
-extern char *ConnectionInfo;
-extern int connBlockScreenStart;
-
-#if NeedFunctionPrototypes
-#define PROC_EXTERN(pfunc) extern int pfunc(ClientPtr)
-#else
-#define PROC_EXTERN(pfunc) extern int pfunc()
-#endif
-
-PROC_EXTERN(ProcPanoramiXQueryVersion);
-PROC_EXTERN(ProcPanoramiXGetState);
-PROC_EXTERN(ProcPanoramiXGetScreenCount);
-PROC_EXTERN(ProcPanoramiXGetScreenSize);
-
-PROC_EXTERN(ProcXineramaIsActive);
-PROC_EXTERN(ProcXineramaQueryScreens);
+#include "panoramiXh.h"
static int
SProcPanoramiXQueryVersion (ClientPtr client)
diff --git a/Xext/panoramiXh.h b/Xext/panoramiXh.h
new file mode 100644
index 000000000..d15fc8002
--- /dev/null
+++ b/Xext/panoramiXh.h
@@ -0,0 +1,78 @@
+/* $XFree86: xc/programs/Xserver/Xext/panoramiXh.h,v 1.3 2003/11/17 22:20:26 dawes Exp $ */
+
+/*
+ * Server dispatcher function replacements
+ */
+
+extern int PanoramiXCreateWindow(ClientPtr client);
+extern int PanoramiXChangeWindowAttributes(ClientPtr client);
+extern int PanoramiXDestroyWindow(ClientPtr client);
+extern int PanoramiXDestroySubwindows(ClientPtr client);
+extern int PanoramiXChangeSaveSet(ClientPtr client);
+extern int PanoramiXReparentWindow(ClientPtr client);
+extern int PanoramiXMapWindow(ClientPtr client);
+extern int PanoramiXMapSubwindows(ClientPtr client);
+extern int PanoramiXUnmapWindow(ClientPtr client);
+extern int PanoramiXUnmapSubwindows(ClientPtr client);
+extern int PanoramiXConfigureWindow(ClientPtr client);
+extern int PanoramiXCirculateWindow(ClientPtr client);
+extern int PanoramiXGetGeometry(ClientPtr client);
+extern int PanoramiXTranslateCoords(ClientPtr client);
+extern int PanoramiXCreatePixmap(ClientPtr client);
+extern int PanoramiXFreePixmap(ClientPtr client);
+extern int PanoramiXCreateGC(ClientPtr client);
+extern int PanoramiXChangeGC(ClientPtr client);
+extern int PanoramiXCopyGC(ClientPtr client);
+extern int PanoramiXCopyColormapAndFree(ClientPtr client);
+extern int PanoramiXSetDashes(ClientPtr client);
+extern int PanoramiXSetClipRectangles(ClientPtr client);
+extern int PanoramiXFreeGC(ClientPtr client);
+extern int PanoramiXClearToBackground(ClientPtr client);
+extern int PanoramiXCopyArea(ClientPtr client);
+extern int PanoramiXCopyPlane(ClientPtr client);
+extern int PanoramiXPolyPoint(ClientPtr client);
+extern int PanoramiXPolyLine(ClientPtr client);
+extern int PanoramiXPolySegment(ClientPtr client);
+extern int PanoramiXPolyRectangle(ClientPtr client);
+extern int PanoramiXPolyArc(ClientPtr client);
+extern int PanoramiXFillPoly(ClientPtr client);
+extern int PanoramiXPolyFillArc(ClientPtr client);
+extern int PanoramiXPolyFillRectangle(ClientPtr client);
+extern int PanoramiXPutImage(ClientPtr client);
+extern int PanoramiXGetImage(ClientPtr client);
+extern int PanoramiXPolyText8(ClientPtr client);
+extern int PanoramiXPolyText16(ClientPtr client);
+extern int PanoramiXImageText8(ClientPtr client);
+extern int PanoramiXImageText16(ClientPtr client);
+extern int PanoramiXCreateColormap(ClientPtr client);
+extern int PanoramiXFreeColormap(ClientPtr client);
+extern int PanoramiXInstallColormap(ClientPtr client);
+extern int PanoramiXUninstallColormap(ClientPtr client);
+extern int PanoramiXAllocColor(ClientPtr client);
+extern int PanoramiXAllocNamedColor(ClientPtr client);
+extern int PanoramiXAllocColorCells(ClientPtr client);
+extern int PanoramiXStoreNamedColor(ClientPtr client);
+extern int PanoramiXFreeColors(ClientPtr client);
+extern int PanoramiXStoreColors(ClientPtr client);
+extern int PanoramiXAllocColorPlanes(ClientPtr client);
+
+#define PROC_EXTERN(pfunc) extern int pfunc(ClientPtr)
+
+PROC_EXTERN(ProcPanoramiXQueryVersion);
+PROC_EXTERN(ProcPanoramiXGetState);
+PROC_EXTERN(ProcPanoramiXGetScreenCount);
+PROC_EXTERN(ProcPanoramiXGetScreenSize);
+
+PROC_EXTERN(ProcXineramaQueryScreens);
+PROC_EXTERN(ProcXineramaIsActive);
+extern Bool XineramaCreateGC(GCPtr pGC);
+
+extern int SProcPanoramiXDispatch(ClientPtr client);
+
+extern char *ConnectionInfo;
+extern int connBlockScreenStart;
+extern xConnSetupPrefix connSetupPrefix;
+
+extern ScreenInfo *GlobalScrInfo;
+extern int (* SavedProcVector[256]) (ClientPtr client);
+
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 37b54f4bc..73a441a88 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -26,7 +26,7 @@ Equipment Corporation.
/* Massively rewritten by Mark Vojkovich <markv@valinux.com> */
-/* $XFree86: xc/programs/Xserver/Xext/panoramiXprocs.c,v 3.33 2002/04/10 21:38:53 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/panoramiXprocs.c,v 3.37 2003/11/10 18:21:43 tsi Exp $ */
#include <stdio.h>
#include "X.h"
@@ -46,20 +46,21 @@ Equipment Corporation.
#include "panoramiX.h"
#include "panoramiXsrv.h"
#include "resource.h"
+#include "panoramiXh.h"
#define XINERAMA_IMAGE_BUFSIZE (256*1024)
#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
CWDontPropagate | CWOverrideRedirect | CWCursor )
-extern ScreenInfo *GlobalScrInfo;
-extern char *ConnectionInfo;
-extern int connBlockScreenStart;
+#if 0
+extern void (* EventSwapVector[128]) (fsError *, fsError *);
-extern int (* SavedProcVector[256]) ();
-extern void (* EventSwapVector[128]) ();
-extern void Swap32Write(), SLHostsExtend(), SQColorsExtend(),
+extern void Swap32Write();
+extern void SLHostsExtend();
+extern void SQColorsExtend();
WriteSConnectionInfo();
extern void WriteSConnSetupPrefix();
+#endif
/* Various of the DIX function interfaces were not designed to allow
* the client->errorValue to be set on BadValue and other errors.
@@ -131,6 +132,7 @@ int PanoramiXCreateWindow(ClientPtr client)
newWin->type = XRT_WINDOW;
newWin->u.win.visibility = VisibilityNotViewable;
newWin->u.win.class = stuff->class;
+ newWin->u.win.root = FALSE;
newWin->info[0].id = stuff->wid;
for(j = 1; j < PanoramiXNumScreens; j++)
newWin->info[j].id = FakeClientID(client->index);
@@ -140,7 +142,8 @@ int PanoramiXCreateWindow(ClientPtr client)
orig_visual = stuff->visual;
orig_x = stuff->x;
orig_y = stuff->y;
- parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id);
+ parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
+ (stuff->parent == savedScreenInfo[0].wid);
FOR_NSCREENS_BACKWARD(j) {
stuff->wid = newWin->info[j].id;
stuff->parent = parent->info[j].id;
@@ -329,7 +332,8 @@ int PanoramiXReparentWindow(ClientPtr client)
x = stuff->x;
y = stuff->y;
- parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id);
+ parentIsRoot = (stuff->parent == WindowTable[0]->drawable.id) ||
+ (stuff->parent == savedScreenInfo[0].wid);
FOR_NSCREENS_BACKWARD(j) {
stuff->window = win->info[j].id;
stuff->parent = parent->info[j].id;
@@ -468,7 +472,9 @@ int PanoramiXConfigureWindow(ClientPtr client)
}
}
- if(pWin->parent && (pWin->parent == WindowTable[0])) {
+ if(pWin->parent && ((pWin->parent == WindowTable[0]) ||
+ (pWin->parent->drawable.id == savedScreenInfo[0].wid)))
+ {
if ((Mask)stuff->mask & CWX) {
x_offset = 0;
x = *((CARD32 *)&stuff[1]);
@@ -548,7 +554,9 @@ int PanoramiXGetGeometry(ClientPtr client)
WindowPtr pWin = (WindowPtr)pDraw;
rep.x = pWin->origin.x - wBorderWidth (pWin);
rep.y = pWin->origin.y - wBorderWidth (pWin);
- if(pWin->parent == WindowTable[0]) {
+ if((pWin->parent == WindowTable[0]) ||
+ (pWin->parent->drawable.id == savedScreenInfo[0].wid))
+ {
rep.x += panoramiXdataPtr[0].x;
rep.y += panoramiXdataPtr[0].y;
}
@@ -582,7 +590,9 @@ int PanoramiXTranslateCoords(ClientPtr client)
rep.sameScreen = xTrue;
rep.child = None;
- if(pWin == WindowTable[0]) {
+ if((pWin == WindowTable[0]) ||
+ (pWin->drawable.id == savedScreenInfo[0].wid))
+ {
x = stuff->srcX - panoramiXdataPtr[0].x;
y = stuff->srcY - panoramiXdataPtr[0].y;
} else {
@@ -622,7 +632,9 @@ int PanoramiXTranslateCoords(ClientPtr client)
}
rep.dstX = x - pDst->drawable.x;
rep.dstY = y - pDst->drawable.y;
- if(pDst == WindowTable[0]) {
+ if((pDst == WindowTable[0]) ||
+ (pDst->drawable.id == savedScreenInfo[0].wid))
+ {
rep.dstX += panoramiXdataPtr[0].x;
rep.dstY += panoramiXdataPtr[0].y;
}
@@ -947,7 +959,7 @@ int PanoramiXClearToBackground(ClientPtr client)
x = stuff->x;
y = stuff->y;
- isRoot = (stuff->window == WindowTable[0]->drawable.id);
+ isRoot = win->u.win.root;
FOR_NSCREENS_BACKWARD(j) {
stuff->window = win->info[j].id;
if(isRoot) {
@@ -1002,11 +1014,9 @@ int PanoramiXCopyArea(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- if((dst->type == XRT_WINDOW) &&
- (stuff->dstDrawable == WindowTable[0]->drawable.id))
+ if((dst->type == XRT_WINDOW) && dst->u.win.root)
dstIsRoot = TRUE;
- if((src->type == XRT_WINDOW) &&
- (stuff->srcDrawable == WindowTable[0]->drawable.id))
+ if((src->type == XRT_WINDOW) && src->u.win.root)
srcIsRoot = TRUE;
srcx = stuff->srcX; srcy = stuff->srcY;
@@ -1095,7 +1105,7 @@ int PanoramiXCopyArea(ClientPtr client)
RegionRec totalReg;
Bool overlap;
- REGION_INIT(pScreen, &totalReg, NullBox, 1);
+ REGION_NULL(pScreen, &totalReg);
FOR_NSCREENS_BACKWARD(j) {
if(pRgn[j]) {
if(srcIsRoot) {
@@ -1152,11 +1162,9 @@ int PanoramiXCopyPlane(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- if((dst->type == XRT_WINDOW) &&
- (stuff->dstDrawable == WindowTable[0]->drawable.id))
+ if((dst->type == XRT_WINDOW) && dst->u.win.root)
dstIsRoot = TRUE;
- if((src->type == XRT_WINDOW) &&
- (stuff->srcDrawable == WindowTable[0]->drawable.id))
+ if((src->type == XRT_WINDOW) && src->u.win.root)
srcIsRoot = TRUE;
srcx = stuff->srcX; srcy = stuff->srcY;
@@ -1208,7 +1216,7 @@ int PanoramiXCopyPlane(ClientPtr client)
RegionRec totalReg;
Bool overlap;
- REGION_INIT(pScreen, &totalReg, NullBox, 1);
+ REGION_NULL(pScreen, &totalReg);
FOR_NSCREENS_BACKWARD(j) {
if(pRgn[j]) {
REGION_APPEND(pScreen, &totalReg, pRgn[j]);
@@ -1246,8 +1254,7 @@ int PanoramiXPolyPoint(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
if (npoint > 0) {
origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint));
@@ -1305,8 +1312,7 @@ int PanoramiXPolyLine(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
if (npoint > 0){
origPts = (xPoint *) ALLOCATE_LOCAL(npoint * sizeof(xPoint));
@@ -1364,8 +1370,7 @@ int PanoramiXPolySegment(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
if(nsegs & 4) return BadLength;
@@ -1427,8 +1432,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
if(nrects & 4) return BadLength;
@@ -1488,8 +1492,7 @@ int PanoramiXPolyArc(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
if(narcs % sizeof(xArc)) return BadLength;
@@ -1547,8 +1550,7 @@ int PanoramiXFillPoly(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
if (count > 0){
@@ -1607,8 +1609,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
if(things & 4) return BadLength;
@@ -1667,8 +1668,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
IF_RETURN((narcs % sizeof(xArc)), BadLength);
@@ -1726,8 +1726,7 @@ int PanoramiXPutImage(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
orig_x = stuff->dstX;
orig_y = stuff->dstY;
@@ -1786,8 +1785,7 @@ int PanoramiXGetImage(ClientPtr client)
format = stuff->format;
planemask = stuff->planeMask;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
if(isRoot) {
if( /* check for being onscreen */
@@ -1919,8 +1917,7 @@ PanoramiXPolyText8(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
orig_x = stuff->x;
orig_y = stuff->y;
@@ -1959,8 +1956,7 @@ PanoramiXPolyText16(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
orig_x = stuff->x;
orig_y = stuff->y;
@@ -1999,8 +1995,7 @@ int PanoramiXImageText8(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
orig_x = stuff->x;
orig_y = stuff->y;
@@ -2039,8 +2034,7 @@ int PanoramiXImageText16(ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
orig_x = stuff->x;
orig_y = stuff->y;
diff --git a/Xext/sampleEVI.c b/Xext/sampleEVI.c
index 43265a73d..15ed9401c 100644
--- a/Xext/sampleEVI.c
+++ b/Xext/sampleEVI.c
@@ -21,6 +21,8 @@ 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.
********************************************************/
+/* $XFree86: xc/programs/Xserver/Xext/sampleEVI.c,v 3.5 2003/07/16 01:38:29 dawes Exp $ */
+
#include "X.h"
#include "Xproto.h"
#include "dixstruct.h"
@@ -76,6 +78,7 @@ static int sampleGetVisualInfo(
*n_info_rn = sz_evi;
return Success;
}
+
static void sampleFreeVisualInfo(
xExtendedVisualInfo *evi,
VisualID32 *conflict)
@@ -85,13 +88,15 @@ static void sampleFreeVisualInfo(
if (conflict)
xfree(conflict);
}
-EviPrivPtr eviDDXInit()
+
+EviPrivPtr eviDDXInit(void)
{
static EviPrivRec eviPriv;
eviPriv.getVisualInfo = sampleGetVisualInfo;
eviPriv.freeVisualInfo = sampleFreeVisualInfo;
return &eviPriv;
}
-void eviDDXReset()
+
+void eviDDXReset(void)
{
}
diff --git a/Xext/saver.c b/Xext/saver.c
index 463622391..944009773 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -1,6 +1,5 @@
/*
* $XConsortium: saver.c,v 1.12 94/04/17 20:59:36 dpw Exp $
- * $XFree86: xc/programs/Xserver/Xext/saver.c,v 3.4 2001/08/23 13:01:36 alanh Exp $
*
Copyright (c) 1992 X Consortium
@@ -28,6 +27,8 @@ in this Software without prior written authorization from the X Consortium.
* Author: Keith Packard, MIT X Consortium
*/
+/* $XFree86: xc/programs/Xserver/Xext/saver.c,v 3.8 2003/11/17 22:20:26 dawes Exp $ */
+
#define NEED_REPLIES
#define NEED_EVENTS
#include "X.h"
@@ -45,6 +46,11 @@ in this Software without prior written authorization from the X Consortium.
#include "gcstruct.h"
#include "cursorstr.h"
#include "colormapst.h"
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
#ifdef IN_MODULE
#include <xf86_ansic.h>
@@ -52,7 +58,11 @@ in this Software without prior written authorization from the X Consortium.
#include <stdio.h>
#endif
+#include "modinit.h"
+
+#if 0
static unsigned char ScreenSaverReqCode = 0;
+#endif
static int ScreenSaverEventBase = 0;
extern DISPATCH_PROC(ProcScreenSaverQueryInfo);
@@ -69,52 +79,38 @@ static DISPATCH_PROC(SProcScreenSaverSetAttributes);
static DISPATCH_PROC(SProcScreenSaverUnsetAttributes);
static Bool ScreenSaverHandle (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */,
int /* xstate */,
Bool /* force */
-#endif
);
static Bool
CreateSaverWindow (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */
-#endif
);
static Bool
DestroySaverWindow (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */
-#endif
);
static void
UninstallSaverColormap (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */
-#endif
);
static void
CheckScreenPrivate (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */
-#endif
);
static void SScreenSaverNotifyEvent (
-#if NeedFunctionPrototypes
xScreenSaverNotifyEvent * /* from */,
xScreenSaverNotifyEvent * /* to */
-#endif
);
static void ScreenSaverResetProc (
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
/*
@@ -138,25 +134,19 @@ typedef struct _ScreenSaverEvent {
} ScreenSaverEventRec;
static int ScreenSaverFreeEvents(
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
static Bool setEventMask (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */,
ClientPtr /* client */,
unsigned long /* mask */
-#endif
);
static unsigned long getEventMask (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */,
ClientPtr /* client */
-#endif
);
/*
@@ -184,31 +174,23 @@ typedef struct _ScreenSaverAttr {
} ScreenSaverAttrRec, *ScreenSaverAttrPtr;
static int ScreenSaverFreeAttr (
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
static void FreeAttrs (
-#if NeedFunctionPrototypes
ScreenSaverAttrPtr /* pAttr */
-#endif
);
static void FreeScreenAttr (
-#if NeedFunctionPrototypes
ScreenSaverAttrPtr /* pAttr */
-#endif
);
static void
SendScreenSaverNotify (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */,
int /* state */,
Bool /* forced */
-#endif
);
typedef struct _ScreenSaverScreenPrivate {
@@ -220,9 +202,7 @@ typedef struct _ScreenSaverScreenPrivate {
static ScreenSaverScreenPrivatePtr
MakeScreenPrivate (
-#if NeedFunctionPrototypes
ScreenPtr /* pScreen */
-#endif
);
static int ScreenPrivateIndex;
@@ -242,7 +222,7 @@ static int ScreenPrivateIndex;
****************/
void
-ScreenSaverExtensionInit()
+ScreenSaverExtensionInit(INITARGS)
{
ExtensionEntry *extEntry;
int i;
@@ -261,7 +241,9 @@ ScreenSaverExtensionInit()
ProcScreenSaverDispatch, SProcScreenSaverDispatch,
ScreenSaverResetProc, StandardMinorOpcode)))
{
+#if 0
ScreenSaverReqCode = (unsigned char)extEntry->base;
+#endif
ScreenSaverEventBase = extEntry->eventBase;
EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
}
@@ -460,7 +442,6 @@ SendScreenSaverNotify (pScreen, state, forced)
xScreenSaverNotifyEvent ev;
ClientPtr client;
int kind;
- ScreenSaverStuffPtr pSaver;
UpdateCurrentTimeIf ();
mask = ScreenSaverNotifyMask;
@@ -470,7 +451,6 @@ SendScreenSaverNotify (pScreen, state, forced)
pPriv = GetScreenPrivate(pScreen);
if (!pPriv)
return;
- pSaver = &savedScreenInfo[pScreen->myNum];
if (pPriv->attr)
kind = ScreenSaverExternal;
else if (ScreenSaverBlanking != DontPreferBlanking)
@@ -696,7 +676,10 @@ ScreenSaverHandle (pScreen, xstate, force)
ret = TRUE;
}
- SendScreenSaverNotify (pScreen, state, force);
+#ifdef PANORAMIX
+ if(noPanoramiXExtension || !pScreen->myNum)
+#endif
+ SendScreenSaverNotify (pScreen, state, force);
return ret;
}
@@ -810,8 +793,7 @@ ProcScreenSaverSelectInput (client)
}
static int
-ProcScreenSaverSetAttributes (client)
- register ClientPtr client;
+ScreenSaverSetAttributes (ClientPtr client)
{
REQUEST(xScreenSaverSetAttributesReq);
DrawablePtr pDraw;
@@ -829,7 +811,6 @@ ProcScreenSaverSetAttributes (client)
WindowOptPtr ancwopt;
unsigned long *pVlist;
unsigned long *values = 0;
- int valuei;
unsigned long tmask, imask;
unsigned long val;
Pixmap pixID;
@@ -957,7 +938,6 @@ ProcScreenSaverSetAttributes (client)
ret = BadAlloc;
goto bail;
}
- valuei = 0;
pAttr->screen = pScreen;
pAttr->client = client;
pAttr->x = stuff->x;
@@ -1191,8 +1171,7 @@ bail:
}
static int
-ProcScreenSaverUnsetAttributes (client)
- register ClientPtr client;
+ScreenSaverUnsetAttributes (ClientPtr client)
{
REQUEST(xScreenSaverSetAttributesReq);
DrawablePtr pDraw;
@@ -1212,6 +1191,110 @@ ProcScreenSaverUnsetAttributes (client)
return Success;
}
+static int
+ProcScreenSaverSetAttributes (ClientPtr client)
+{
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ REQUEST(xScreenSaverSetAttributesReq);
+ PanoramiXRes *draw;
+ PanoramiXRes *backPix = NULL;
+ PanoramiXRes *bordPix = NULL;
+ PanoramiXRes *cmap = NULL;
+ int i, status = 0, len;
+ int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
+ XID orig_visual, tmp;
+
+ REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
+
+ if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
+ client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
+ return BadDrawable;
+
+ len = stuff->length - (sizeof(xScreenSaverSetAttributesReq) >> 2);
+ if (Ones(stuff->mask) != len)
+ return BadLength;
+
+ if((Mask)stuff->mask & CWBackPixmap) {
+ pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pback_offset);
+ if ((tmp != None) && (tmp != ParentRelative)) {
+ if(!(backPix = (PanoramiXRes*) SecurityLookupIDByType(
+ client, tmp, XRT_PIXMAP, SecurityReadAccess)))
+ return BadPixmap;
+ }
+ }
+
+ if ((Mask)stuff->mask & CWBorderPixmap) {
+ pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pbord_offset);
+ if (tmp != CopyFromParent) {
+ if(!(bordPix = (PanoramiXRes*) SecurityLookupIDByType(
+ client, tmp, XRT_PIXMAP, SecurityReadAccess)))
+ return BadPixmap;
+ }
+ }
+
+ if ((Mask)stuff->mask & CWColormap) {
+ cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1));
+ tmp = *((CARD32 *) &stuff[1] + cmap_offset);
+ if ((tmp != CopyFromParent) && (tmp != None)) {
+ if(!(cmap = (PanoramiXRes*) SecurityLookupIDByType(
+ client, tmp, XRT_COLORMAP, SecurityReadAccess)))
+ return BadColor;
+ }
+ }
+
+ orig_visual = stuff->visualID;
+
+ FOR_NSCREENS_BACKWARD(i) {
+ stuff->drawable = draw->info[i].id;
+ if (backPix)
+ *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[i].id;
+ if (bordPix)
+ *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[i].id;
+ if (cmap)
+ *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id;
+
+ if (orig_visual != CopyFromParent)
+ stuff->visualID =
+ PanoramiXVisualTable[(orig_visual*MAXSCREENS) + i];
+
+ status = ScreenSaverSetAttributes(client);
+ }
+
+ return status;
+ }
+#endif
+
+ return ScreenSaverSetAttributes(client);
+}
+
+static int
+ProcScreenSaverUnsetAttributes (ClientPtr client)
+{
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ REQUEST(xScreenSaverUnsetAttributesReq);
+ PanoramiXRes *draw;
+ int i;
+
+ if(!(draw = (PanoramiXRes *)SecurityLookupIDByClass(
+ client, stuff->drawable, XRC_DRAWABLE, SecurityWriteAccess)))
+ return BadDrawable;
+
+ for(i = PanoramiXNumScreens - 1; i > 0; i--) {
+ stuff->drawable = draw->info[i].id;
+ ScreenSaverUnsetAttributes(client);
+ }
+
+ stuff->drawable = draw->info[0].id;
+ }
+#endif
+
+ return ScreenSaverUnsetAttributes(client);
+}
+
static DISPATCH_PROC((*NormalVector[])) = {
ProcScreenSaverQueryVersion,
ProcScreenSaverQueryInfo,
diff --git a/Xext/security.c b/Xext/security.c
index 9af380dd6..568138e36 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -24,7 +24,7 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/Xext/security.c,v 1.11 2002/05/31 18:45:53 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/security.c,v 1.16 2003/11/17 22:20:26 dawes Exp $ */
#include "dixstruct.h"
#include "extnsionst.h"
@@ -56,6 +56,8 @@ extern unsigned char LbxReqCode;
#undef index
#endif
+#include "modinit.h"
+
static int SecurityErrorBase; /* first Security error number */
static int SecurityEventBase; /* first Security event number */
@@ -73,14 +75,10 @@ static RESTYPE RTEventClient;
* the extension can't be listed or queried.
*/
int (*UntrustedProcVector[256])(
-#if NeedNestedPrototypes
ClientPtr /*client*/
-#endif
);
int (*SwappedUntrustedProcVector[256])(
-#if NeedNestedPrototypes
ClientPtr /*client*/
-#endif
);
/* SecurityAudit
@@ -102,9 +100,8 @@ SecurityAudit(char *format, ...)
if (auditTrailLevel < SECURITY_AUDIT_LEVEL)
return;
- AuditPrefix(format);
va_start(args, format);
- VErrorF(format, args);
+ VAuditF(format, args);
va_end(args);
} /* SecurityAudit */
@@ -123,9 +120,9 @@ SecurityAudit(char *format, ...)
*/
static int
-SecurityDeleteAuthorization(value, id)
- pointer value;
- XID id;
+SecurityDeleteAuthorization(
+ pointer value,
+ XID id)
{
SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
unsigned short name_len, data_len;
@@ -141,6 +138,7 @@ SecurityDeleteAuthorization(value, id)
assert(status);
status = RemoveAuthorization(name_len, name, data_len, data);
assert(status);
+ (void)status;
/* free the auth timer if there is one */
@@ -181,9 +179,9 @@ SecurityDeleteAuthorization(value, id)
/* resource delete function for RTEventClient */
static int
-SecurityDeleteAuthorizationEventClient(value, id)
- pointer value;
- XID id;
+SecurityDeleteAuthorizationEventClient(
+ pointer value,
+ XID id)
{
OtherClientsPtr pEventClient, prev = NULL;
SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
@@ -223,9 +221,9 @@ SecurityDeleteAuthorizationEventClient(value, id)
*/
static CARD32
-SecurityComputeAuthorizationTimeout(pAuth, seconds)
- SecurityAuthorizationPtr pAuth;
- unsigned int seconds;
+SecurityComputeAuthorizationTimeout(
+ SecurityAuthorizationPtr pAuth,
+ unsigned int seconds)
{
/* maxSecs is the number of full seconds that can be expressed in
* 32 bits worth of milliseconds
@@ -264,10 +262,10 @@ SecurityComputeAuthorizationTimeout(pAuth, seconds)
*/
static CARD32
-SecurityAuthorizationExpired(timer, time, pval)
- OsTimerPtr timer;
- CARD32 time;
- pointer pval;
+SecurityAuthorizationExpired(
+ OsTimerPtr timer,
+ CARD32 time,
+ pointer pval)
{
SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval;
@@ -299,8 +297,8 @@ SecurityAuthorizationExpired(timer, time, pval)
*/
static void
-SecurityStartAuthorizationTimer(pAuth)
- SecurityAuthorizationPtr pAuth;
+SecurityStartAuthorizationTimer(
+ SecurityAuthorizationPtr pAuth)
{
pAuth->timer = TimerSet(pAuth->timer, 0,
SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout),
@@ -313,8 +311,8 @@ SecurityStartAuthorizationTimer(pAuth)
*/
static int
-ProcSecurityQueryVersion(client)
- ClientPtr client;
+ProcSecurityQueryVersion(
+ ClientPtr client)
{
/* REQUEST(xSecurityQueryVersionReq); */
xSecurityQueryVersionReply rep;
@@ -345,10 +343,10 @@ ProcSecurityQueryVersion(client)
static int
-SecurityEventSelectForAuthorization(pAuth, client, mask)
- SecurityAuthorizationPtr pAuth;
- ClientPtr client;
- Mask mask;
+SecurityEventSelectForAuthorization(
+ SecurityAuthorizationPtr pAuth,
+ ClientPtr client,
+ Mask mask)
{
OtherClients *pEventClient;
@@ -385,8 +383,8 @@ SecurityEventSelectForAuthorization(pAuth, client, mask)
static int
-ProcSecurityGenerateAuthorization(client)
- ClientPtr client;
+ProcSecurityGenerateAuthorization(
+ ClientPtr client)
{
REQUEST(xSecurityGenerateAuthorizationReq);
int len; /* request length in CARD32s*/
@@ -582,8 +580,8 @@ bailout:
} /* ProcSecurityGenerateAuthorization */
static int
-ProcSecurityRevokeAuthorization(client)
- ClientPtr client;
+ProcSecurityRevokeAuthorization(
+ ClientPtr client)
{
REQUEST(xSecurityRevokeAuthorizationReq);
SecurityAuthorizationPtr pAuth;
@@ -607,8 +605,8 @@ ProcSecurityRevokeAuthorization(client)
static int
-ProcSecurityDispatch(client)
- ClientPtr client;
+ProcSecurityDispatch(
+ ClientPtr client)
{
REQUEST(xReq);
@@ -626,8 +624,8 @@ ProcSecurityDispatch(client)
} /* ProcSecurityDispatch */
static int
-SProcSecurityQueryVersion(client)
- ClientPtr client;
+SProcSecurityQueryVersion(
+ ClientPtr client)
{
REQUEST(xSecurityQueryVersionReq);
register char n;
@@ -641,8 +639,8 @@ SProcSecurityQueryVersion(client)
static int
-SProcSecurityGenerateAuthorization(client)
- ClientPtr client;
+SProcSecurityGenerateAuthorization(
+ ClientPtr client)
{
REQUEST(xSecurityGenerateAuthorizationReq);
register char n;
@@ -664,8 +662,8 @@ SProcSecurityGenerateAuthorization(client)
static int
-SProcSecurityRevokeAuthorization(client)
- ClientPtr client;
+SProcSecurityRevokeAuthorization(
+ ClientPtr client)
{
REQUEST(xSecurityRevokeAuthorizationReq);
register char n;
@@ -678,8 +676,8 @@ SProcSecurityRevokeAuthorization(client)
static int
-SProcSecurityDispatch(client)
- ClientPtr client;
+SProcSecurityDispatch(
+ ClientPtr client)
{
REQUEST(xReq);
@@ -697,8 +695,9 @@ SProcSecurityDispatch(client)
} /* SProcSecurityDispatch */
static void
-SwapSecurityAuthorizationRevokedEvent(from, to)
- xSecurityAuthorizationRevokedEvent *from, *to;
+SwapSecurityAuthorizationRevokedEvent(
+ xSecurityAuthorizationRevokedEvent *from,
+ xSecurityAuthorizationRevokedEvent *to)
{
to->type = from->type;
to->detail = from->detail;
@@ -726,10 +725,10 @@ SwapSecurityAuthorizationRevokedEvent(from, to)
*/
static void
-SecurityDetermineEventPropogationLimits(dev, ppWin, ppStopWin)
- DeviceIntPtr dev;
- WindowPtr *ppWin;
- WindowPtr *ppStopWin;
+SecurityDetermineEventPropogationLimits(
+ DeviceIntPtr dev,
+ WindowPtr *ppWin,
+ WindowPtr *ppStopWin)
{
WindowPtr pFocusWin = dev->focus ? dev->focus->win : NoneWin;
@@ -896,9 +895,9 @@ SecurityCheckDeviceAccess(client, dev, fromRequest)
*/
static pointer
-SecurityAuditResourceIDAccess(client, id)
- ClientPtr client;
- XID id;
+SecurityAuditResourceIDAccess(
+ ClientPtr client,
+ XID id)
{
int cid = CLIENT_ID(id);
int reqtype = ((xReq *)client->requestBuffer)->reqType;
@@ -950,12 +949,12 @@ SecurityAuditResourceIDAccess(client, id)
*/
static pointer
-SecurityCheckResourceIDAccess(client, id, rtype, access_mode, rval)
- ClientPtr client;
- XID id;
- RESTYPE rtype;
- Mask access_mode;
- pointer rval;
+SecurityCheckResourceIDAccess(
+ ClientPtr client,
+ XID id,
+ RESTYPE rtype,
+ Mask access_mode,
+ pointer rval)
{
int cid = CLIENT_ID(id);
int reqtype = ((xReq *)client->requestBuffer)->reqType;
@@ -1116,10 +1115,10 @@ SecurityCheckResourceIDAccess(client, id, rtype, access_mode, rval)
*/
static void
-SecurityClientStateCallback(pcbl, nulldata, calldata)
- CallbackListPtr *pcbl;
- pointer nulldata;
- pointer calldata;
+SecurityClientStateCallback(
+ CallbackListPtr *pcbl,
+ pointer nulldata,
+ pointer calldata)
{
NewClientInfoRec *pci = (NewClientInfoRec *)calldata;
ClientPtr client = pci->client;
@@ -1220,6 +1219,7 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
unsigned int format;
char * pBuf;
{
+ ScreenPtr pScreen = pDraw->pScreen;
RegionRec imageRegion; /* region representing x,y,w,h */
RegionRec censorRegion; /* region to obliterate */
BoxRec imageBox;
@@ -1230,7 +1230,7 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
imageBox.x2 = x + w;
imageBox.y2 = y + h;
REGION_INIT(pScreen, &imageRegion, &imageBox, 1);
- REGION_INIT(pScreen, &censorRegion, NullBox, 0);
+ REGION_NULL(pScreen, &censorRegion);
/* censorRegion = imageRegion - visibleRegion */
REGION_SUBTRACT(pScreen, &censorRegion, &imageRegion, pVisibleRegion);
@@ -1348,7 +1348,7 @@ static char *SecurityKeywords[] = {
/*#define PROPDEBUG 1*/
static void
-SecurityFreePropertyAccessList()
+SecurityFreePropertyAccessList(void)
{
while (PropertyAccessList)
{
@@ -1365,8 +1365,8 @@ SecurityFreePropertyAccessList()
#endif
static char *
-SecuritySkipWhitespace(p)
- char *p;
+SecuritySkipWhitespace(
+ char *p)
{
while (SecurityIsWhitespace(*p))
p++;
@@ -1375,8 +1375,8 @@ SecuritySkipWhitespace(p)
static char *
-SecurityParseString(rest)
- char **rest;
+SecurityParseString(
+ char **rest)
{
char *startOfString;
char *s = *rest;
@@ -1412,8 +1412,8 @@ SecurityParseString(rest)
static int
-SecurityParseKeyword(p)
- char **p;
+SecurityParseKeyword(
+ char **p)
{
int i;
char *s = *p;
@@ -1433,8 +1433,8 @@ SecurityParseKeyword(p)
static Bool
-SecurityParsePropertyAccessRule(p)
- char *p;
+SecurityParsePropertyAccessRule(
+ char *p)
{
char *propname;
char c;
@@ -1574,8 +1574,8 @@ static char **SecurityPolicyStrings = NULL;
static int nSecurityPolicyStrings = 0;
static Bool
-SecurityParseSitePolicy(p)
- char *p;
+SecurityParseSitePolicy(
+ char *p)
{
char *policyStr = SecurityParseString(&p);
char *copyPolicyStr;
@@ -1613,7 +1613,7 @@ SecurityGetSitePolicyStrings(n)
} /* SecurityGetSitePolicyStrings */
static void
-SecurityFreeSitePolicyStrings()
+SecurityFreeSitePolicyStrings(void)
{
if (SecurityPolicyStrings)
{
@@ -1630,7 +1630,7 @@ SecurityFreeSitePolicyStrings()
static void
-SecurityLoadPropertyAccessList()
+SecurityLoadPropertyAccessList(void)
{
FILE *f;
int lineNumber = 0;
@@ -1732,9 +1732,9 @@ SecurityLoadPropertyAccessList()
static Bool
-SecurityMatchString(ws, cs)
- char *ws;
- char *cs;
+SecurityMatchString(
+ char *ws,
+ char *cs)
{
while (*ws && *cs)
{
@@ -1908,8 +1908,8 @@ SecurityCheckPropertyAccess(client, pWin, propertyName, access_mode)
*/
static void
-SecurityResetProc(extEntry)
- ExtensionEntry *extEntry;
+SecurityResetProc(
+ ExtensionEntry *extEntry)
{
SecurityFreePropertyAccessList();
SecurityFreeSitePolicyStrings();
@@ -1944,7 +1944,7 @@ XSecurityOptions(argc, argv, i)
*/
void
-SecurityExtensionInit()
+SecurityExtensionInit(INITARGS)
{
ExtensionEntry *extEntry;
int i;
diff --git a/Xext/shape.c b/Xext/shape.c
index 7bd161dcc..956a8ebfc 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.16 2001/12/14 19:58:50 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/shape.c,v 3.19 2003/11/17 22:20:26 dawes Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -46,45 +46,33 @@ in this Software without prior written authorization from The Open Group.
#ifdef EXTMODULE
#include "xf86_ansic.h"
#endif
+#include "modinit.h"
typedef RegionPtr (*CreateDftPtr)(
-#if NeedNestedPrototypes
WindowPtr /* pWin */
-#endif
);
static int ShapeFreeClient(
-#if NeedFunctionPrototypes
pointer /* data */,
XID /* id */
-#endif
);
static int ShapeFreeEvents(
-#if NeedFunctionPrototypes
pointer /* data */,
XID /* id */
-#endif
);
static void SendShapeNotify(
-#if NeedFunctionPrototypes
WindowPtr /* pWin */,
int /* which */
-#endif
);
static void ShapeResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static void SShapeNotifyEvent(
-#if NeedFunctionPrototypes
xShapeNotifyEvent * /* from */,
xShapeNotifyEvent * /* to */
-#endif
);
static int
RegionOperate (
-#if NeedFunctionPrototypes
ClientPtr /* client */,
WindowPtr /* pWin */,
int /* kind */,
@@ -94,14 +82,9 @@ RegionOperate (
int /* xoff */,
int /* yoff */,
CreateDftPtr /* create */
-#endif
);
-#if NeedFunctionPrototypes
#define CREATE_PROC(func) RegionPtr func(WindowPtr /* pWin */)
-#else
-#define CREATE_PROC(func) RegionPtr func(/* WindowPtr pWin */)
-#endif
static CREATE_PROC(CreateBoundingShape);
static CREATE_PROC(CreateClipShape);
@@ -134,7 +117,9 @@ static DISPATCH_PROC(SProcShapeSelectInput);
#include "panoramiXsrv.h"
#endif
+#if 0
static unsigned char ShapeReqCode = 0;
+#endif
static int ShapeEventBase = 0;
static RESTYPE ClientType, EventType; /* resource types for event masks */
@@ -164,7 +149,7 @@ typedef struct _ShapeEvent {
****************/
void
-ShapeExtensionInit()
+ShapeExtensionInit(INITARGS)
{
ExtensionEntry *extEntry;
@@ -175,7 +160,9 @@ ShapeExtensionInit()
ProcShapeDispatch, SProcShapeDispatch,
ShapeResetProc, StandardMinorOpcode)))
{
+#if 0
ShapeReqCode = (unsigned char)extEntry->base;
+#endif
ShapeEventBase = extEntry->eventBase;
EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
}
@@ -390,8 +377,8 @@ ProcShapeRectangles (client)
#ifdef PANORAMIX
static int
-ProcPanoramiXShapeRectangles (client)
- register ClientPtr client;
+ProcPanoramiXShapeRectangles(
+ register ClientPtr client)
{
REQUEST(xShapeRectanglesReq);
PanoramiXRes *win;
@@ -479,8 +466,8 @@ ProcShapeMask (client)
#ifdef PANORAMIX
static int
-ProcPanoramiXShapeMask (client)
- register ClientPtr client;
+ProcPanoramiXShapeMask(
+ register ClientPtr client)
{
REQUEST(xShapeMaskReq);
PanoramiXRes *win, *pmap;
@@ -594,8 +581,8 @@ ProcShapeCombine (client)
#ifdef PANORAMIX
static int
-ProcPanoramiXShapeCombine (client)
- register ClientPtr client;
+ProcPanoramiXShapeCombine(
+ register ClientPtr client)
{
REQUEST(xShapeCombineReq);
PanoramiXRes *win, *win2;
@@ -663,8 +650,8 @@ ProcShapeOffset (client)
#ifdef PANORAMIX
static int
-ProcPanoramiXShapeOffset (client)
- register ClientPtr client;
+ProcPanoramiXShapeOffset(
+ register ClientPtr client)
{
REQUEST(xShapeOffsetReq);
PanoramiXRes *win;
diff --git a/Xext/shm.c b/Xext/shm.c
index 3ba9ad2c1..9591eab54 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.36 2002/04/03 19:51:11 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/shm.c,v 3.40 2003/11/17 22:20:27 dawes Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -29,6 +29,8 @@ in this Software without prior written authorization from The Open Group.
/* $Xorg: shm.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */
+#define SHM
+
#include <sys/types.h>
#ifndef Lynx
#include <sys/ipc.h>
@@ -65,6 +67,8 @@ in this Software without prior written authorization from The Open Group.
#include "panoramiXsrv.h"
#endif
+#include "modinit.h"
+
typedef struct _ShmDesc {
struct _ShmDesc *next;
int shmid;
@@ -78,21 +82,15 @@ static void miShmPutImage(XSHM_PUT_IMAGE_ARGS);
static void fbShmPutImage(XSHM_PUT_IMAGE_ARGS);
static PixmapPtr fbShmCreatePixmap(XSHM_CREATE_PIXMAP_ARGS);
static int ShmDetachSegment(
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* shmseg */
-#endif
);
static void ShmResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static void SShmCompletionEvent(
-#if NeedFunctionPrototypes
xShmCompletionEvent * /* from */,
xShmCompletionEvent * /* to */
-#endif
);
static Bool ShmDestroyPixmap (PixmapPtr pPixmap);
@@ -159,7 +157,7 @@ static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
}
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__)
#include <sys/signal.h>
static Bool badSysCall = FALSE;
@@ -181,23 +179,32 @@ static Bool CheckForShmSyscall()
badSysCall = FALSE;
shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
- /* Clean up */
+
if (shmid != -1)
{
+ /* Successful allocation - clean up */
shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
}
+ else
+ {
+ /* Allocation failed */
+ badSysCall = TRUE;
+ }
signal(SIGSYS, oldHandler);
return(!badSysCall);
}
+
+#define MUST_CHECK_FOR_SHM_SYSCALL
+
#endif
-
+
void
-ShmExtensionInit()
+ShmExtensionInit(INITARGS)
{
ExtensionEntry *extEntry;
int i;
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#ifdef MUST_CHECK_FOR_SHM_SYSCALL
if (!CheckForShmSyscall())
{
ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
@@ -270,17 +277,17 @@ ExtensionEntry *extEntry;
}
void
-ShmRegisterFuncs(pScreen, funcs)
- ScreenPtr pScreen;
- ShmFuncsPtr funcs;
+ShmRegisterFuncs(
+ ScreenPtr pScreen,
+ ShmFuncsPtr funcs)
{
shmFuncs[pScreen->myNum] = funcs;
}
void
-ShmSetPixmapFormat(pScreen, format)
- ScreenPtr pScreen;
- int format;
+ShmSetPixmapFormat(
+ ScreenPtr pScreen,
+ int format)
{
shmPixFormat[pScreen->myNum] = format;
}
@@ -572,8 +579,7 @@ ProcPanoramiXShmPutImage(register ClientPtr client)
client, stuff->gc, XRT_GC, SecurityReadAccess)))
return BadGC;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
orig_x = stuff->dstX;
orig_y = stuff->dstY;
@@ -633,8 +639,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
format = stuff->format;
planemask = stuff->planeMask;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
if(isRoot) {
if( /* check for being onscreen */
@@ -709,8 +714,8 @@ ProcPanoramiXShmGetImage(ClientPtr client)
}
static int
-ProcPanoramiXShmCreatePixmap(client)
- register ClientPtr client;
+ProcPanoramiXShmCreatePixmap(
+ register ClientPtr client)
{
ScreenPtr pScreen = NULL;
PixmapPtr pMap = NULL;
diff --git a/Xext/sleepuntil.c b/Xext/sleepuntil.c
index eb2b96a76..afde19cba 100644
--- a/Xext/sleepuntil.c
+++ b/Xext/sleepuntil.c
@@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group.
*
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.c,v 3.5 2001/12/14 19:58:51 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.c,v 3.7 2003/11/17 22:20:27 dawes Exp $ */
/* dixsleep.c - implement millisecond timeouts for X clients */
@@ -44,10 +44,8 @@ typedef struct _Sertafied {
ClientPtr pClient;
XID id;
void (*notifyFunc)(
-#if NeedNestedPrototypes
ClientPtr /* client */,
pointer /* closure */
-#endif
);
pointer closure;
@@ -59,37 +57,31 @@ static Bool BlockHandlerRegistered;
static int SertafiedGeneration;
static void ClientAwaken(
-#if NeedFunctionPrototypes
ClientPtr /* client */,
pointer /* closure */
-#endif
);
static int SertafiedDelete(
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
static void SertafiedBlockHandler(
-#if NeedFunctionPrototypes
pointer /* data */,
OSTimePtr /* wt */,
pointer /* LastSelectMask */
-#endif
);
static void SertafiedWakeupHandler(
-#if NeedFunctionPrototypes
pointer /* data */,
int /* i */,
pointer /* LastSelectMask */
-#endif
);
int
ClientSleepUntil (client, revive, notifyFunc, closure)
ClientPtr client;
TimeStamp *revive;
- void (*notifyFunc)();
+ void (*notifyFunc)(
+ ClientPtr /* client */,
+ pointer /* closure */);
pointer closure;
{
SertafiedPtr pRequest, pReq, pPrev;
diff --git a/Xext/sleepuntil.h b/Xext/sleepuntil.h
index 29d761a0e..f8fcc6cb9 100644
--- a/Xext/sleepuntil.h
+++ b/Xext/sleepuntil.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.h,v 1.1 2001/08/01 00:44:44 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/sleepuntil.h,v 1.2 2003/11/17 22:20:27 dawes Exp $ */
/*
* Copyright (C) 2001 The XFree86 Project, Inc. All Rights Reserved.
*
@@ -31,17 +31,13 @@
#include "dix.h"
extern int ClientSleepUntil(
-#if NeedFunctionPrototypes
ClientPtr client,
TimeStamp *revive,
void (*notifyFunc)(
-#if NeedNestedPrototypes
ClientPtr /* client */,
pointer /* closure */
-#endif
),
pointer Closure
-#endif
);
#endif
diff --git a/Xext/sync.c b/Xext/sync.c
index 079a804e3..25d360bfa 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -50,7 +50,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/Xext/sync.c,v 3.11 2001/12/14 19:58:51 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/sync.c,v 3.14 2003/11/17 22:20:27 dawes Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
@@ -76,10 +76,11 @@ PERFORMANCE OF THIS SOFTWARE.
#endif
#endif
+#include "modinit.h"
+
/*
* Local Global Variables
*/
-static int SyncReqCode;
static int SyncEventBase;
static int SyncErrorBase;
static RESTYPE RTCounter = 0;
@@ -98,219 +99,165 @@ static SyncCounter **SysCounterList = NULL;
static int
FreeAlarm(
-#if NeedFunctionPrototypes
pointer /* addr */,
XID /* id */
-#endif
);
static int
FreeAlarmClient(
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
static int
FreeAwait(
-#if NeedFunctionPrototypes
pointer /* addr */,
XID /* id */
-#endif
);
static void
ServertimeBracketValues(
-#if NeedFunctionPrototypes
pointer /* pCounter */,
CARD64 * /* pbracket_less */,
CARD64 * /* pbracket_greater */
-#endif
);
static void
ServertimeQueryValue(
-#if NeedFunctionPrototypes
pointer /* pCounter */,
CARD64 * /* pValue_return */
-#endif
);
static void
ServertimeWakeupHandler(
-#if NeedFunctionPrototypes
pointer /* env */,
int /* rc */,
pointer /* LastSelectMask */
-#endif
);
static int
SyncInitTrigger(
-#if NeedFunctionPrototypes
ClientPtr /* client */,
SyncTrigger * /* pTrigger */,
XSyncCounter /* counter */,
Mask /* changes */
-#endif
);
static void
SAlarmNotifyEvent(
-#if NeedFunctionPrototypes
xSyncAlarmNotifyEvent * /* from */,
xSyncAlarmNotifyEvent * /* to */
-#endif
);
static void
SCounterNotifyEvent(
-#if NeedFunctionPrototypes
xSyncCounterNotifyEvent * /* from */,
xSyncCounterNotifyEvent * /* to */
-#endif
);
static void
ServertimeBlockHandler(
-#if NeedFunctionPrototypes
pointer /* env */,
struct timeval ** /* wt */,
pointer /* LastSelectMask */
-#endif
);
static int
SyncAddTriggerToCounter(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */
-#endif
);
extern void
SyncAlarmCounterDestroyed(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */
-#endif
);
static void
SyncAlarmTriggerFired(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */
-#endif
);
static void
SyncAwaitTriggerFired(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */
-#endif
);
static int
SyncChangeAlarmAttributes(
-#if NeedFunctionPrototypes
ClientPtr /* client */,
SyncAlarm * /* pAlarm */,
Mask /* mask */,
CARD32 * /* values */
-#endif
);
static Bool
SyncCheckTriggerNegativeComparison(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */,
CARD64 /* oldval */
-#endif
);
static Bool
SyncCheckTriggerNegativeTransition(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */,
CARD64 /* oldval */
-#endif
);
static Bool
SyncCheckTriggerPositiveComparison(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */,
CARD64 /* oldval */
-#endif
);
static Bool
SyncCheckTriggerPositiveTransition(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */,
CARD64 /* oldval */
-#endif
);
static SyncCounter *
SyncCreateCounter(
-#if NeedFunctionPrototypes
ClientPtr /* client */,
XSyncCounter /* id */,
CARD64 /* initialvalue */
-#endif
);
static void SyncComputeBracketValues(
-#if NeedFunctionPrototypes
SyncCounter * /* pCounter */,
Bool /* startOver */
-#endif
);
static void
SyncDeleteTriggerFromCounter(
-#if NeedFunctionPrototypes
SyncTrigger * /* pTrigger */
-#endif
);
static Bool
SyncEventSelectForAlarm(
-#if NeedFunctionPrototypes
SyncAlarm * /* pAlarm */,
ClientPtr /* client */,
Bool /* wantevents */
-#endif
);
static void
SyncInitServerTime(
-#if NeedFunctionPrototypes
void
-#endif
);
static void
SyncResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static void
SyncSendAlarmNotifyEvents(
-#if NeedFunctionPrototypes
SyncAlarm * /* pAlarm */
-#endif
);
static void
SyncSendCounterNotifyEvents(
-#if NeedFunctionPrototypes
ClientPtr /* client */,
SyncAwait ** /* ppAwait */,
int /* num_events */
-#endif
);
static DISPATCH_PROC(ProcSyncAwait);
@@ -1081,10 +1028,8 @@ SyncCreateCounter(client, id, initialvalue)
}
static int FreeCounter(
-#if NeedFunctionPrototypes
pointer /*env*/,
XID /*id*/
-#endif
);
/*
@@ -1098,8 +1043,13 @@ SyncCreateSystemCounter(name, initial, resolution, counterType,
CARD64 initial;
CARD64 resolution;
SyncCounterType counterType;
- void (*QueryValue) ();
- void (*BracketValues) ();
+ void (*QueryValue) (
+ pointer /* pCounter */,
+ CARD64 * /* pValue_return */);
+ void (*BracketValues) (
+ pointer /* pCounter */,
+ CARD64 * /* pbracket_less */,
+ CARD64 * /* pbracket_greater */);
{
SyncCounter *pCounter;
@@ -1588,6 +1538,8 @@ ProcSyncSetCounter(client)
SyncCounter *pCounter;
CARD64 newvalue;
+ REQUEST_SIZE_MATCH(xSyncSetCounterReq);
+
pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->cid,
RTCounter, SecurityWriteAccess);
if (pCounter == NULL)
@@ -2031,12 +1983,11 @@ static int
ProcSyncDestroyAlarm(client)
ClientPtr client;
{
- SyncAlarm *pAlarm;
REQUEST(xSyncDestroyAlarmReq);
REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
- if (!(pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm,
+ if (!((SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm,
RTAlarm, SecurityDestroyAccess)))
{
client->errorValue = stuff->alarm;
@@ -2399,7 +2350,7 @@ SyncResetProc(extEntry)
* ** Initialise the extension.
*/
void
-SyncExtensionInit()
+SyncExtensionInit(INITARGS)
{
ExtensionEntry *extEntry;
@@ -2424,7 +2375,6 @@ SyncExtensionInit()
return;
}
- SyncReqCode = extEntry->base;
SyncEventBase = extEntry->eventBase;
SyncErrorBase = extEntry->errorBase;
EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent;
@@ -2488,6 +2438,7 @@ pointer LastSelectMask;
{
Bool overflow;
XSyncValueSubtract(&delay, *pnext_time, Now, &overflow);
+ (void)overflow;
timeout = XSyncValueLow32(delay);
}
AdjustWaitForDelay(wt, timeout); /* os/utils.c */
diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c
index 1d3b416db..b31057a0d 100644
--- a/Xext/xcmisc.c
+++ b/Xext/xcmisc.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/Xext/xcmisc.c,v 3.5 2001/12/14 19:58:51 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xcmisc.c,v 3.8 2003/11/17 22:20:27 dawes Exp $ */
#define NEED_EVENTS
#define NEED_REPLIES
@@ -38,13 +38,14 @@ from The Open Group.
#include "extnsionst.h"
#include "swaprep.h"
#include "xcmiscstr.h"
+#include "modinit.h"
+#if 0
static unsigned char XCMiscCode;
+#endif
static void XCMiscResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static DISPATCH_PROC(ProcXCMiscDispatch);
@@ -57,14 +58,21 @@ static DISPATCH_PROC(SProcXCMiscGetXIDList);
static DISPATCH_PROC(SProcXCMiscGetXIDRange);
void
-XCMiscExtensionInit()
+XCMiscExtensionInit(INITARGS)
{
+#if 0
ExtensionEntry *extEntry;
if ((extEntry = AddExtension(XCMiscExtensionName, 0, 0,
ProcXCMiscDispatch, SProcXCMiscDispatch,
XCMiscResetProc, StandardMinorOpcode)) != 0)
XCMiscCode = (unsigned char)extEntry->base;
+#else
+ (void) AddExtension(XCMiscExtensionName, 0, 0,
+ ProcXCMiscDispatch, SProcXCMiscDispatch,
+ XCMiscResetProc, StandardMinorOpcode);
+#endif
+
DeclareExtensionSecurity(XCMiscExtensionName, TRUE);
}
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index 38fac9450..1da665af0 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.13 2001/06/30 22:41:44 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xf86bigfont.c,v 1.18 2003/11/17 22:20:27 dawes Exp $ */
/*
* BIGFONT extension for sharing font metrics between clients (if possible)
* and for transmitting font metrics to clients in a compressed form.
@@ -73,9 +73,7 @@
#include "xf86bigfstr.h"
static void XF86BigfontResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static DISPATCH_PROC(ProcXF86BigfontDispatch);
@@ -85,7 +83,9 @@ static DISPATCH_PROC(SProcXF86BigfontDispatch);
static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
static DISPATCH_PROC(SProcXF86BigfontQueryFont);
+#if 0
static unsigned char XF86BigfontReqCode;
+#endif
#ifdef HAS_SHM
@@ -112,9 +112,10 @@ SigSysHandler(
badSysCall = TRUE;
}
-static Bool CheckForShmSyscall()
+static Bool
+CheckForShmSyscall(void)
{
- void (*oldHandler)();
+ void (*oldHandler)(int);
int shmid = -1;
/* If no SHM support in the kernel, the bad syscall will generate SIGSYS */
@@ -122,10 +123,16 @@ static Bool CheckForShmSyscall()
badSysCall = FALSE;
shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT);
- /* Clean up */
- if (shmid != -1) {
+ if (shmid != -1)
+ {
+ /* Successful allocation - clean up */
shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
}
+ else
+ {
+ /* Allocation failed */
+ badSysCall = TRUE;
+ }
signal(SIGSYS, oldHandler);
return (!badSysCall);
}
@@ -139,6 +146,7 @@ static Bool CheckForShmSyscall()
void
XFree86BigfontExtensionInit()
{
+#if 0
ExtensionEntry* extEntry;
if ((extEntry = AddExtension(XF86BIGFONTNAME,
@@ -149,10 +157,25 @@ XFree86BigfontExtensionInit()
XF86BigfontResetProc,
StandardMinorOpcode))) {
XF86BigfontReqCode = (unsigned char) extEntry->base;
+#else
+ if (AddExtension(XF86BIGFONTNAME,
+ XF86BigfontNumberEvents,
+ XF86BigfontNumberErrors,
+ ProcXF86BigfontDispatch,
+ SProcXF86BigfontDispatch,
+ XF86BigfontResetProc,
+ StandardMinorOpcode)) {
+#endif
#ifdef HAS_SHM
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
+ /*
+ * Note: Local-clients will not be optimized without shared memory
+ * support. Remote-client optimization does not depend on shared
+ * memory support. Thus, the extension is still registered even
+ * when shared memory support is not functional.
+ */
if (!CheckForShmSyscall()) {
- ErrorF(XF86BIGFONTNAME " extension disabled due to lack of shared memory support in the kernel\n");
+ ErrorF(XF86BIGFONTNAME " extension local-client optimization disabled due to lack of shared memory support in the kernel\n");
return;
}
#endif
diff --git a/Xext/xprint.c b/Xext/xprint.c
index db9a25135..e50fb4068 100644
--- a/Xext/xprint.c
+++ b/Xext/xprint.c
@@ -64,7 +64,7 @@ copyright holders.
** *********************************************************
**
********************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xprint.c,v 1.13 2001/11/23 19:21:31 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xprint.c,v 1.15 2003/10/28 23:08:44 tsi Exp $ */
#define _XP_PRINT_SERVER_
#include "X.h"
@@ -83,6 +83,7 @@ copyright holders.
#include "Printstr.h"
#include "../Xprint/DiPrint.h"
#include "../Xprint/attributes.h"
+#include "modinit.h"
static void XpResetProc(ExtensionEntry *);
@@ -282,7 +283,7 @@ static CARD32 allEvents = XPPrintMask | XPAttributeMask;
*/
void
-XpExtensionInit(void)
+XpExtensionInit(INITARGS)
{
ExtensionEntry *extEntry;
int i;
@@ -753,15 +754,17 @@ ProcXpGetPageDimensions(ClientPtr client)
return XpErrorBase+XPBadContext;
}
- if(pContext->funcs.GetMediumDimensions != 0)
- result = pContext->funcs.GetMediumDimensions(pContext, &width, &height);
- else
+ if((pContext->funcs.GetMediumDimensions == 0) ||
+ (pContext->funcs.GetReproducibleArea == 0))
return BadImplementation;
- if(pContext->funcs.GetReproducibleArea != 0)
+ result = pContext->funcs.GetMediumDimensions(pContext, &width, &height);
+ if(result != Success)
+ return result;
+
result = pContext->funcs.GetReproducibleArea(pContext, &rect);
- else
- return BadImplementation;
+ if(result != Success)
+ return result;
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
@@ -814,11 +817,13 @@ ProcXpSetImageResolution(ClientPtr client)
}
rep.prevRes = pContext->imageRes;
- if(pContext->funcs.SetImageResolution != 0)
+ if(pContext->funcs.SetImageResolution != 0) {
result = pContext->funcs.SetImageResolution(pContext,
(int)stuff->imageRes,
&status);
- else
+ if(result != Success)
+ status = FALSE;
+ } else
status = FALSE;
rep.type = X_Reply;
@@ -1491,7 +1496,6 @@ ProcXpStartJob(ClientPtr client)
REQUEST(xPrintStartJobReq);
XpContextPtr pContext;
int result = Success;
- XpScreenPtr pPrintScreen;
REQUEST_SIZE_MATCH(xPrintStartJobReq);
@@ -1509,7 +1513,6 @@ ProcXpStartJob(ClientPtr client)
return BadValue;
}
- pPrintScreen = XpScreens[pContext->screenNum];
if(pContext->funcs.StartJob != 0)
result = pContext->funcs.StartJob(pContext,
(stuff->saveData == XPGetData)? TRUE:FALSE,
@@ -1533,7 +1536,6 @@ static int
ProcXpEndJob(ClientPtr client)
{
REQUEST(xPrintEndJobReq);
- XpScreenPtr pPrintScreen;
int result = Success;
XpContextPtr pContext;
@@ -1543,8 +1545,6 @@ ProcXpEndJob(ClientPtr client)
== (XpContextPtr)NULL)
return XpErrorBase+XPBadSequence;
- pPrintScreen = XpScreens[pContext->screenNum];
-
if(!(pContext->state & JOB_STARTED))
return XpErrorBase+XPBadSequence;
@@ -1603,8 +1603,6 @@ ProcXpEndJob(ClientPtr client)
static Bool
DoStartDoc(ClientPtr client, XpStDocPtr c)
{
- XpScreenPtr pPrintScreen;
- int result = Success;
XpContextPtr pContext = c->pContext;
if(c->pContext->state & JOB_GET_DATA &&
@@ -1619,10 +1617,8 @@ DoStartDoc(ClientPtr client, XpStDocPtr c)
return TRUE;
}
- pPrintScreen = XpScreens[pContext->screenNum];
-
if(pContext->funcs.StartDoc != 0)
- result = pContext->funcs.StartDoc(pContext, c->type);
+ (void) pContext->funcs.StartDoc(pContext, c->type);
else
{
SendErrorToClient(client, XpReqCode, X_PrintStartPage, 0,
@@ -1682,7 +1678,6 @@ static int
ProcXpEndDoc(ClientPtr client)
{
REQUEST(xPrintEndDocReq);
- XpScreenPtr pPrintScreen;
XpContextPtr pContext;
int result = Success;
@@ -1692,8 +1687,6 @@ ProcXpEndDoc(ClientPtr client)
== (XpContextPtr)NULL)
return XpErrorBase+XPBadSequence;
- pPrintScreen = XpScreens[pContext->screenNum];
-
if(!(pContext->state & DOC_RAW_STARTED) &&
!(pContext->state & DOC_COOKED_STARTED))
return XpErrorBase+XPBadSequence;
@@ -1744,7 +1737,6 @@ DoStartPage(
ClientPtr client,
XpStPagePtr c)
{
- XpScreenPtr pPrintScreen;
WindowPtr pWin = c->pWin;
int result = Success;
XpContextPtr pContext = c->pContext;
@@ -1815,9 +1807,6 @@ DoStartPage(
pPage->context = pContext;
pContext->pageWin = c->pWin->drawable.id;
- pPrintScreen = XpScreens[pContext->screenNum];
-
-
if(pContext->funcs.StartPage != 0)
result = pContext->funcs.StartPage(pContext, pWin);
else
@@ -1884,7 +1873,6 @@ static int
ProcXpEndPage(ClientPtr client)
{
REQUEST(xPrintEndPageReq);
- XpScreenPtr pPrintScreen;
int result = Success;
XpContextPtr pContext;
XpPagePtr page;
@@ -1899,7 +1887,6 @@ ProcXpEndPage(ClientPtr client)
if(!(pContext->state & PAGE_STARTED))
return XpErrorBase+XPBadSequence;
- pPrintScreen = XpScreens[pContext->screenNum];
pWin = (WindowPtr )LookupIDByType(pContext->pageWin, RT_WINDOW);
/* Call the ddx's EndPage proc. */
diff --git a/Xext/xres.c b/Xext/xres.c
index ca670be24..c024f7be8 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -1,7 +1,7 @@
/*
Copyright (c) 2002 XFree86 Inc
*/
-/* $XFree86: xc/programs/Xserver/Xext/xres.c,v 1.5 2002/07/01 02:25:55 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xres.c,v 1.8 2003/10/28 23:08:44 tsi Exp $ */
#define NEED_EVENTS
#define NEED_REPLIES
@@ -14,10 +14,7 @@
#include "swaprep.h"
#include "XResproto.h"
#include "pixmapstr.h"
-
-extern RESTYPE lastResourceType;
-extern RESTYPE TypeMask;
-extern Atom *ResourceNames;
+#include "modinit.h"
static int
ProcXResQueryVersion (ClientPtr client)
@@ -30,6 +27,8 @@ ProcXResQueryVersion (ClientPtr client)
client_major = stuff->client_major;
client_minor = stuff->client_minor;
+ (void) client_major;
+ (void) client_minor;
rep.type = X_Reply;
rep.length = 0;
@@ -314,11 +313,9 @@ SProcResDispatch (ClientPtr client)
}
void
-ResExtensionInit(void)
+ResExtensionInit(INITARGS)
{
- ExtensionEntry *extEntry;
-
- extEntry = AddExtension(XRES_NAME, 0, 0,
+ (void) AddExtension(XRES_NAME, 0, 0,
ProcResDispatch, SProcResDispatch,
ResResetProc, StandardMinorOpcode);
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 47e7418d8..89bcae3a4 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -26,7 +26,7 @@ other dealings in this Software without prior written authorization
from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/Xext/xtest.c,v 3.7 2001/12/14 19:58:51 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xtest.c,v 3.11 2003/11/17 22:20:27 dawes Exp $ */
#include "X.h"
#define NEED_EVENTS
@@ -53,22 +53,27 @@ from The Open Group.
#include "xf86_ansic.h"
#endif
+#include "modinit.h"
+
+#if 0
static unsigned char XTestReqCode;
+#endif
#ifdef XINPUT
extern int DeviceValuator;
#endif /* XINPUT */
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
static void XTestResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* extEntry */
-#endif
);
static int XTestSwapFakeInput(
-#if NeedFunctionPrototypes
ClientPtr /* client */,
xReq * /* req */
-#endif
);
static DISPATCH_PROC(ProcXTestCompareCursor);
@@ -83,14 +88,20 @@ static DISPATCH_PROC(SProcXTestGetVersion);
static DISPATCH_PROC(SProcXTestGrabControl);
void
-XTestExtensionInit()
+XTestExtensionInit(INITARGS)
{
+#if 0
ExtensionEntry *extEntry;
if ((extEntry = AddExtension(XTestExtensionName, 0, 0,
ProcXTestDispatch, SProcXTestDispatch,
XTestResetProc, StandardMinorOpcode)) != 0)
XTestReqCode = (unsigned char)extEntry->base;
+#else
+ (void) AddExtension(XTestExtensionName, 0, 0,
+ ProcXTestDispatch, SProcXTestDispatch,
+ XTestResetProc, StandardMinorOpcode);
+#endif
}
/*ARGSUSED*/
@@ -378,6 +389,33 @@ ProcXTestFakeInput(client)
client->errorValue = ev->u.u.detail;
return BadValue;
}
+
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) {
+ ScreenPtr pScreen = root->drawable.pScreen;
+ BoxRec box;
+ int i;
+ int x = ev->u.keyButtonPointer.rootX + panoramiXdataPtr[0].x;
+ int y = ev->u.keyButtonPointer.rootY + panoramiXdataPtr[0].y;
+ if (!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
+ x, y, &box)) {
+ FOR_NSCREENS(i) {
+ if (i == pScreen->myNum) continue;
+ if (POINT_IN_REGION(pScreen,
+ &XineramaScreenRegions[i],
+ x, y, &box)) {
+ root = WindowTable[i];
+ x -= panoramiXdataPtr[i].x;
+ y -= panoramiXdataPtr[i].y;
+ ev->u.keyButtonPointer.rootX = x;
+ ev->u.keyButtonPointer.rootY = y;
+ break;
+ }
+ }
+ }
+ }
+#endif
+
if (ev->u.keyButtonPointer.rootX < 0)
ev->u.keyButtonPointer.rootX = 0;
else if (ev->u.keyButtonPointer.rootX >= root->drawable.width)
@@ -386,7 +424,15 @@ ProcXTestFakeInput(client)
ev->u.keyButtonPointer.rootY = 0;
else if (ev->u.keyButtonPointer.rootY >= root->drawable.height)
ev->u.keyButtonPointer.rootY = root->drawable.height - 1;
+
+#ifdef PANORAMIX
+ if ((!noPanoramiXExtension
+ && root->drawable.pScreen->myNum != XineramaGetCursorScreen())
+ || (noPanoramiXExtension && root != GetCurrentRootWindow()))
+
+#else
if (root != GetCurrentRootWindow())
+#endif
{
NewCurrentScreen(root->drawable.pScreen,
ev->u.keyButtonPointer.rootX,
diff --git a/Xext/xtest1dd.c b/Xext/xtest1dd.c
index 8a2b779be..41c78d9c9 100644
--- a/Xext/xtest1dd.c
+++ b/Xext/xtest1dd.c
@@ -52,7 +52,7 @@ Telephone and Telegraph Company or of the Regents of the
University of California.
*/
-/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.c,v 3.5 2001/12/14 19:58:52 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.c,v 3.7 2003/11/17 22:20:28 dawes Exp $ */
/***************************************************************
* include files
@@ -158,11 +158,6 @@ static xTestInputActionEvent input_action_packet;
*/
static int packet_index;
/*
- * set to 1 when the input action event is full and needs to be sent to the
- * client
- */
-static int input_action_event_full = 0;
-/*
* logical x position of the mouse during input action gathering
*/
short xtest_mousex;
@@ -171,14 +166,6 @@ short xtest_mousex;
*/
short xtest_mousey;
/*
- * logical x position of the mouse during input action playback
- */
-static short mx;
-/*
- * logical y position of the mouse during input action playback
- */
-static short my;
-/*
* logical x position of the mouse while we are reading fake input actions
* from the client and putting them into the fake input action array
*/
@@ -288,60 +275,38 @@ KeyCode xtest_command_key = 0;
***************************************************************/
static void parse_key_fake(
-#if NeedFunctionPrototypes
XTestKeyInfo * /* fkey */
-#endif
);
static void parse_motion_fake(
-#if NeedFunctionPrototypes
XTestMotionInfo * /* fmotion */
-#endif
);
static void parse_jump_fake(
-#if NeedFunctionPrototypes
XTestJumpInfo * /* fjump */
-#endif
);
static void parse_delay_fake(
-#if NeedFunctionPrototypes
XTestDelayInfo * /* tevent */
-#endif
);
static void send_ack(
-#if NeedFunctionPrototypes
ClientPtr /* client */
-#endif
);
static void start_play_clock(
-#if NeedFunctionPrototypes
void
-#endif
);
static void compute_action_time(
-#if NeedFunctionPrototypes
struct timeval * /* rtime */
-#endif
);
static int find_residual_time(
-#if NeedFunctionPrototypes
struct timeval * /* rtime */
-#endif
);
static CARD16 check_time_event(
-#if NeedFunctionPrototypes
void
-#endif
);
static CARD32 current_ms(
-#if NeedFunctionPrototypes
struct timeval * /* otime */
-#endif
);
static int there_is_room(
-#if NeedFunctionPrototypes
int /* actsize */
-#endif
);
/******************************************************************************
@@ -471,7 +436,6 @@ flush_input_actions()
/*
* re-initialize the input action event
*/
- input_action_event_full = 0;
input_action_packet.type = XTestInputActionType;
packet_index = 0;
}
@@ -690,7 +654,6 @@ int actsize;
{
if ((packet_index + actsize) > XTestACTIONS_SIZE)
{
- input_action_event_full = 1;
return(0);
}
else
@@ -1316,8 +1279,6 @@ int mousex, mousey;
action_array[read_index].x,
action_array[read_index].y,
action_array[read_index].device);
- mx = action_array[read_index].x;
- my = action_array[read_index].y;
}
if (action_array[read_index].type == XTestKEY_ACTION)
{
diff --git a/Xext/xtest1dd.h b/Xext/xtest1dd.h
index 1b2fccdf4..6e258080e 100644
--- a/Xext/xtest1dd.h
+++ b/Xext/xtest1dd.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.h,v 3.2 2001/08/01 00:44:44 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xtest1dd.h,v 3.3 2003/11/17 22:20:28 dawes Exp $ */
/************************************************************
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
@@ -35,117 +35,89 @@ extern ClientPtr playback_client;
extern KeyCode xtest_command_key;
extern void stop_stealing_input(
-#if NeedFunctionPrototypes
void
-#endif
);
extern void
steal_input(
-#if NeedFunctionPrototypes
ClientPtr /* client */,
CARD32 /* mode */
-#endif
);
extern void
flush_input_actions(
-#if NeedFunctionPrototypes
void
-#endif
);
extern void
XTestStealJumpData(
-#if NeedFunctionPrototypes
int /* jx */,
int /* jy */,
int /* dev_type */
-#endif
);
extern void
XTestStealMotionData(
-#if NeedFunctionPrototypes
int /* dx */,
int /* dy */,
int /* dev_type */,
int /* mx */,
int /* my */
-#endif
);
extern Bool
XTestStealKeyData(
-#if NeedFunctionPrototypes
unsigned /* keycode */,
int /* keystate */,
int /* dev_type */,
int /* locx */,
int /* locy */
-#endif
);
extern void
parse_fake_input(
-#if NeedFunctionPrototypes
ClientPtr /* client */,
char * /* req */
-#endif
);
extern void
XTestComputeWaitTime(
-#if NeedFunctionPrototypes
struct timeval * /* waittime */
-#endif
);
extern int
XTestProcessInputAction(
-#if NeedFunctionPrototypes
int /* readable */,
struct timeval * /* waittime */
-#endif
);
extern void
abort_play_back(
-#if NeedFunctionPrototypes
void
-#endif
);
extern void
return_input_array_size(
-#if NeedFunctionPrototypes
ClientPtr /* client */
-#endif
);
extern void XTestGenerateEvent(
-#if NeedFunctionPrototypes
int /* dev_type */,
int /* keycode */,
int /* keystate */,
int /* mousex */,
int /* mousey */
-#endif
);
extern void XTestGetPointerPos(
-#if NeedFunctionPrototypes
short * /* fmousex */,
short * /* fmousey */
-#endif
);
extern void XTestJumpPointer(
-#if NeedFunctionPrototypes
int /* jx */,
int /* jy */,
int /* dev_type */
-#endif
);
#endif /* XTEST1DD_H */
diff --git a/Xext/xtest1di.c b/Xext/xtest1di.c
index 43c1d58d1..74418606a 100644
--- a/Xext/xtest1di.c
+++ b/Xext/xtest1di.c
@@ -52,7 +52,7 @@ Telephone and Telegraph Company or of the Regents of the
University of California.
*/
-/* $XFree86: xc/programs/Xserver/Xext/xtest1di.c,v 3.3 2001/12/14 19:58:52 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xtest1di.c,v 3.6 2003/11/17 22:20:28 dawes Exp $ */
/*****************************************************************************
* include files
@@ -72,30 +72,16 @@ University of California.
#include "opaque.h"
#define XTestSERVER_SIDE
#include "xtestext1.h"
+#include "modinit.h"
#include "xtest1dd.h"
-/*****************************************************************************
- * defines
- ****************************************************************************/
+#include "xtest1dd.h"
/*****************************************************************************
- * externals
+ * defines
****************************************************************************/
-/*
- * id of client using XTestGetInput
- *
- * defined in xtest1dd.c
- */
-extern ClientPtr current_xtest_client;
-/*
- * id of client using XTestFakeInput
- *
- * defined in xtest1dd.c
- */
-extern ClientPtr playback_client;
-
/*****************************************************************************
* variables
****************************************************************************/
@@ -150,29 +136,21 @@ static DISPATCH_PROC(ProcTestQueryInputSize);
static DISPATCH_PROC(SProcTestQueryInputSize);
static void XTestResetProc(
-#if NeedFunctionPrototypes
ExtensionEntry * /* unused */
-#endif
);
static void SReplyXTestDispatch(
-#if NeedFunctionPrototypes
ClientPtr /* client_ptr */,
int /* size */,
char * /* reply_ptr */
-#endif
);
static void SEventXTestDispatch(
-#if NeedFunctionPrototypes
xEvent * /* from */,
xEvent * /* to */
-#endif
);
static int XTestCurrentClientGone(
-#if NeedFunctionPrototypes
pointer /* value */,
XID /* id */
-#endif
);
/*****************************************************************************
@@ -186,7 +164,7 @@ static int XTestCurrentClientGone(
* (other than the core errors).
*/
void
-XTestExtension1Init()
+XTestExtension1Init(INITARGS)
{
/*
* holds the pointer to the extension entry structure
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index 3d321e8ae..40313470c 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -21,7 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.25 2001/11/18 23:55:48 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xvdisp.c,v 1.29 2003/10/02 13:29:39 eich Exp $ */
/*
** File:
@@ -70,6 +70,8 @@ SOFTWARE.
#include "xf86_ansic.h"
#endif
+#include "xvdisp.h"
+
#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
@@ -1207,7 +1209,7 @@ ProcXvShmPutImage(ClientPtr client)
#endif
#ifdef XvMCExtension
-XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
+#include "xvmcext.h"
#endif
static int
@@ -1939,8 +1941,7 @@ XineramaXvShmPutImage(ClientPtr client)
client, stuff->port, XvXRTPort, SecurityReadAccess)))
return _XvBadPort;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
x = stuff->drw_x;
y = stuff->drw_y;
@@ -1987,8 +1988,7 @@ XineramaXvPutImage(ClientPtr client)
client, stuff->port, XvXRTPort, SecurityReadAccess)))
return _XvBadPort;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
x = stuff->drw_x;
y = stuff->drw_y;
@@ -2033,8 +2033,7 @@ XineramaXvPutVideo(ClientPtr client)
client, stuff->port, XvXRTPort, SecurityReadAccess)))
return _XvBadPort;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
x = stuff->drw_x;
y = stuff->drw_y;
@@ -2079,8 +2078,7 @@ XineramaXvPutStill(ClientPtr client)
client, stuff->port, XvXRTPort, SecurityReadAccess)))
return _XvBadPort;
- isRoot = (draw->type == XRT_WINDOW) &&
- (stuff->drawable == WindowTable[0]->drawable.id);
+ isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
x = stuff->drw_x;
y = stuff->drw_y;
diff --git a/Xext/xvdisp.h b/Xext/xvdisp.h
new file mode 100644
index 000000000..342a874e8
--- /dev/null
+++ b/Xext/xvdisp.h
@@ -0,0 +1,3 @@
+/* $XFree86: xc/programs/Xserver/Xext/xvdisp.h,v 1.1 2003/07/16 01:38:31 dawes Exp $ */
+
+extern void XineramifyXv(void);
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index c6c10e544..2c3f484bd 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -21,7 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xvmain.c,v 1.13 2001/08/23 13:01:36 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xvmain.c,v 1.16 2003/10/28 23:08:44 tsi Exp $ */
/*
** File:
@@ -101,7 +101,7 @@ SOFTWARE.
#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
-extern void XineramifyXv(void);
+#include "xvdisp.h"
#endif
int XvScreenIndex = -1;
@@ -594,6 +594,15 @@ XvdiSendPortNotify(
}
+
+#define CHECK_SIZE(dw, dh, sw, sh) { \
+ if(!dw || !dh || !sw || !sh) return Success; \
+ /* The region code will break these if they are too large */ \
+ if((dw > 32767) || (dh > 32767) || (sw > 32767) || (sh > 32767)) \
+ return BadValue; \
+}
+
+
int
XvdiPutVideo(
ClientPtr client,
@@ -605,11 +614,9 @@ XvdiPutVideo(
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
- int status;
DrawablePtr pOldDraw;
- if(!drw_w || !drw_h || !vid_w || !vid_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
@@ -633,7 +640,7 @@ XvdiPutVideo(
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
}
- status = (* pPort->pAdaptor->ddPutVideo)(client, pDraw, pPort, pGC,
+ (void) (* pPort->pAdaptor->ddPutVideo)(client, pDraw, pPort, pGC,
vid_x, vid_y, vid_w, vid_h,
drw_x, drw_y, drw_w, drw_h);
@@ -662,8 +669,7 @@ XvdiPutStill(
){
int status;
- if(!drw_w || !drw_h || !vid_w || !vid_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
@@ -703,8 +709,7 @@ XvdiPutImage(
Bool sync,
CARD16 width, CARD16 height
){
- if(!drw_w || !drw_h || !src_w || !src_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, src_w, src_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
@@ -739,11 +744,9 @@ XvdiGetVideo(
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
- int status;
DrawablePtr pOldDraw;
- if(!drw_w || !drw_h || !vid_w || !vid_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
@@ -767,7 +770,7 @@ XvdiGetVideo(
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
}
- status = (* pPort->pAdaptor->ddGetVideo)(client, pDraw, pPort, pGC,
+ (void) (* pPort->pAdaptor->ddGetVideo)(client, pDraw, pPort, pGC,
vid_x, vid_y, vid_w, vid_h,
drw_x, drw_y, drw_w, drw_h);
@@ -796,8 +799,7 @@ XvdiGetStill(
){
int status;
- if(!drw_w || !drw_h || !vid_w || !vid_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 7e99e11a5..cb6c06301 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xvmc.c,v 1.7 2001/11/18 23:55:48 mvojkovi Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xvmc.c,v 1.9 2003/07/17 16:04:33 dawes Exp $ */
#define NEED_REPLIES
#define NEED_EVENTS
diff --git a/Xext/xvmcext.h b/Xext/xvmcext.h
index b18a75511..b589c5487 100644
--- a/Xext/xvmcext.h
+++ b/Xext/xvmcext.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/Xext/xvmcext.h,v 1.1 2001/04/07 11:04:21 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xvmcext.h,v 1.2 2003/07/17 16:04:33 dawes Exp $ */
#ifndef _XVMC_H
#define _XVMC_H
@@ -106,4 +106,6 @@ void XvMCExtensionInit(void);
int XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr adapt);
+XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id);
+
#endif /* _XVMC_H */