Unverified Commit 051d521f authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/upgrade_libX11' into 3.6.x

Attributes GH PR #214: https://github.com/ArcticaProject/nx-libs/pull/214 Fixes ArcticaProject/nx-libs#157.
parents 6dce607b b8de7bf6
...@@ -1053,6 +1053,7 @@ XCOMM X Window System make variables; these need to be coordinated with rules ...@@ -1053,6 +1053,7 @@ XCOMM X Window System make variables; these need to be coordinated with rules
XSMDIR = XsmDir /* xsm config files */ XSMDIR = XsmDir /* xsm config files */
NLSDIR = NlsDir /* nls files */ NLSDIR = NlsDir /* nls files */
XLOCALEDIR = XLocaleDir /* locale files */ XLOCALEDIR = XLocaleDir /* locale files */
XLOCALELIBDIR = XlocaleDir /* FIXME: For now take XLOCALEDIR, unsure about the correct setting */
PROXYMANAGERDIR = ProxyManagerDir /* proxy manager config files */ PROXYMANAGERDIR = ProxyManagerDir /* proxy manager config files */
XAPPLOADDIR = XAppLoadDir /* application default resource dir */ XAPPLOADDIR = XAppLoadDir /* application default resource dir */
...@@ -1129,6 +1130,7 @@ VENDORSUPPORTDEFS = VendorSupportDefines ...@@ -1129,6 +1130,7 @@ VENDORSUPPORTDEFS = VendorSupportDefines
SYSTEMENVLIBDIR = SystemBuildLibPath SYSTEMENVLIBDIR = SystemBuildLibPath
# endif # endif
#define XlocaleClientSetup Concat3(XLOCALEDIR,=,BuildI18NDir) #define XlocaleClientSetup Concat3(XLOCALEDIR,=,BuildI18NDir)
Concat3(XLOCALELIBDIR,=,BuildI18NDir)
XENVLIBDIR = X11BuildLibPath XENVLIBDIR = X11BuildLibPath
CLIENTENVSETUP = Concat3(BuildLibPathVar,=,BuildLibPath) XlocaleClientSetup CLIENTENVSETUP = Concat3(BuildLibPathVar,=,BuildLibPath) XlocaleClientSetup
#else #else
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
# define INTERNAL # define INTERNAL
# endif # endif
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__) #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__APPLE__) || defined(__DARWIN__)
# undef HAVE_ALIAS # undef HAVE_ALIAS
#endif #endif
#ifdef HAVE_ALIAS #ifdef HAVE_ALIAS
......
/*********************************************************** /***********************************************************
Copyright 1988, 1998 The Open Group Copyright 1988, 1998 The Open Group
......
/*
* Copyright (c) 1991, Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/************************************************************ /************************************************************
Copyright 1991, 1998 The Open Group Copyright 1991, 1998 The Open Group
...@@ -23,32 +44,6 @@ Except as contained in this notice, the name of The Open Group shall not be ...@@ -23,32 +44,6 @@ Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
Copyright 1991 by Sun Microsystems, Inc. Mountain View, CA.
All Rights Reserved
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright no-
tice appear in all copies and that both that copyright no-
tice and this permission notice appear in supporting docu-
mentation, and that the name of Sun not be used in
advertising or publicity pertaining to distribution of the
software without specific prior written permission. Sun
makes no representations about the suitability of this
software for any purpose. It is provided "as is" without any
express or implied warranty.
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
***********************************************************/ ***********************************************************/
/* /*
......
/*
* $Xorg: X.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
*/
/* Definitions for the X window system likely to be used by applications */ /* Definitions for the X window system likely to be used by applications */
#ifndef X_H #ifndef X_H
...@@ -215,7 +211,8 @@ are reserved in the protocol for errors and replies. */ ...@@ -215,7 +211,8 @@ are reserved in the protocol for errors and replies. */
#define ColormapNotify 32 #define ColormapNotify 32
#define ClientMessage 33 #define ClientMessage 33
#define MappingNotify 34 #define MappingNotify 34
#define LASTEvent 35 /* must be bigger than any event # */ #define GenericEvent 35
#define LASTEvent 36 /* must be bigger than any event # */
/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
......
...@@ -257,7 +257,7 @@ typedef struct { ...@@ -257,7 +257,7 @@ typedef struct {
*/ */
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \ #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
defined(__APPLE__) || defined(__DragonFly__) defined(__APPLE__) || defined(__DARWIN__) || defined(__DragonFly__)
static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p)
{ {
memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)); memcpy(&(p).pws, (p).pwp, sizeof(struct passwd));
...@@ -327,7 +327,7 @@ static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) ...@@ -327,7 +327,7 @@ static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p)
(_Xos_processUnlock), \ (_Xos_processUnlock), \
(p).pwp ) (p).pwp )
#elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(__APPLE__) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(__APPLE__) && !defined(__DARWIN__)
/* SVR4 threads, AIX 4.2.0 and earlier and OSF/1 3.2 and earlier pthreads */ /* SVR4 threads, AIX 4.2.0 and earlier and OSF/1 3.2 and earlier pthreads */
# define X_NEEDS_PWPARAMS # define X_NEEDS_PWPARAMS
typedef struct { typedef struct {
...@@ -620,7 +620,7 @@ typedef struct { ...@@ -620,7 +620,7 @@ typedef struct {
} _Xreaddirparams; } _Xreaddirparams;
# if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(AIXV3) || \ # if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(AIXV3) || \
defined(AIXV4) || defined(__APPLE__) defined(AIXV4) || defined(__APPLE__) || defined(__DARWIN__)
/* AIX defines the draft POSIX symbol, but uses the final API. */ /* AIX defines the draft POSIX symbol, but uses the final API. */
/* POSIX final API, returns (int)0 on success. */ /* POSIX final API, returns (int)0 on success. */
# if defined(__osf__) # if defined(__osf__)
......
/*
* $Xorg: Xproto.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $
*/
/* Definitions for the X window system used by server and c bindings */ /* Definitions for the X window system used by server and c bindings */
/* /*
...@@ -263,10 +259,13 @@ restoring the definitions in X.h. */ ...@@ -263,10 +259,13 @@ restoring the definitions in X.h. */
typedef CARD16 KeyButMask; typedef CARD16 KeyButMask;
/***************** /*****************
connection setup structure. This is followed by Connection setup structures. See Chapter 8: Connection Setup
numRoots xWindowRoot structs. of the X Window System Protocol specification for details.
*****************/ *****************/
/* Client initiates handshake with this data, followed by the strings
* for the auth protocol & data.
*/
typedef struct { typedef struct {
CARD8 byteOrder; CARD8 byteOrder;
BYTE pad; BYTE pad;
...@@ -276,6 +275,16 @@ typedef struct { ...@@ -276,6 +275,16 @@ typedef struct {
CARD16 pad2 B16; CARD16 pad2 B16;
} xConnClientPrefix; } xConnClientPrefix;
/* Server response to xConnClientPrefix.
*
* If success == Success, this is followed by xConnSetup and
* numRoots xWindowRoot structs.
*
* If success == Failure, this is followed by a reason string.
*
* The protocol also defines a case of success == Authenticate, but
* that doesn't seem to have ever been implemented by the X Consortium.
*/
typedef struct { typedef struct {
CARD8 success; CARD8 success;
BYTE lengthReason; /*num bytes in string following if failure */ BYTE lengthReason; /*num bytes in string following if failure */
...@@ -1055,8 +1064,8 @@ typedef struct _xEvent { ...@@ -1055,8 +1064,8 @@ typedef struct _xEvent {
BYTE bpad; BYTE bpad;
} createNotify; } createNotify;
/* /*
* The event feilds in the structures for DestroyNotify, UnmapNotify, * The event fields in the structures for DestroyNotify, UnmapNotify,
* MapNotify, ReparentNotify, ConfigureNotify, CirclulateNotify, GravityNotify, * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
* must be at the same offset because server internal code is depending upon * must be at the same offset because server internal code is depending upon
* this to patch up the events before they are delivered. * this to patch up the events before they are delivered.
* Also note that MapRequest, ConfigureRequest and CirculateRequest have * Also note that MapRequest, ConfigureRequest and CirculateRequest have
...@@ -1118,7 +1127,7 @@ typedef struct _xEvent { ...@@ -1118,7 +1127,7 @@ typedef struct _xEvent {
} resizeRequest; } resizeRequest;
struct { struct {
/* The event field in the circulate record is really the parent when this /* The event field in the circulate record is really the parent when this
is used as a CirculateRequest insteaad of a CircluateNotify */ is used as a CirculateRequest instead of a CirculateNotify */
CARD32 pad00 B32; CARD32 pad00 B32;
Window event B32, window B32, parent B32; Window event B32, window B32, parent B32;
BYTE place; /* Top or Bottom */ BYTE place; /* Top or Bottom */
...@@ -1204,6 +1213,38 @@ typedef struct _xEvent { ...@@ -1204,6 +1213,38 @@ typedef struct _xEvent {
} u; } u;
} xEvent; } xEvent;
/*********************************************************
*
* Generic event
*
* Those events are not part of the core protocol spec and can be used by
* various extensions.
* type is always GenericEvent
* extension is the minor opcode of the extension the event belongs to.
* evtype is the actual event type, unique __per extension__.
*
* GenericEvents can be longer than 32 bytes, with the length field
* specifying the number of 4 byte blocks after the first 32 bytes.
*
*
*/
typedef struct
{
BYTE type;
CARD8 extension;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 evtype B16;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xGenericEvent;
/* KeymapNotify events are not included in the above union because they /* KeymapNotify events are not included in the above union because they
are different from all other events: they do not have a "detail" are different from all other events: they do not have a "detail"
or "sequenceNumber", so there is room for a 248-bit key mask. */ or "sequenceNumber", so there is room for a 248-bit key mask. */
...@@ -1705,7 +1746,7 @@ typedef struct { ...@@ -1705,7 +1746,7 @@ typedef struct {
CARD32 planeMask B32; CARD32 planeMask B32;
} xGetImageReq; } xGetImageReq;
/* the folloiwng used by PolyText8 and PolyText16 */ /* the following used by PolyText8 and PolyText16 */
typedef struct { typedef struct {
CARD8 reqType; CARD8 reqType;
......
/*********************************************************** /***********************************************************
Copyright 1987, 1998 The Open Group Copyright 1987, 1998 The Open Group
...@@ -68,6 +67,8 @@ SOFTWARE. ...@@ -68,6 +67,8 @@ SOFTWARE.
#define XK_VIETNAMESE #define XK_VIETNAMESE
#define XK_CURRENCY #define XK_CURRENCY
#define XK_MATHEMATICAL #define XK_MATHEMATICAL
#define XK_BRAILLE
#define XK_SINHALA
#include <nx-X11/keysymdef.h> #include <X11/keysymdef.h>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
* *
* *
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
...@@ -56,8 +55,7 @@ ...@@ -56,8 +55,7 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsAddColorSpace(pCS) XcmsAddColorSpace(XcmsColorSpace *pCS)
XcmsColorSpace *pCS;
/* /*
* DESCRIPTION * DESCRIPTION
* DI Color Spaces are managed on a global basis. * DI Color Spaces are managed on a global basis.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
* *
* *
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
...@@ -56,8 +55,7 @@ ...@@ -56,8 +55,7 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsAddFunctionSet(pNewFS) XcmsAddFunctionSet(XcmsFunctionSet *pNewFS)
XcmsFunctionSet *pNewFS;
/* /*
* DESCRIPTION * DESCRIPTION
* Additional Screen Color Characterization Function Sets are * Additional Screen Color Characterization Function Sets are
......
...@@ -24,19 +24,20 @@ in this Software without prior written authorization from The Open Group. ...@@ -24,19 +24,20 @@ in this Software without prior written authorization from The Open Group.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XAllocColorCells(dpy, cmap, contig, masks, nplanes, pixels, ncolors) Status XAllocColorCells(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
Bool contig; Bool contig,
unsigned int ncolors; /* CARD16 */ unsigned long *masks, /* LISTofCARD32 */ /* RETURN */
unsigned int nplanes; /* CARD16 */ unsigned int nplanes, /* CARD16 */
unsigned long *masks; /* LISTofCARD32 */ /* RETURN */ unsigned long *pixels, /* LISTofCARD32 */ /* RETURN */
unsigned long *pixels; /* LISTofCARD32 */ /* RETURN */ unsigned int ncolors) /* CARD16 */
{ {
Status status; Status status;
......
...@@ -29,15 +29,18 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,15 +29,18 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XAllocColorPlanes(dpy, cmap, contig, pixels, ncolors, nreds, ngreens, Status XAllocColorPlanes(
nblues, rmask, gmask, bmask) register Display *dpy,
register Display *dpy; Colormap cmap,
Colormap cmap; Bool contig,
Bool contig; unsigned long *pixels, /* LISTofCARD32 */ /* RETURN */
unsigned long *pixels; /* LISTofCARD32 */ /* RETURN */ int ncolors,
int ncolors; int nreds,
int nreds, ngreens, nblues; int ngreens,
unsigned long *rmask, *gmask, *bmask; /* CARD32 */ /* RETURN */ int nblues,
unsigned long *rmask,
unsigned long *gmask,
unsigned long *bmask) /* CARD32 */ /* RETURN */
{ {
xAllocColorPlanesReply rep; xAllocColorPlanesReply rep;
Status status; Status status;
...@@ -68,4 +71,4 @@ unsigned long *rmask, *gmask, *bmask; /* CARD32 */ /* RETURN */ ...@@ -68,4 +71,4 @@ unsigned long *rmask, *gmask, *bmask; /* CARD32 */ /* RETURN */
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return(status); return(status);
} }
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XAllowEvents(dpy, mode, time) XAllowEvents(
register Display *dpy; register Display *dpy,
int mode; int mode,
Time time; Time time)
{ {
register xAllowEventsReq *req; register xAllowEventsReq *req;
......
...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,8 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XAutoRepeatOn (dpy) XAutoRepeatOn (register Display *dpy)
register Display *dpy;
{ {
XKeyboardControl values; XKeyboardControl values;
values.auto_repeat_mode = AutoRepeatModeOn; values.auto_repeat_mode = AutoRepeatModeOn;
...@@ -40,8 +39,7 @@ register Display *dpy; ...@@ -40,8 +39,7 @@ register Display *dpy;
} }
int int
XAutoRepeatOff (dpy) XAutoRepeatOff (register Display *dpy)
register Display *dpy;
{ {
XKeyboardControl values; XKeyboardControl values;
values.auto_repeat_mode = AutoRepeatModeOff; values.auto_repeat_mode = AutoRepeatModeOff;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowBackground(dpy, w, pixel) XSetWindowBackground(
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned long pixel; unsigned long pixel)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -33,10 +33,10 @@ from The Open Group. ...@@ -33,10 +33,10 @@ from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowBorderWidth(dpy, w, width) XSetWindowBorderWidth(
Display *dpy; Display *dpy,
Window w; Window w,
unsigned int width; unsigned int width)
{ {
unsigned long lwidth = width; /* must be CARD32 */ unsigned long lwidth = width; /* must be CARD32 */
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XBell(dpy, percent) XBell(
register Display *dpy; register Display *dpy,
int percent; int percent)
{ {
register xBellReq *req; register xBellReq *req;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowBorder(dpy, w, pixel) XSetWindowBorder(
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned long pixel; unsigned long pixel)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -84,17 +84,16 @@ from The Open Group. ...@@ -84,17 +84,16 @@ from The Open Group.
* SYNOPSIS * SYNOPSIS
*/ */
XcmsCCC XcmsCCC
XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc, XcmsCreateCCC(
gamutCompClientData, whitePtAdjProc, whitePtAdjClientData) Display *dpy,
Display *dpy; int screenNumber,
int screenNumber; Visual *visual,
Visual *visual; XcmsColor *clientWhitePt,
XcmsColor *clientWhitePt; XcmsCompressionProc gamutCompProc,
XcmsCompressionProc gamutCompProc; XPointer gamutCompClientData,
XPointer gamutCompClientData; XcmsWhiteAdjustProc whitePtAdjProc,
XcmsWhiteAdjustProc whitePtAdjProc; XPointer whitePtAdjClientData)
XPointer whitePtAdjClientData;
/* /*
* DESCRIPTION * DESCRIPTION
* Given a Display, Screen, Visual, etc., this routine creates * Given a Display, Screen, Visual, etc., this routine creates
...@@ -114,7 +113,7 @@ XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc, ...@@ -114,7 +113,7 @@ XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc,
if (pDefaultCCC == NULL || if (pDefaultCCC == NULL ||
!(newccc = (XcmsCCC) Xcalloc(1, (unsigned) sizeof(XcmsCCCRec)))) { !(newccc = (XcmsCCC) Xcalloc(1, (unsigned) sizeof(XcmsCCCRec)))) {
return(NULL); return(NULL);
} }
/* /*
* Should inherit the following as result of a memmove(): * Should inherit the following as result of a memmove():
...@@ -171,10 +170,10 @@ XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc, ...@@ -171,10 +170,10 @@ XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc,
* *
* SYNOPSIS * SYNOPSIS
*/ */
XcmsCCC XcmsCCC
XcmsDefaultCCC(dpy, screenNumber) XcmsDefaultCCC(
Display *dpy; Display *dpy,
int screenNumber; int screenNumber)
/* /*
* DESCRIPTION * DESCRIPTION
* Given a Display and Screen, this routine creates * Given a Display and Screen, this routine creates
...@@ -254,8 +253,7 @@ XcmsDefaultCCC(dpy, screenNumber) ...@@ -254,8 +253,7 @@ XcmsDefaultCCC(dpy, screenNumber)
* SYNOPSIS * SYNOPSIS
*/ */
void void
XcmsFreeCCC(ccc) XcmsFreeCCC(XcmsCCC ccc)
XcmsCCC ccc;
/* /*
* DESCRIPTION * DESCRIPTION
* Frees memory associated with a Color Conversion Context * Frees memory associated with a Color Conversion Context
......
...@@ -30,25 +30,21 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,25 +30,21 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XEnableAccessControl(dpy) XEnableAccessControl(register Display *dpy)
register Display *dpy;
{ {
return XSetAccessControl(dpy, EnableAccess); return XSetAccessControl(dpy, EnableAccess);
} }
int int
XDisableAccessControl(dpy) XDisableAccessControl(register Display *dpy)
register Display *dpy;
{ {
return XSetAccessControl(dpy, DisableAccess); return XSetAccessControl(dpy, DisableAccess);
} }
int int
XSetAccessControl(dpy, mode) XSetAccessControl(
register Display *dpy; register Display *dpy,
int mode; int mode)
{ {
register xSetAccessControlReq *req; register xSetAccessControlReq *req;
......
...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XChangeActivePointerGrab(dpy, event_mask, curs, time) XChangeActivePointerGrab(
register Display *dpy; register Display *dpy,
unsigned int event_mask; /* CARD16 */ unsigned int event_mask, /* CARD16 */
Cursor curs; Cursor curs,
Time time; Time time)
{ {
register xChangeActivePointerGrabReq *req; register xChangeActivePointerGrabReq *req;
......
...@@ -30,10 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetCloseDownMode(dpy, mode) XSetCloseDownMode(
register Display *dpy; register Display *dpy,
int mode; int mode)
{ {
register xSetCloseDownModeReq *req; register xSetCloseDownModeReq *req;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetWindowColormap(dpy, w, colormap) XSetWindowColormap(
register Display *dpy; register Display *dpy,
Window w; Window w,
Colormap colormap; Colormap colormap)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group.
#include "Cr.h" #include "Cr.h"
int int
XChangeGC (dpy, gc, valuemask, values) XChangeGC (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned long valuemask; unsigned long valuemask,
XGCValues *values; XGCValues *values)
{ {
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XChangeKeyboardControl(dpy, mask, value_list) XChangeKeyboardControl(
register Display *dpy; register Display *dpy,
unsigned long mask; unsigned long mask,
XKeyboardControl *value_list; XKeyboardControl *value_list)
{ {
unsigned long values[8]; unsigned long values[8];
register unsigned long *value = values; register unsigned long *value = values;
...@@ -46,7 +46,7 @@ XChangeKeyboardControl(dpy, mask, value_list) ...@@ -46,7 +46,7 @@ XChangeKeyboardControl(dpy, mask, value_list)
if (mask & KBKeyClickPercent) if (mask & KBKeyClickPercent)
*value++ = value_list->key_click_percent; *value++ = value_list->key_click_percent;
if (mask & KBBellPercent) if (mask & KBBellPercent)
*value++ = value_list->bell_percent; *value++ = value_list->bell_percent;
......
...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XChangePointerControl(dpy, do_acc, do_thresh, acc_numerator, XChangePointerControl(
acc_denominator, threshold) register Display *dpy,
register Display *dpy; Bool do_acc,
Bool do_acc, do_thresh; Bool do_thresh,
int acc_numerator, acc_denominator, threshold; int acc_numerator,
int acc_denominator,
int threshold)
{ {
register xChangePointerControlReq *req; register xChangePointerControlReq *req;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XChangeSaveSet(dpy, win, mode) XChangeSaveSet(
register Display *dpy; register Display *dpy,
Window win; Window win,
int mode; int mode)
{ {
register xChangeSaveSetReq *req; register xChangeSaveSetReq *req;
...@@ -47,17 +47,17 @@ int mode; ...@@ -47,17 +47,17 @@ int mode;
} }
int int
XAddToSaveSet(dpy, win) XAddToSaveSet(
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
return XChangeSaveSet(dpy,win,SetModeInsert); return XChangeSaveSet(dpy,win,SetModeInsert);
} }
int int
XRemoveFromSaveSet (dpy, win) XRemoveFromSaveSet (
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
return XChangeSaveSet(dpy,win,SetModeDelete); return XChangeSaveSet(dpy,win,SetModeDelete);
} }
...@@ -36,11 +36,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -36,11 +36,11 @@ in this Software without prior written authorization from The Open Group.
CWDontPropagate|CWColormap|CWCursor) CWDontPropagate|CWColormap|CWCursor)
int int
XChangeWindowAttributes (dpy, w, valuemask, attributes) XChangeWindowAttributes (
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned long valuemask; unsigned long valuemask,
XSetWindowAttributes *attributes; XSetWindowAttributes *attributes)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XResizeWindow(dpy, w, width, height) XResizeWindow(
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned int width, height; unsigned int width,
unsigned int height)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
......
...@@ -23,28 +23,27 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -23,28 +23,27 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
/* /*
* Check existing events in queue to find if any match. If so, return. * Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one * If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckIfEvent (dpy, event, predicate, arg) Bool XCheckIfEvent (
register Display *dpy; register Display *dpy,
register XEvent *event, /* XEvent to be filled in. */
Bool (*predicate)( Bool (*predicate)(
Display* /* display */, Display* /* display */,
XEvent* /* event */, XEvent* /* event */,
char* /* arg */ char* /* arg */
); /* function to call */ ), /* function to call */
register XEvent *event; /* XEvent to be filled in. */ char *arg)
char *arg;
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
...@@ -60,6 +59,7 @@ Bool XCheckIfEvent (dpy, event, predicate, arg) ...@@ -60,6 +59,7 @@ Bool XCheckIfEvent (dpy, event, predicate, arg)
&& (*predicate)(dpy, &qelt->event, arg)) { && (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event; *event = qelt->event;
_XDeq(dpy, prev, qelt); _XDeq(dpy, prev, qelt);
_XStoreEventCookie(dpy, event);
UnlockDisplay(dpy); UnlockDisplay(dpy);
return True; return True;
} }
...@@ -90,15 +90,16 @@ Bool XCheckIfEvent (dpy, event, predicate, arg) ...@@ -90,15 +90,16 @@ Bool XCheckIfEvent (dpy, event, predicate, arg)
* events. * events.
*/ */
Bool XCheckIfEventNoFlush (dpy, event, predicate, arg) Bool XCheckIfEventNoFlush (
register Display *dpy; register Display *dpy,
register XEvent *event, /* XEvent to be filled in. */
Bool (*predicate)( Bool (*predicate)(
Display* /* display */, Display* /* display */,
XEvent* /* event */, XEvent* /* event */,
char* /* arg */ char* /* arg */
); /* function to call */ ), /* function to call */
register XEvent *event; /* XEvent to be filled in. */ char *arg)
char *arg;
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
...@@ -114,6 +115,7 @@ Bool XCheckIfEventNoFlush (dpy, event, predicate, arg) ...@@ -114,6 +115,7 @@ Bool XCheckIfEventNoFlush (dpy, event, predicate, arg)
&& (*predicate)(dpy, &qelt->event, arg)) { && (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event; *event = qelt->event;
_XDeq(dpy, prev, qelt); _XDeq(dpy, prev, qelt);
_XStoreEventCookie(dpy, event);
UnlockDisplay(dpy); UnlockDisplay(dpy);
return True; return True;
} }
......
...@@ -35,28 +35,32 @@ extern long const _Xevent_to_mask[]; ...@@ -35,28 +35,32 @@ extern long const _Xevent_to_mask[];
#define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\ #define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\
Button4MotionMask|Button5MotionMask) Button4MotionMask|Button5MotionMask)
/* /*
* Check existing events in queue to find if any match. If so, return. * Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one * If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckMaskEvent (dpy, mask, event) Bool XCheckMaskEvent (
register Display *dpy; register Display *dpy,
long mask; /* Selected event mask. */ long mask, /* Selected event mask. */
register XEvent *event; /* XEvent to be filled in. */ register XEvent *event) /* XEvent to be filled in. */
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
int n; /* time through count */ int n; /* time through count */
LockDisplay(dpy); LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL; prev = NULL;
for (n = 3; --n >= 0;) { for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head; for (qelt = prev ? prev->next : dpy->head;
qelt; qelt;
prev = qelt, qelt = qelt->next) { prev = qelt, qelt = qelt->next) {
if ((qelt->event.type < LASTEvent) && if ((qelt->event.type < GenericEvent) &&
(_Xevent_to_mask[qelt->event.type] & mask) && (_Xevent_to_mask[qelt->event.type] & mask) &&
((qelt->event.type != MotionNotify) || ((qelt->event.type != MotionNotify) ||
(mask & AllPointers) || (mask & AllPointers) ||
......
...@@ -29,22 +29,26 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,22 +29,26 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
/* /*
* Check existing events in queue to find if any match. If so, return. * Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one * If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckTypedEvent (dpy, type, event) Bool XCheckTypedEvent (
register Display *dpy; register Display *dpy,
int type; /* Selected event type. */ int type, /* Selected event type. */
register XEvent *event; /* XEvent to be filled in. */ register XEvent *event) /* XEvent to be filled in. */
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
int n; /* time through count */ int n; /* time through count */
LockDisplay(dpy); LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL; prev = NULL;
for (n = 3; --n >= 0;) { for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head; for (qelt = prev ? prev->next : dpy->head;
......
...@@ -29,23 +29,27 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,23 +29,27 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
/* /*
* Check existing events in queue to find if any match. If so, return. * Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one * If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckTypedWindowEvent (dpy, w, type, event) Bool XCheckTypedWindowEvent (
register Display *dpy; register Display *dpy,
Window w; /* Selected window. */ Window w, /* Selected window. */
int type; /* Selected event type. */ int type, /* Selected event type. */
register XEvent *event; /* XEvent to be filled in. */ register XEvent *event) /* XEvent to be filled in. */
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
int n; /* time through count */ int n; /* time through count */
LockDisplay(dpy); LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL; prev = NULL;
for (n = 3; --n >= 0;) { for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head; for (qelt = prev ? prev->next : dpy->head;
......
...@@ -34,30 +34,34 @@ extern long const _Xevent_to_mask[]; ...@@ -34,30 +34,34 @@ extern long const _Xevent_to_mask[];
#define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\ #define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\
Button4MotionMask|Button5MotionMask) Button4MotionMask|Button5MotionMask)
/* /*
* Check existing events in queue to find if any match. If so, return. * Check existing events in queue to find if any match. If so, return.
* If not, flush buffer and see if any more events are readable. If one * If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found. * matches, return. If all else fails, tell the user no events found.
*/ */
Bool XCheckWindowEvent (dpy, w, mask, event) Bool XCheckWindowEvent (
register Display *dpy; register Display *dpy,
Window w; /* Selected window. */ Window w, /* Selected window. */
long mask; /* Selected event mask. */ long mask, /* Selected event mask. */
register XEvent *event; /* XEvent to be filled in. */ register XEvent *event) /* XEvent to be filled in. */
{ {
register _XQEvent *prev, *qelt; register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0; unsigned long qe_serial = 0;
int n; /* time through count */ int n; /* time through count */
LockDisplay(dpy); LockDisplay(dpy);
/* Delete unclaimed cookies */
_XFreeEventCookies(dpy);
prev = NULL; prev = NULL;
for (n = 3; --n >= 0;) { for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head; for (qelt = prev ? prev->next : dpy->head;
qelt; qelt;
prev = qelt, qelt = qelt->next) { prev = qelt, qelt = qelt->next) {
if ((qelt->event.xany.window == w) && if ((qelt->event.xany.window == w) &&
(qelt->event.type < LASTEvent) && (qelt->event.type < GenericEvent) &&
(_Xevent_to_mask[qelt->event.type] & mask) && (_Xevent_to_mask[qelt->event.type] & mask) &&
((qelt->event.type != MotionNotify) || ((qelt->event.type != MotionNotify) ||
(mask & AllPointers) || (mask & AllPointers) ||
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCirculateSubwindows(dpy, w, direction) XCirculateSubwindows(
register Display *dpy; register Display *dpy,
Window w; Window w,
int direction; int direction)
{ {
register xCirculateWindowReq *req; register xCirculateWindowReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCirculateSubwindowsDown(dpy,w) XCirculateSubwindowsDown(
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xCirculateWindowReq *req; register xCirculateWindowReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCirculateSubwindowsUp(dpy, w) XCirculateSubwindowsUp(
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xCirculateWindowReq *req; register xCirculateWindowReq *req;
......
...@@ -30,12 +30,16 @@ from The Open Group. ...@@ -30,12 +30,16 @@ from The Open Group.
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#if USE_XCB
#include "Xxcbint.h"
#else /* !USE_XCB */
#include <nx-X11/Xtrans/Xtrans.h> #include <nx-X11/Xtrans/Xtrans.h>
#endif /* USE_XCB */
#include "Xlib.h" #include "Xlib.h"
#include "Xlibint.h" #include "Xlibint.h"
#include "Xintconn.h" #include "Xintconn.h"
/* /*
* XCloseDisplay - XSync the connection to the X Server, close the connection, * XCloseDisplay - XSync the connection to the X Server, close the connection,
* and free all associated storage. Extension close procs should only free * and free all associated storage. Extension close procs should only free
* memory and must be careful about the types of requests they generate. * memory and must be careful about the types of requests they generate.
...@@ -68,7 +72,11 @@ XCloseDisplay ( ...@@ -68,7 +72,11 @@ XCloseDisplay (
if (dpy->request != dpy->last_request_read) if (dpy->request != dpy->last_request_read)
XSync(dpy, 1); XSync(dpy, 1);
} }
#if USE_XCB
xcb_disconnect(dpy->xcb->connection);
#else /* !USE_XCB */
_XDisconnectDisplay(dpy->trans_conn); _XDisconnectDisplay(dpy->trans_conn);
#endif /* USE_XCB */
_XFreeDisplayStructure (dpy); _XFreeDisplayStructure (dpy);
return 0; return 0;
} }
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XClearWindow(dpy, w) XClearWindow(
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xClearAreaReq *req; register xClearAreaReq *req;
......
...@@ -30,12 +30,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XClearArea (dpy, w, x, y, width, height, exposures) XClearArea (
register Display *dpy; register Display *dpy,
Window w; Window w,
int x, y; int x,
unsigned int width, height; int y,
Bool exposures; unsigned int width,
unsigned int height,
Bool exposures)
{ {
register xClearAreaReq *req; register xClearAreaReq *req;
......
/* $XFree86$ */
#ifndef _CMAP_H_ #ifndef _CMAP_H_
#define _CMAP_H_ #define _CMAP_H_
......
...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XMoveResizeWindow(dpy, w, x, y, width, height) XMoveResizeWindow(
register Display *dpy; register Display *dpy,
Window w; Window w,
int x, y; int x,
unsigned int width, height; int y,
unsigned int width,
unsigned int height)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
......
...@@ -4,13 +4,13 @@ Copyright 1987, 1988, 1990 by Digital Equipment Corporation, Maynard, ...@@ -4,13 +4,13 @@ Copyright 1987, 1988, 1990 by Digital Equipment Corporation, Maynard,
All Rights Reserved All Rights Reserved
Permission to use, copy, modify, and distribute this software and its Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in both that copyright notice and this permission notice appear in
supporting documentation, and that the name Digital not be supporting documentation, and that the name Digital not be
used in advertising or publicity pertaining to distribution of the used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission. software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
...@@ -154,7 +154,7 @@ static void _XFreeContextDB(Display *display) ...@@ -154,7 +154,7 @@ static void _XFreeContextDB(Display *display)
/* Save the given value of data to correspond with the keys XID and context. /* Save the given value of data to correspond with the keys XID and context.
Returns nonzero error code if an error has occured, 0 otherwise. Returns nonzero error code if an error has occured, 0 otherwise.
Possible errors are Out-of-memory. Possible errors are Out-of-memory.
*/ */
int XSaveContext( int XSaveContext(
Display *display, Display *display,
...@@ -228,16 +228,12 @@ int XSaveContext( ...@@ -228,16 +228,12 @@ int XSaveContext(
/* Given an XID and context, returns the associated data. Note that data /* Given an XID and context, returns the associated data. Note that data
here is a pointer since it is a return value. Returns nonzero error code here is a pointer since it is a return value. Returns nonzero error code
if an error has occured, 0 otherwise. Possible errors are Entry-not-found. if an error has occured, 0 otherwise. Possible errors are Entry-not-found.
*/ */
int XFindContext(display, rid, context, data) int XFindContext(Display *display, XID rid, XContext context, XPointer *data)
Display *display;
register XID rid;
register XContext context;
XPointer *data; /* RETURN */
{ {
register DB db; register DB db;
register TableEntry entry; register TableEntry entry;
...@@ -272,10 +268,7 @@ int XFindContext(display, rid, context, data) ...@@ -272,10 +268,7 @@ int XFindContext(display, rid, context, data)
with the same arguments. with the same arguments.
*/ */
int XDeleteContext(display, rid, context) int XDeleteContext(Display *display, XID rid, XContext context)
Display *display;
register XID rid;
register XContext context;
{ {
register DB db; register DB db;
register TableEntry entry, *prev; register TableEntry entry, *prev;
......
...@@ -30,12 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XConvertSelection(dpy, selection, target, property, requestor, time) XConvertSelection(
register Display *dpy; register Display *dpy,
Atom selection, target; Atom selection,
Atom property; Atom target,
Window requestor; Atom property,
Time time; Window requestor,
Time time)
{ {
register xConvertSelectionReq *req; register xConvertSelectionReq *req;
......
...@@ -30,15 +30,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,15 +30,17 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCopyArea(dpy, src_drawable, dst_drawable, gc, XCopyArea(
src_x, src_y, width, height, register Display *dpy,
dst_x, dst_y) Drawable src_drawable,
register Display *dpy; Drawable dst_drawable,
Drawable src_drawable, dst_drawable; GC gc,
GC gc; int src_x,
int src_x, src_y; int src_y,
unsigned int width, height; unsigned int width,
int dst_x, dst_y; unsigned int height,
int dst_x,
int dst_y)
{ {
register xCopyAreaReq *req; register xCopyAreaReq *req;
......
...@@ -40,9 +40,9 @@ extern XcmsCmapRec * _XcmsCopyCmapRecAndFree(Display *dpy, ...@@ -40,9 +40,9 @@ extern XcmsCmapRec * _XcmsCopyCmapRecAndFree(Display *dpy,
Colormap copy_cmap); Colormap copy_cmap);
#endif #endif
Colormap XCopyColormapAndFree(dpy, src_cmap) Colormap XCopyColormapAndFree(
register Display *dpy; register Display *dpy,
Colormap src_cmap; Colormap src_cmap)
{ {
Colormap mid; Colormap mid;
register xCopyColormapAndFreeReq *req; register xCopyColormapAndFreeReq *req;
...@@ -59,6 +59,6 @@ Colormap src_cmap; ...@@ -59,6 +59,6 @@ Colormap src_cmap;
#if XCMS #if XCMS
_XcmsCopyCmapRecAndFree(dpy, src_cmap, mid); _XcmsCopyCmapRecAndFree(dpy, src_cmap, mid);
#endif #endif
return(mid); return(mid);
} }
...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCopyGC (dpy, srcGC, mask, destGC) XCopyGC (
register Display *dpy; register Display *dpy,
unsigned long mask; /* which ones to set initially */ GC srcGC,
GC srcGC, destGC; unsigned long mask, /* which ones to set initially */
GC destGC)
{ {
register XGCValues *destgv = &destGC->values, register XGCValues *destgv = &destGC->values,
*srcgv = &srcGC->values; *srcgv = &srcGC->values;
...@@ -43,7 +44,7 @@ XCopyGC (dpy, srcGC, mask, destGC) ...@@ -43,7 +44,7 @@ XCopyGC (dpy, srcGC, mask, destGC)
LockDisplay(dpy); LockDisplay(dpy);
mask &= (1L << (GCLastBit + 1)) - 1; mask &= (1L << (GCLastBit + 1)) - 1;
/* if some of the source values to be copied are "dirty", flush them /* if some of the source values to be copied are "dirty", flush them
out before sending the CopyGC request. */ out before sending the CopyGC request. */
if (srcGC->dirty & mask) if (srcGC->dirty & mask)
_XFlushGCCache(dpy, srcGC); _XFlushGCCache(dpy, srcGC);
...@@ -58,7 +59,7 @@ XCopyGC (dpy, srcGC, mask, destGC) ...@@ -58,7 +59,7 @@ XCopyGC (dpy, srcGC, mask, destGC)
if (mask & GCFunction) if (mask & GCFunction)
destgv->function = srcgv->function; destgv->function = srcgv->function;
if (mask & GCPlaneMask) if (mask & GCPlaneMask)
destgv->plane_mask = srcgv->plane_mask; destgv->plane_mask = srcgv->plane_mask;
...@@ -76,14 +77,14 @@ XCopyGC (dpy, srcGC, mask, destGC) ...@@ -76,14 +77,14 @@ XCopyGC (dpy, srcGC, mask, destGC)
if (mask & GCCapStyle) if (mask & GCCapStyle)
destgv->cap_style = srcgv->cap_style; destgv->cap_style = srcgv->cap_style;
if (mask & GCJoinStyle) if (mask & GCJoinStyle)
destgv->join_style = srcgv->join_style; destgv->join_style = srcgv->join_style;
if (mask & GCFillStyle) if (mask & GCFillStyle)
destgv->fill_style = srcgv->fill_style; destgv->fill_style = srcgv->fill_style;
if (mask & GCFillRule) if (mask & GCFillRule)
destgv->fill_rule = srcgv->fill_rule; destgv->fill_rule = srcgv->fill_rule;
if (mask & GCArcMode) if (mask & GCArcMode)
...@@ -101,19 +102,19 @@ XCopyGC (dpy, srcGC, mask, destGC) ...@@ -101,19 +102,19 @@ XCopyGC (dpy, srcGC, mask, destGC)
if (mask & GCTileStipYOrigin) if (mask & GCTileStipYOrigin)
destgv->ts_y_origin = srcgv->ts_y_origin; destgv->ts_y_origin = srcgv->ts_y_origin;
if (mask & GCFont) if (mask & GCFont)
destgv->font = srcgv->font; destgv->font = srcgv->font;
if (mask & GCSubwindowMode) if (mask & GCSubwindowMode)
destgv->subwindow_mode = srcgv->subwindow_mode; destgv->subwindow_mode = srcgv->subwindow_mode;
if (mask & GCGraphicsExposures) if (mask & GCGraphicsExposures)
destgv->graphics_exposures = srcgv->graphics_exposures; destgv->graphics_exposures = srcgv->graphics_exposures;
if (mask & GCClipXOrigin) if (mask & GCClipXOrigin)
destgv->clip_x_origin = srcgv->clip_x_origin; destgv->clip_x_origin = srcgv->clip_x_origin;
if (mask & GCClipYOrigin) if (mask & GCClipYOrigin)
destgv->clip_y_origin = srcgv->clip_y_origin; destgv->clip_y_origin = srcgv->clip_y_origin;
if (mask & GCClipMask) { if (mask & GCClipMask) {
...@@ -121,7 +122,7 @@ XCopyGC (dpy, srcGC, mask, destGC) ...@@ -121,7 +122,7 @@ XCopyGC (dpy, srcGC, mask, destGC)
destgv->clip_mask = srcgv->clip_mask; destgv->clip_mask = srcgv->clip_mask;
} }
if (mask & GCDashOffset) if (mask & GCDashOffset)
destgv->dash_offset = srcgv->dash_offset; destgv->dash_offset = srcgv->dash_offset;
if (mask & GCDashList) { if (mask & GCDashList) {
......
...@@ -30,18 +30,20 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,18 +30,20 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XCopyPlane(dpy, src_drawable, dst_drawable, gc, XCopyPlane(
src_x, src_y, width, height, register Display *dpy,
dst_x, dst_y, bit_plane) Drawable src_drawable,
register Display *dpy; Drawable dst_drawable,
Drawable src_drawable, dst_drawable; GC gc,
GC gc; int src_x,
int src_x, src_y; int src_y,
unsigned int width, height; unsigned int width,
int dst_x, dst_y; unsigned int height,
unsigned long bit_plane; int dst_x,
int dst_y,
unsigned long bit_plane)
{ {
register xCopyPlaneReq *req; register xCopyPlaneReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
/* $XFree86$ */
#ifndef _CR_H_ #ifndef _CR_H_
#define _CR_H_ #define _CR_H_
......
...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
...@@ -31,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlib.h" #include "Xlib.h"
/* /*
* XCreateBitmapFromData: Routine to make a pixmap of depth 1 from user * XCreateBitmapFromData: Routine to make a pixmap of depth 1 from user
* supplied data. * supplied data.
* D is any drawable on the same screen that the pixmap will be used in. * D is any drawable on the same screen that the pixmap will be used in.
* Data is a pointer to the bit data, and * Data is a pointer to the bit data, and
* width & height give the size in bits of the pixmap. * width & height give the size in bits of the pixmap.
* *
* The following format is assumed for data: * The following format is assumed for data:
...@@ -46,7 +45,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -46,7 +45,7 @@ in this Software without prior written authorization from The Open Group.
* bitmap_unit=8 * bitmap_unit=8
* xoffset=0 * xoffset=0
* no extra bytes per line * no extra bytes per line
*/ */
Pixmap XCreateBitmapFromData( Pixmap XCreateBitmapFromData(
Display *display, Display *display,
Drawable d, Drawable d,
......
...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xcmsint.h" #include "Xcmsint.h"
Colormap XCreateColormap(dpy, w, visual, alloc) Colormap XCreateColormap(
register Display *dpy; register Display *dpy,
Window w; Window w,
Visual *visual; Visual *visual,
int alloc; int alloc)
{ {
register xCreateColormapReq *req; register xCreateColormapReq *req;
Colormap mid; Colormap mid;
...@@ -51,7 +51,9 @@ int alloc; ...@@ -51,7 +51,9 @@ int alloc;
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
#ifdef XCMS
_XcmsAddCmapRec(dpy, mid, w, visual); _XcmsAddCmapRec(dpy, mid, w, visual);
#endif
return(mid); return(mid);
} }
...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
...@@ -40,19 +39,22 @@ _XTryShapeBitmapCursor (Display *dpy, ...@@ -40,19 +39,22 @@ _XTryShapeBitmapCursor (Display *dpy,
unsigned int x, unsigned int x,
unsigned int y); unsigned int y);
#endif #endif
Cursor XCreatePixmapCursor(dpy, source, mask, foreground, background, x, y)
register Display *dpy;
Pixmap source, mask;
XColor *foreground, *background;
unsigned int x, y;
{ Cursor XCreatePixmapCursor(
register Display *dpy,
Pixmap source,
Pixmap mask,
XColor *foreground,
XColor *background,
unsigned int x,
unsigned int y)
{
register xCreateCursorReq *req; register xCreateCursorReq *req;
Cursor cid; Cursor cid;
#ifdef USE_DYNAMIC_XCURSOR #ifdef USE_DYNAMIC_XCURSOR
cid = _XTryShapeBitmapCursor (dpy, source, mask, cid = _XTryShapeBitmapCursor (dpy, source, mask,
foreground, background, x, y); foreground, background, x, y);
if (cid) if (cid)
return cid; return cid;
......
...@@ -61,11 +61,11 @@ static void _XGenerateGCList( ...@@ -61,11 +61,11 @@ static void _XGenerateGCList(
GC gc, GC gc,
xReq *req); xReq *req);
GC XCreateGC (dpy, d, valuemask, values) GC XCreateGC (
register Display *dpy; register Display *dpy,
Drawable d; /* Window or Pixmap for which depth matches */ Drawable d, /* Window or Pixmap for which depth matches */
unsigned long valuemask; /* which ones to set initially */ unsigned long valuemask, /* which ones to set initially */
XGCValues *values; /* the values themselves */ XGCValues *values) /* the values themselves */
{ {
register GC gc; register GC gc;
register xCreateGCReq *req; register xCreateGCReq *req;
...@@ -148,10 +148,10 @@ _XGenerateGCList ( ...@@ -148,10 +148,10 @@ _XGenerateGCList (
req->length += (nvalues = value - values); req->length += (nvalues = value - values);
/* /*
* note: Data is a macro that uses its arguments multiple * note: Data is a macro that uses its arguments multiple
* times, so "nvalues" is changed in a separate assignment * times, so "nvalues" is changed in a separate assignment
* statement * statement
*/ */
nvalues <<= 2; nvalues <<= 2;
...@@ -161,11 +161,11 @@ _XGenerateGCList ( ...@@ -161,11 +161,11 @@ _XGenerateGCList (
int int
_XUpdateGCCache (gc, mask, attr) _XUpdateGCCache (
register unsigned long mask; register GC gc,
register XGCValues *attr; register unsigned long mask,
register GC gc; register XGCValues *attr)
{ {
register XGCValues *gv = &gc->values; register XGCValues *gv = &gc->values;
if (mask & GCFunction) if (mask & GCFunction)
...@@ -173,7 +173,7 @@ _XUpdateGCCache (gc, mask, attr) ...@@ -173,7 +173,7 @@ _XUpdateGCCache (gc, mask, attr)
gv->function = attr->function; gv->function = attr->function;
gc->dirty |= GCFunction; gc->dirty |= GCFunction;
} }
if (mask & GCPlaneMask) if (mask & GCPlaneMask)
if (gv->plane_mask != attr->plane_mask) { if (gv->plane_mask != attr->plane_mask) {
gv->plane_mask = attr->plane_mask; gv->plane_mask = attr->plane_mask;
...@@ -209,7 +209,7 @@ _XUpdateGCCache (gc, mask, attr) ...@@ -209,7 +209,7 @@ _XUpdateGCCache (gc, mask, attr)
gv->cap_style = attr->cap_style; gv->cap_style = attr->cap_style;
gc->dirty |= GCCapStyle; gc->dirty |= GCCapStyle;
} }
if (mask & GCJoinStyle) if (mask & GCJoinStyle)
if (gv->join_style != attr->join_style) { if (gv->join_style != attr->join_style) {
gv->join_style = attr->join_style; gv->join_style = attr->join_style;
...@@ -308,13 +308,13 @@ _XUpdateGCCache (gc, mask, attr) ...@@ -308,13 +308,13 @@ _XUpdateGCCache (gc, mask, attr)
gc->dashes = 0; gc->dashes = 0;
} }
return 0; return 0;
} }
/* can only call when display is already locked. */ /* can only call when display is already locked. */
void _XFlushGCCache(dpy, gc) void _XFlushGCCache(
Display *dpy; Display *dpy,
GC gc; GC gc)
{ {
register xChangeGCReq *req; register xChangeGCReq *req;
register _XExtension *ext; register _XExtension *ext;
...@@ -331,13 +331,15 @@ void _XFlushGCCache(dpy, gc) ...@@ -331,13 +331,15 @@ void _XFlushGCCache(dpy, gc)
} }
} }
void XFlushGC(dpy, gc) void
Display *dpy; XFlushGC(
GC gc; Display *dpy,
GC gc)
{ {
FlushGC(dpy, gc); FlushGC(dpy, gc);
} }
GContext XGContextFromGC(gc) GContext XGContextFromGC(GC gc)
GC gc; {
{ return (gc->gid); } return (gc->gid);
}
...@@ -44,14 +44,18 @@ in this Software without prior written authorization from The Open Group. ...@@ -44,14 +44,18 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Cr.h" #include "Cr.h"
#ifdef __CYGWIN__
#define LIBXCURSOR "cygXcursor-1.dll"
#endif
#if defined(hpux) #if defined(hpux)
typedef shl_dt XModuleType; typedef shl_t XModuleType;
#else #else
typedef void *XModuleType; typedef void *XModuleType;
#endif #endif
#ifndef LIBXCURSOR #ifndef LIBXCURSOR
#define LIBXCURSOR "libXcursor.so" #define LIBXCURSOR "libXcursor.so.1"
#endif #endif
static char libraryName[] = LIBXCURSOR; static char libraryName[] = LIBXCURSOR;
...@@ -76,18 +80,18 @@ open_library (void) ...@@ -76,18 +80,18 @@ open_library (void)
break; break;
*dot = '\0'; *dot = '\0';
} }
return 0; return NULL;
} }
static void * static void *
fetch_symbol (XModuleType module, char *under_symbol) fetch_symbol (XModuleType module, const char *under_symbol)
{ {
void *result = NULL; void *result = NULL;
char *symbol = under_symbol + 1; const char *symbol = under_symbol + 1;
#if defined(hpux) #if defined(hpux)
int getsyms_cnt, i; int getsyms_cnt, i;
struct shl_symbol *symbols; struct shl_symbol *symbols;
getsyms_cnt = shl_getsymbols(module, TYPE_PROCEDURE, getsyms_cnt = shl_getsymbols(module, TYPE_PROCEDURE,
EXPORT_SYMBOLS, malloc, &symbols); EXPORT_SYMBOLS, malloc, &symbols);
...@@ -218,20 +222,20 @@ _XTryShapeBitmapCursor (Display *dpy, ...@@ -218,20 +222,20 @@ _XTryShapeBitmapCursor (Display *dpy,
} }
#endif #endif
Cursor XCreateGlyphCursor(dpy, source_font, mask_font, Cursor XCreateGlyphCursor(
source_char, mask_char, register Display *dpy,
foreground, background) Font source_font,
register Display *dpy; Font mask_font,
Font source_font, mask_font; unsigned int source_char,
unsigned int source_char, mask_char; unsigned int mask_char,
XColor _Xconst *foreground, *background; XColor _Xconst *foreground,
XColor _Xconst *background)
{ {
Cursor cid; Cursor cid;
register xCreateGlyphCursorReq *req; register xCreateGlyphCursorReq *req;
#ifdef USE_DYNAMIC_XCURSOR #ifdef USE_DYNAMIC_XCURSOR
cid = _XTryShapeCursor (dpy, source_font, mask_font, cid = _XTryShapeCursor (dpy, source_font, mask_font,
source_char, mask_char, foreground, background); source_char, mask_char, foreground, background);
if (cid) if (cid)
return cid; return cid;
......
...@@ -33,7 +33,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,7 +33,7 @@ in this Software without prior written authorization from The Open Group.
/* /*
* XCreatePixmapFromBitmapData: Routine to make a pixmap from user supplied bitmap data. * XCreatePixmapFromBitmapData: Routine to make a pixmap from user supplied bitmap data.
* D is any drawable on the same screen that the pixmap will be used in. * D is any drawable on the same screen that the pixmap will be used in.
* Data is a pointer to the bit data, and * Data is a pointer to the bit data, and
* width & height give the size in bits of the pixmap. * width & height give the size in bits of the pixmap.
* Fg and Bg are the pixel values to use for the two colors. * Fg and Bg are the pixel values to use for the two colors.
* Depth is the depth of the pixmap to create. * Depth is the depth of the pixmap to create.
...@@ -47,14 +47,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -47,14 +47,16 @@ in this Software without prior written authorization from The Open Group.
* bitmap_unit=8 * bitmap_unit=8
* xoffset=0 * xoffset=0
* no extra bytes per line * no extra bytes per line
*/ */
Pixmap XCreatePixmapFromBitmapData(display,d,data,width,height,fg,bg,depth) Pixmap XCreatePixmapFromBitmapData(
Display *display; Display *display,
Drawable d; Drawable d,
char *data; char *data,
unsigned int width, height; unsigned int width,
unsigned long fg, bg; unsigned int height,
unsigned int depth; unsigned long fg,
unsigned long bg,
unsigned int depth)
{ {
XImage ximage; XImage ximage;
GC gc; GC gc;
......
...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -23,7 +23,6 @@ used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group. in this Software without prior written authorization from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
...@@ -38,10 +37,12 @@ _XNoticeCreateBitmap (Display *dpy, ...@@ -38,10 +37,12 @@ _XNoticeCreateBitmap (Display *dpy,
unsigned int height); unsigned int height);
#endif #endif
Pixmap XCreatePixmap (dpy, d, width, height, depth) Pixmap XCreatePixmap (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
unsigned int width, height, depth; unsigned int width,
unsigned int height,
unsigned int depth)
{ {
Pixmap pid; Pixmap pid;
register xCreatePixmapReq *req; register xCreatePixmapReq *req;
......
...@@ -29,14 +29,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,14 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Window XCreateSimpleWindow(dpy, parent, x, y, width, height, Window XCreateSimpleWindow(
borderWidth, border, background) register Display *dpy,
register Display *dpy; Window parent,
Window parent; int x,
int x, y; int y,
unsigned int width, height, borderWidth; unsigned int width,
unsigned long border; unsigned int height,
unsigned long background; unsigned int borderWidth,
unsigned long border,
unsigned long background)
{ {
Window wid; Window wid;
register xCreateWindowReq *req; register xCreateWindowReq *req;
......
...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,11 +31,11 @@ in this Software without prior written authorization from The Open Group.
static XColor _Xconst foreground = { 0, 0, 0, 0 }; /* black */ static XColor _Xconst foreground = { 0, 0, 0, 0 }; /* black */
static XColor _Xconst background = { 0, 65535, 65535, 65535 }; /* white */ static XColor _Xconst background = { 0, 65535, 65535, 65535 }; /* white */
Cursor XCreateFontCursor(dpy, which) Cursor XCreateFontCursor(
Display *dpy; Display *dpy,
unsigned int which; unsigned int which)
{ {
/* /*
* the cursor font contains the shape glyph followed by the mask * the cursor font contains the shape glyph followed by the mask
* glyph; so character position 0 contains a shape, 1 the mask for 0, * glyph; so character position 0 contains a shape, 1 the mask for 0,
* 2 a shape, etc. <X11/cursorfont.h> contains hash define names * 2 a shape, etc. <X11/cursorfont.h> contains hash define names
...@@ -47,7 +47,7 @@ Cursor XCreateFontCursor(dpy, which) ...@@ -47,7 +47,7 @@ Cursor XCreateFontCursor(dpy, which)
if (dpy->cursor_font == None) return None; if (dpy->cursor_font == None) return None;
} }
return XCreateGlyphCursor (dpy, dpy->cursor_font, dpy->cursor_font, return XCreateGlyphCursor (dpy, dpy->cursor_font, dpy->cursor_font,
which, which + 1, &foreground, &background); which, which + 1, &foreground, &background);
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -237,7 +237,7 @@ ConvertMixedColors( ...@@ -237,7 +237,7 @@ ConvertMixedColors(
* batches: * batches:
* DI to DD * DI to DD
* DD to DI(not CIEXYZ) * DD to DI(not CIEXYZ)
* *
* format_flag: * format_flag:
* 0x01 : convert Device-Dependent only specifications to the * 0x01 : convert Device-Dependent only specifications to the
* target format. * target format.
...@@ -419,7 +419,7 @@ _XcmsDIConvertColors( ...@@ -419,7 +419,7 @@ _XcmsDIConvertColors(
* 3. The calling routine may want to convert only between * 3. The calling routine may want to convert only between
* CIExyY <-> CIEXYZ <-> CIEuvY * CIExyY <-> CIEXYZ <-> CIEuvY
* therefore, this routine allows pWhitePt to equal NULL. * therefore, this routine allows pWhitePt to equal NULL.
* *
* *
* RETURNS * RETURNS
* XcmsFailure if failed, * XcmsFailure if failed,
...@@ -505,7 +505,7 @@ Continue: ...@@ -505,7 +505,7 @@ Continue:
* complementary, i.e., * complementary, i.e.,
* for an i, 0 <= i < n elements * for an i, 0 <= i < n elements
* from_CIEXYZ[i] is not the inverse of to_CIEXYZ[i] * from_CIEXYZ[i] is not the inverse of to_CIEXYZ[i]
* *
* Execute the functions all the way to CIEXYZ * Execute the functions all the way to CIEXYZ
*/ */
while (*src_to_CIEXYZ) { while (*src_to_CIEXYZ) {
...@@ -601,7 +601,7 @@ _XcmsDDConvertColors( ...@@ -601,7 +601,7 @@ _XcmsDDConvertColors(
/* /*
* Its ok if pColors_in_out->format == XcmsCIEXYZFormat * Its ok if pColors_in_out->format == XcmsCIEXYZFormat
* or * or
* if newFormat == XcmsCIEXYZFormat * if newFormat == XcmsCIEXYZFormat
*/ */
if ( !( ValidDDColorSpaceID(ccc, pColors_in_out->format) if ( !( ValidDDColorSpaceID(ccc, pColors_in_out->format)
...@@ -668,7 +668,7 @@ Continue: ...@@ -668,7 +668,7 @@ Continue:
* complementary, i.e., * complementary, i.e.,
* for an i, 0 <= i < n elements * for an i, 0 <= i < n elements
* from_CIEXYZ[i] is not the inverse of to_CIEXYZ[i] * from_CIEXYZ[i] is not the inverse of to_CIEXYZ[i]
* *
* Execute the functions all the way to CIEXYZ * Execute the functions all the way to CIEXYZ
*/ */
while (*src_to_CIEXYZ) { while (*src_to_CIEXYZ) {
...@@ -712,12 +712,12 @@ Continue: ...@@ -712,12 +712,12 @@ Continue:
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsConvertColors(ccc, pColors_in_out, nColors, targetFormat, pCompressed) XcmsConvertColors(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
XcmsColorFormat targetFormat; XcmsColorFormat targetFormat,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* Convert XcmsColor structures to another format * Convert XcmsColor structures to another format
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDefineCursor (dpy, w, cursor) XDefineCursor (
register Display *dpy; register Display *dpy,
Window w; Window w,
Cursor cursor; Cursor cursor)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,10 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDeleteProperty(dpy, window, property) XDeleteProperty(
register Display *dpy; register Display *dpy,
Window window; Window window,
Atom property; Atom property)
{ {
register xDeletePropertyReq *req; register xDeletePropertyReq *req;
......
...@@ -33,10 +33,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,10 +33,10 @@ in this Software without prior written authorization from The Open Group.
/* /*
* XListDepths - return info from connection setup * XListDepths - return info from connection setup
*/ */
int *XListDepths (dpy, scrnum, countp) int *XListDepths (
Display *dpy; Display *dpy,
int scrnum; int scrnum,
int *countp; int *countp)
{ {
Screen *scr; Screen *scr;
int count; int count;
...@@ -51,7 +51,7 @@ int *XListDepths (dpy, scrnum, countp) ...@@ -51,7 +51,7 @@ int *XListDepths (dpy, scrnum, countp)
depths = (int *) Xmalloc (count * sizeof(int)); depths = (int *) Xmalloc (count * sizeof(int));
if (!depths) return NULL; if (!depths) return NULL;
for (i = 0, dp = scr->depths; i < count; i++, dp++) for (i = 0, dp = scr->depths; i < count; i++, dp++)
depths[i] = dp->depth; depths[i] = dp->depth;
} else { } else {
/* a screen must have a depth */ /* a screen must have a depth */
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDestroySubwindows(dpy, win) XDestroySubwindows(
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDestroyWindow (dpy, w) XDestroyWindow (
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -26,17 +26,16 @@ other dealings in this Software without prior written authorization ...@@ -26,17 +26,16 @@ other dealings in this Software without prior written authorization
from The Open Group. from The Open Group.
*/ */
/* $XFree86$ */
/* XDisplayName.c */ /* XDisplayName.c */
/* /*
* Returns the name of the display XOpenDisplay would use. This is better * Returns the name of the display XOpenDisplay would use. This is better
* than just printing the "display" variable in a program because that * than just printing the "display" variable in a program because that
* could be NULL and/or there could be an environment variable set. * could be NULL and/or there could be an environment variable set.
* This makes it easier for programmers to provide meaningful error * This makes it easier for programmers to provide meaningful error
* messages. * messages.
*
* *
*
* For example, this is used in XOpenDisplay() as * For example, this is used in XOpenDisplay() as
* strncpy( displaybuf, XDisplayName( display ), sizeof(displaybuf) ); * strncpy( displaybuf, XDisplayName( display ), sizeof(displaybuf) );
* if ( *displaybuf == '\0' ) return( NULL ); * if ( *displaybuf == '\0' ) return( NULL );
......
...@@ -29,20 +29,23 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,20 +29,23 @@ in this Software without prior written authorization from The Open Group.
We don't do this because X_PolyArc applies the GC's join-style if We don't do this because X_PolyArc applies the GC's join-style if
the last point in one arc coincides with the first point in another. the last point in one arc coincides with the first point in another.
The client wouldn't expect this and would have no easy way to defeat it. */ The client wouldn't expect this and would have no easy way to defeat it. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawArc(dpy, d, gc, x, y, width, height, angle1, angle2) XDrawArc(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
unsigned int width, height; /* CARD16 */ int y, /* INT16 */
int angle1, angle2; /* INT16 */ unsigned int width,
unsigned int height, /* CARD16 */
int angle1,
int angle2) /* INT16 */
{ {
register xPolyArcReq *req; register xPolyArcReq *req;
register xArc *arc; register xArc *arc;
......
...@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group.
#define arc_scale (SIZEOF(xArc) / 4) #define arc_scale (SIZEOF(xArc) / 4)
int int
XDrawArcs(dpy, d, gc, arcs, n_arcs) XDrawArcs(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XArc *arcs; XArc *arcs,
int n_arcs; int n_arcs)
{ {
register xPolyArcReq *req; register xPolyArcReq *req;
register long len; register long len;
......
...@@ -35,11 +35,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -35,11 +35,14 @@ in this Software without prior written authorization from The Open Group.
#define zsize (SIZEOF(xPolySegmentReq) + ZLNSPERBATCH * SIZEOF(xSegment)) #define zsize (SIZEOF(xPolySegmentReq) + ZLNSPERBATCH * SIZEOF(xSegment))
int int
XDrawLine (dpy, d, gc, x1, y1, x2, y2) XDrawLine (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x1, y1, x2, y2; int x1,
int y1,
int x2,
int y2)
{ {
register xSegment *segment; register xSegment *segment;
......
...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawLines (dpy, d, gc, points, npoints, mode) XDrawLines (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XPoint *points; XPoint *points,
int npoints; int npoints,
int mode; int mode)
{ {
register xPolyLineReq *req; register xPolyLineReq *req;
register long length; register long length;
......
...@@ -34,11 +34,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,11 +34,12 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyPointReq) + PTSPERBATCH * SIZEOF(xPoint)) #define size (SIZEOF(xPolyPointReq) + PTSPERBATCH * SIZEOF(xPoint))
int int
XDrawPoint(dpy, d, gc, x, y) XDrawPoint(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
int y) /* INT16 */
{ {
xPoint *point; xPoint *point;
......
...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,13 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawPoints(dpy, d, gc, points, n_points, mode) XDrawPoints(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XPoint *points; XPoint *points,
int n_points; int n_points,
int mode; /* CoordMode */ int mode) /* CoordMode */
{ {
register xPolyPointReq *req; register xPolyPointReq *req;
register long nbytes; register long nbytes;
......
...@@ -35,12 +35,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -35,12 +35,14 @@ in this Software without prior written authorization from The Open Group.
#define zsize (SIZEOF(xPolyRectangleReq) + ZRCTSPERBATCH * SIZEOF(xRectangle)) #define zsize (SIZEOF(xPolyRectangleReq) + ZRCTSPERBATCH * SIZEOF(xRectangle))
int int
XDrawRectangle(dpy, d, gc, x, y, width, height) XDrawRectangle(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
unsigned int width, height; /* CARD16 */ int y, /* INT16 */
unsigned int width,
unsigned int height) /* CARD16 */
{ {
xRectangle *rect; xRectangle *rect;
......
...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawRectangles(dpy, d, gc, rects, n_rects) XDrawRectangles(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XRectangle *rects; XRectangle *rects,
int n_rects; int n_rects)
{ {
register xPolyRectangleReq *req; register xPolyRectangleReq *req;
long len; long len;
......
...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawSegments (dpy, d, gc, segments, nsegments) XDrawSegments (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XSegment *segments; XSegment *segments,
int nsegments; int nsegments)
{ {
register xPolySegmentReq *req; register xPolySegmentReq *req;
long len; long len;
......
/* /*
* $Xorg: ErrDes.c,v 1.4 2001/02/09 02:03:32 xorgcvs Exp $
* $XdotOrg: xc/lib/X11/ErrDes.c,v 1.8 2005/08/26 05:16:46 daniels Exp $
*/ */
/*********************************************************** /***********************************************************
...@@ -32,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -32,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved All Rights Reserved
Permission to use, copy, modify, and distribute this software and its Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission. software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
...@@ -70,34 +68,40 @@ SOFTWARE. ...@@ -70,34 +68,40 @@ SOFTWARE.
* descriptions of errors in Section 4 of Protocol doc (pp. 350-351); more * descriptions of errors in Section 4 of Protocol doc (pp. 350-351); more
* verbose descriptions are given in the error database * verbose descriptions are given in the error database
*/ */
static const char * const _XErrorList[] = { static const char _XErrorList[] =
/* No error */ "no error", /* No error */ "no error\0"
/* BadRequest */ "BadRequest", /* BadRequest */ "BadRequest\0"
/* BadValue */ "BadValue", /* BadValue */ "BadValue\0"
/* BadWindow */ "BadWindow", /* BadWindow */ "BadWindow\0"
/* BadPixmap */ "BadPixmap", /* BadPixmap */ "BadPixmap\0"
/* BadAtom */ "BadAtom", /* BadAtom */ "BadAtom\0"
/* BadCursor */ "BadCursor", /* BadCursor */ "BadCursor\0"
/* BadFont */ "BadFont", /* BadFont */ "BadFont\0"
/* BadMatch */ "BadMatch", /* BadMatch */ "BadMatch\0"
/* BadDrawable */ "BadDrawable", /* BadDrawable */ "BadDrawable\0"
/* BadAccess */ "BadAccess", /* BadAccess */ "BadAccess\0"
/* BadAlloc */ "BadAlloc", /* BadAlloc */ "BadAlloc\0"
/* BadColor */ "BadColor", /* BadColor */ "BadColor\0"
/* BadGC */ "BadGC", /* BadGC */ "BadGC\0"
/* BadIDChoice */ "BadIDChoice", /* BadIDChoice */ "BadIDChoice\0"
/* BadName */ "BadName", /* BadName */ "BadName\0"
/* BadLength */ "BadLength", /* BadLength */ "BadLength\0"
/* BadImplementation */ "BadImplementation", /* BadImplementation */ "BadImplementation"
;
/* offsets into _XErrorList */
static const unsigned char _XErrorOffsets[] = {
0, 9, 20, 29, 39, 49, 57, 67, 75, 84, 96,
106, 115, 124, 130, 142, 150, 160
}; };
int int
XGetErrorText(dpy, code, buffer, nbytes) XGetErrorText(
register int code; register Display *dpy,
register Display *dpy; register int code,
char *buffer; char *buffer,
int nbytes; int nbytes)
{ {
char buf[150]; char buf[150];
register _XExtension *ext; register _XExtension *ext;
...@@ -106,7 +110,8 @@ XGetErrorText(dpy, code, buffer, nbytes) ...@@ -106,7 +110,8 @@ XGetErrorText(dpy, code, buffer, nbytes)
if (nbytes == 0) return 0; if (nbytes == 0) return 0;
if (code <= BadImplementation && code > 0) { if (code <= BadImplementation && code > 0) {
sprintf(buf, "%d", code); sprintf(buf, "%d", code);
(void) XGetErrorDatabaseText(dpy, "XProtoError", buf, _XErrorList[code], (void) XGetErrorDatabaseText(dpy, "XProtoError", buf,
_XErrorList + _XErrorOffsets[code],
buffer, nbytes); buffer, nbytes);
} else } else
buffer[0] = '\0'; buffer[0] = '\0';
...@@ -115,10 +120,10 @@ XGetErrorText(dpy, code, buffer, nbytes) ...@@ -115,10 +120,10 @@ XGetErrorText(dpy, code, buffer, nbytes)
if (ext->error_string) if (ext->error_string)
(*ext->error_string)(dpy, code, &ext->codes, buffer, nbytes); (*ext->error_string)(dpy, code, &ext->codes, buffer, nbytes);
if (ext->codes.first_error && if (ext->codes.first_error &&
ext->codes.first_error < code && ext->codes.first_error <= code &&
(!bext || ext->codes.first_error > bext->codes.first_error)) (!bext || ext->codes.first_error > bext->codes.first_error))
bext = ext; bext = ext;
} }
if (!buffer[0] && bext) { if (!buffer[0] && bext) {
sprintf(buf, "%s.%d", bext->name, code - bext->codes.first_error); sprintf(buf, "%s.%d", bext->name, code - bext->codes.first_error);
(void) XGetErrorDatabaseText(dpy, "XProtoError", buf, "", buffer, nbytes); (void) XGetErrorDatabaseText(dpy, "XProtoError", buf, "", buffer, nbytes);
...@@ -186,7 +191,7 @@ XGetErrorDatabaseText( ...@@ -186,7 +191,7 @@ XGetErrorDatabaseText(
tptr = Xmalloc (tlen); tptr = Xmalloc (tlen);
if (tptr) { if (tptr) {
sprintf(tptr, "%s.%s", name, type); sprintf(tptr, "%s.%s", name, type);
XrmGetResource(db, tptr, "ErrorType.ErrorNumber", XrmGetResource(db, tptr, "ErrorType.ErrorNumber",
&type_str, &result); &type_str, &result);
if (tptr != temp) if (tptr != temp)
Xfree (tptr); Xfree (tptr);
......
...@@ -38,13 +38,15 @@ from The Open Group. ...@@ -38,13 +38,15 @@ from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
/* /*
* reformat a wire event into an XEvent structure of the right type. * Reformat an XEvent structure to a wire event of the right type.
* Return True on success. If the type is unrecognized, return what
* _XUnknownNativeEvent returns (i.e., False).
*/ */
Status Status
_XEventToWire( _XEventToWire(
register Display *dpy, /* pointer to display structure */ register Display *dpy,
register XEvent *re, /* pointer to where event should be reformatted */ register XEvent *re, /* in: from */
register xEvent *event) /* wire protocol event */ register xEvent *event) /* out: to */
{ {
switch (event->u.u.type = re->type) { switch (event->u.u.type = re->type) {
case KeyPress: case KeyPress:
...@@ -351,12 +353,12 @@ register xEvent *event) /* wire protocol event */ ...@@ -351,12 +353,12 @@ register xEvent *event) /* wire protocol event */
case ClientMessage: case ClientMessage:
{ {
register int i; register int i;
register XClientMessageEvent *ev register XClientMessageEvent *ev
= (XClientMessageEvent *) re; = (XClientMessageEvent *) re;
event->u.clientMessage.window = ev->window; event->u.clientMessage.window = ev->window;
event->u.u.detail = ev->format; event->u.u.detail = ev->format;
switch (ev->format) { switch (ev->format) {
case 8: case 8:
event->u.clientMessage.u.b.type = ev->message_type; event->u.clientMessage.u.b.type = ev->message_type;
for (i = 0; i < 20; i++) for (i = 0; i < 20; i++)
event->u.clientMessage.u.b.bytes[i] = ev->data.b[i]; event->u.clientMessage.u.b.bytes[i] = ev->data.b[i];
...@@ -396,7 +398,7 @@ register xEvent *event) /* wire protocol event */ ...@@ -396,7 +398,7 @@ register xEvent *event) /* wire protocol event */
event->u.mappingNotify.count = ev->count; event->u.mappingNotify.count = ev->count;
} }
break; break;
default: default:
return(_XUnknownNativeEvent(dpy, re, event)); return(_XUnknownNativeEvent(dpy, re, event));
} }
......
...@@ -30,28 +30,23 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,28 +30,23 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XActivateScreenSaver(dpy) XActivateScreenSaver(register Display *dpy)
register Display *dpy;
{ {
XForceScreenSaver (dpy, ScreenSaverActive); XForceScreenSaver (dpy, ScreenSaverActive);
return 1; return 1;
} }
int int
XResetScreenSaver(dpy) XResetScreenSaver(register Display *dpy)
register Display *dpy;
{ {
XForceScreenSaver (dpy, ScreenSaverReset); XForceScreenSaver (dpy, ScreenSaverReset);
return 1; return 1;
} }
int int
XForceScreenSaver(dpy, mode) XForceScreenSaver(
register Display *dpy; register Display *dpy,
int mode; int mode)
{ {
register xForceScreenSaverReq *req; register xForceScreenSaverReq *req;
......
...@@ -17,15 +17,15 @@ ...@@ -17,15 +17,15 @@
* OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO * OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE * FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* *
* M. Collins OSF * M. Collins OSF
* *
* Katsuhisa Yano TOSHIBA Corp. * Katsuhisa Yano TOSHIBA Corp.
*/ */
/* /*
...@@ -179,13 +179,13 @@ XCreateFontSet ( ...@@ -179,13 +179,13 @@ XCreateFontSet (
om = XOpenOM(dpy, NULL, NULL, NULL); om = XOpenOM(dpy, NULL, NULL, NULL);
if (om == NULL) if (om == NULL)
return (XFontSet) NULL; return (XFontSet) NULL;
if ((oc = XCreateOC(om, XNBaseFontName, base_font_name_list, NULL))) { if ((oc = XCreateOC(om, XNBaseFontName, base_font_name_list, NULL))) {
list = &oc->core.missing_list; list = &oc->core.missing_list;
oc->core.om_automatic = True; oc->core.om_automatic = True;
} else } else
list = &om->core.required_charset; list = &om->core.required_charset;
*missing_charset_list = copy_string_list(list->charset_list, *missing_charset_list = copy_string_list(list->charset_list,
list->charset_count); list->charset_count);
*missing_charset_count = list->charset_count; *missing_charset_count = list->charset_count;
...@@ -198,7 +198,7 @@ XCreateFontSet ( ...@@ -198,7 +198,7 @@ XCreateFontSet (
if (!*def_string) if (!*def_string)
*def_string = ""; *def_string = "";
} }
if (oc == NULL) if (oc == NULL)
XCloseOM(om); XCloseOM(om);
...@@ -206,10 +206,10 @@ XCreateFontSet ( ...@@ -206,10 +206,10 @@ XCreateFontSet (
} }
int int
XFontsOfFontSet(font_set, font_struct_list, font_name_list) XFontsOfFontSet(
XFontSet font_set; XFontSet font_set,
XFontStruct ***font_struct_list; XFontStruct ***font_struct_list,
char ***font_name_list; char ***font_name_list)
{ {
*font_name_list = font_set->core.font_info.font_name_list; *font_name_list = font_set->core.font_info.font_name_list;
*font_struct_list = font_set->core.font_info.font_struct_list; *font_struct_list = font_set->core.font_info.font_struct_list;
...@@ -217,50 +217,47 @@ XFontsOfFontSet(font_set, font_struct_list, font_name_list) ...@@ -217,50 +217,47 @@ XFontsOfFontSet(font_set, font_struct_list, font_name_list)
} }
char * char *
XBaseFontNameListOfFontSet(font_set) XBaseFontNameListOfFontSet(XFontSet font_set)
XFontSet font_set;
{ {
return font_set->core.base_name_list; return font_set->core.base_name_list;
} }
char * char *
XLocaleOfFontSet(font_set) XLocaleOfFontSet(XFontSet font_set)
XFontSet font_set;
{ {
return font_set->core.om->core.lcd->core->name; return font_set->core.om->core.lcd->core->name;
} }
extern Bool XContextDependentDrawing(font_set) Bool
XFontSet font_set; XContextDependentDrawing(XFontSet font_set)
{ {
return font_set->core.om->core.context_dependent; return font_set->core.om->core.context_dependent;
} }
Bool Bool
XDirectionalDependentDrawing(font_set) XDirectionalDependentDrawing(XFontSet font_set)
XFontSet font_set;
{ {
return font_set->core.om->core.directional_dependent; return font_set->core.om->core.directional_dependent;
} }
Bool Bool
XContextualDrawing(font_set) XContextualDrawing(XFontSet font_set)
XFontSet font_set;
{ {
return font_set->core.om->core.contextual_drawing; return font_set->core.om->core.contextual_drawing;
} }
XFontSetExtents * XFontSetExtents *
XExtentsOfFontSet(font_set) XExtentsOfFontSet(XFontSet font_set)
XFontSet font_set;
{ {
if (!font_set)
return NULL;
return &font_set->core.font_set_extents; return &font_set->core.font_set_extents;
} }
void void
XFreeFontSet(dpy, font_set) XFreeFontSet(
Display *dpy; Display *dpy,
XFontSet font_set; XFontSet font_set)
{ {
XCloseOM(font_set->core.om); XCloseOM(font_set->core.om);
} }
...@@ -33,17 +33,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,17 +33,17 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h> #include <stdio.h>
Status XFetchName (dpy, w, name) Status XFetchName (
register Display *dpy; register Display *dpy,
Window w; Window w,
char **name; char **name)
{ {
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
unsigned long nitems; unsigned long nitems;
unsigned long leftover; unsigned long leftover;
unsigned char *data = NULL; unsigned char *data = NULL;
if (XGetWindowProperty(dpy, w, XA_WM_NAME, 0L, (long)BUFSIZ, False, XA_STRING, if (XGetWindowProperty(dpy, w, XA_WM_NAME, 0L, (long)BUFSIZ, False, XA_STRING,
&actual_type, &actual_type,
&actual_format, &nitems, &leftover, &data) != Success) { &actual_format, &nitems, &leftover, &data) != Success) {
*name = NULL; *name = NULL;
...@@ -63,10 +63,10 @@ Status XFetchName (dpy, w, name) ...@@ -63,10 +63,10 @@ Status XFetchName (dpy, w, name)
return(0); return(0);
} }
Status XGetIconName (dpy, w, icon_name) Status XGetIconName (
register Display *dpy; register Display *dpy,
Window w; Window w,
char **icon_name; char **icon_name)
{ {
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
...@@ -74,7 +74,7 @@ Status XGetIconName (dpy, w, icon_name) ...@@ -74,7 +74,7 @@ Status XGetIconName (dpy, w, icon_name)
unsigned long leftover; unsigned long leftover;
unsigned char *data = NULL; unsigned char *data = NULL;
if (XGetWindowProperty(dpy, w, XA_WM_ICON_NAME, 0L, (long)BUFSIZ, False, if (XGetWindowProperty(dpy, w, XA_WM_ICON_NAME, 0L, (long)BUFSIZ, False,
XA_STRING, XA_STRING,
&actual_type, &actual_type,
&actual_format, &nitems, &leftover, &data) != Success) { &actual_format, &nitems, &leftover, &data) != Success) {
*icon_name = NULL; *icon_name = NULL;
......
...@@ -34,13 +34,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,13 +34,16 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyFillArcReq) + FARCSPERBATCH * SIZEOF(xArc)) #define size (SIZEOF(xPolyFillArcReq) + FARCSPERBATCH * SIZEOF(xArc))
int int
XFillArc(dpy, d, gc, x, y, width, height, angle1, angle2) XFillArc(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
unsigned int width, height; /* CARD16 */ int y, /* INT16 */
int angle1, angle2; /* INT16 */ unsigned int width,
unsigned int height, /* CARD16 */
int angle1,
int angle2) /* INT16 */
{ {
xArc *arc; xArc *arc;
......
...@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,12 +32,12 @@ in this Software without prior written authorization from The Open Group.
#define arc_scale (SIZEOF(xArc) / 4) #define arc_scale (SIZEOF(xArc) / 4)
int int
XFillArcs(dpy, d, gc, arcs, n_arcs) XFillArcs(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XArc *arcs; XArc *arcs,
int n_arcs; int n_arcs)
{ {
register xPolyFillArcReq *req; register xPolyFillArcReq *req;
long len; long len;
......
...@@ -30,14 +30,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,14 +30,14 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFillPolygon(dpy, d, gc, points, n_points, shape, mode) XFillPolygon(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XPoint *points; XPoint *points,
int n_points; int n_points,
int shape; int shape,
int mode; int mode)
{ {
register xFillPolyReq *req; register xFillPolyReq *req;
register long nbytes; register long nbytes;
...@@ -56,7 +56,7 @@ int mode; ...@@ -56,7 +56,7 @@ int mode;
/* shift (mult. by 4) before passing to the (possible) macro */ /* shift (mult. by 4) before passing to the (possible) macro */
nbytes = n_points << 2; nbytes = n_points << 2;
Data16 (dpy, (short *) points, nbytes); Data16 (dpy, (short *) points, nbytes);
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
......
...@@ -34,12 +34,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,12 +34,14 @@ in this Software without prior written authorization from The Open Group.
#define size (SIZEOF(xPolyFillRectangleReq) + FRCTSPERBATCH * SIZEOF(xRectangle)) #define size (SIZEOF(xPolyFillRectangleReq) + FRCTSPERBATCH * SIZEOF(xRectangle))
int int
XFillRectangle(dpy, d, gc, x, y, width, height) XFillRectangle(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; /* INT16 */ int x,
unsigned int width, height; /* CARD16 */ int y, /* INT16 */
unsigned int width,
unsigned int height) /* CARD16 */
{ {
xRectangle *rect; xRectangle *rect;
...@@ -47,7 +49,7 @@ XFillRectangle(dpy, d, gc, x, y, width, height) ...@@ -47,7 +49,7 @@ XFillRectangle(dpy, d, gc, x, y, width, height)
FlushGC(dpy, gc); FlushGC(dpy, gc);
{ {
register xPolyFillRectangleReq *req register xPolyFillRectangleReq *req
= (xPolyFillRectangleReq *) dpy->last_req; = (xPolyFillRectangleReq *) dpy->last_req;
/* if same as previous request, with same drawable, batch requests */ /* if same as previous request, with same drawable, batch requests */
......
...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFillRectangles(dpy, d, gc, rectangles, n_rects) XFillRectangles(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
XRectangle *rectangles; XRectangle *rectangles,
int n_rects; int n_rects)
{ {
register xPolyFillRectangleReq *req; register xPolyFillRectangleReq *req;
long len; long len;
...@@ -63,4 +63,3 @@ int n_rects; ...@@ -63,4 +63,3 @@ int n_rects;
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
* *
* Author: Seiji Kuwari OMRON Corporation * Author: Seiji Kuwari OMRON Corporation
* kuwa@omron.co.jp * kuwa@omron.co.jp
* kuwa%omron.co.jp@uunet.uu.net * kuwa%omron.co.jp@uunet.uu.net
*/ */
/* /*
...@@ -69,9 +69,9 @@ extern long const _Xevent_to_mask[]; ...@@ -69,9 +69,9 @@ extern long const _Xevent_to_mask[];
* Look up if there is a specified filter for the event. * Look up if there is a specified filter for the event.
*/ */
Bool Bool
XFilterEvent(ev, window) XFilterEvent(
XEvent *ev; XEvent *ev,
Window window; Window window)
{ {
#if XLOCALE #if XLOCALE
XFilterEventList p; XFilterEventList p;
...@@ -93,9 +93,9 @@ XFilterEvent(ev, window) ...@@ -93,9 +93,9 @@ XFilterEvent(ev, window)
if (win == p->window) { if (win == p->window) {
if ((mask & p->event_mask) || if ((mask & p->event_mask) ||
(ev->type >= p->start_type && ev->type <= p->end_type)) { (ev->type >= p->start_type && ev->type <= p->end_type)) {
UnlockDisplay(ev->xany.display);
ret = (*(p->filter))(ev->xany.display, p->window, ev, ret = (*(p->filter))(ev->xany.display, p->window, ev,
p->client_data); p->client_data);
UnlockDisplay(ev->xany.display);
return(ret); return(ret);
} }
} }
......
...@@ -33,9 +33,8 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,9 +33,8 @@ in this Software without prior written authorization from The Open Group.
/* NOTE: NOT necessary when calling any of the Xlib routines. */ /* NOTE: NOT necessary when calling any of the Xlib routines. */
int int
XFlush (dpy) XFlush (register Display *dpy)
register Display *dpy; {
{
LockDisplay(dpy); LockDisplay(dpy);
_XFlush (dpy); _XFlush (dpy);
UnlockDisplay(dpy); UnlockDisplay(dpy);
......
...@@ -123,9 +123,9 @@ XFontStruct *XLoadQueryFont( ...@@ -123,9 +123,9 @@ XFontStruct *XLoadQueryFont(
return font_result; return font_result;
} }
XFontStruct *XQueryFont (dpy, fid) XFontStruct *XQueryFont (
register Display *dpy; register Display *dpy,
Font fid; Font fid)
{ {
XFontStruct *font_result; XFontStruct *font_result;
#ifdef USE_XF86BIGFONT #ifdef USE_XF86BIGFONT
...@@ -147,10 +147,10 @@ XFontStruct *XQueryFont (dpy, fid) ...@@ -147,10 +147,10 @@ XFontStruct *XQueryFont (dpy, fid)
} }
int int
XFreeFont(dpy, fs) XFreeFont(
register Display *dpy; register Display *dpy,
XFontStruct *fs; XFontStruct *fs)
{ {
register xResourceReq *req; register xResourceReq *req;
register _XExtension *ext; register _XExtension *ext;
...@@ -177,10 +177,10 @@ XFreeFont(dpy, fs) ...@@ -177,10 +177,10 @@ XFreeFont(dpy, fs)
static XFontStruct * static XFontStruct *
_XQueryFont (dpy, fid, seq) _XQueryFont (
register Display *dpy; register Display *dpy,
Font fid; Font fid,
unsigned long seq; unsigned long seq)
{ {
register XFontStruct *fs; register XFontStruct *fs;
register long nbytes; register long nbytes;
...@@ -227,13 +227,13 @@ _XQueryFont (dpy, fid, seq) ...@@ -227,13 +227,13 @@ _XQueryFont (dpy, fid, seq)
fs->all_chars_exist = reply.allCharsExist; fs->all_chars_exist = reply.allCharsExist;
fs->ascent = cvtINT16toInt (reply.fontAscent); fs->ascent = cvtINT16toInt (reply.fontAscent);
fs->descent = cvtINT16toInt (reply.fontDescent); fs->descent = cvtINT16toInt (reply.fontDescent);
/* XXX the next two statements won't work if short isn't 16 bits */ /* XXX the next two statements won't work if short isn't 16 bits */
fs->min_bounds = * (XCharStruct *) &reply.minBounds; fs->min_bounds = * (XCharStruct *) &reply.minBounds;
fs->max_bounds = * (XCharStruct *) &reply.maxBounds; fs->max_bounds = * (XCharStruct *) &reply.maxBounds;
fs->n_properties = reply.nFontProps; fs->n_properties = reply.nFontProps;
/* /*
* if no properties defined for the font, then it is bad * if no properties defined for the font, then it is bad
* font, but shouldn't try to read nothing. * font, but shouldn't try to read nothing.
*/ */
...@@ -384,11 +384,11 @@ _XF86BigfontFreeNop ( ...@@ -384,11 +384,11 @@ _XF86BigfontFreeNop (
} }
static XFontStruct * static XFontStruct *
_XF86BigfontQueryFont (dpy, extcodes, fid, seq) _XF86BigfontQueryFont (
register Display *dpy; register Display *dpy,
XF86BigfontCodes *extcodes; XF86BigfontCodes *extcodes,
Font fid; Font fid,
unsigned long seq; unsigned long seq)
{ {
register XFontStruct *fs; register XFontStruct *fs;
register long nbytes; register long nbytes;
...@@ -470,7 +470,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq) ...@@ -470,7 +470,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq)
fs->max_bounds = * (XCharStruct *) &reply.maxBounds; fs->max_bounds = * (XCharStruct *) &reply.maxBounds;
fs->n_properties = reply.nFontProps; fs->n_properties = reply.nFontProps;
/* /*
* if no properties defined for the font, then it is bad * if no properties defined for the font, then it is bad
* font, but shouldn't try to read nothing. * font, but shouldn't try to read nothing.
*/ */
...@@ -554,7 +554,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq) ...@@ -554,7 +554,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq)
signature. Then we set the CAP_VerifiedLocal bit to indicate signature. Then we set the CAP_VerifiedLocal bit to indicate
the verification was successful. */ the verification was successful. */
if ((addr = shmat(reply.shmid, 0, SHM_RDONLY)) == (char *)-1) { if ((addr = shmat(reply.shmid, NULL, SHM_RDONLY)) == (char *)-1) {
if (extcodes->serverCapabilities & CAP_VerifiedLocal) if (extcodes->serverCapabilities & CAP_VerifiedLocal)
fprintf(stderr, "_XF86BigfontQueryFont: could not attach shm segment\n"); fprintf(stderr, "_XF86BigfontQueryFont: could not attach shm segment\n");
Xfree((char *) pData); Xfree((char *) pData);
...@@ -606,8 +606,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq) ...@@ -606,8 +606,7 @@ _XF86BigfontQueryFont (dpy, extcodes, fid, seq)
} }
void void
_XF86BigfontFreeFontMetrics (fs) _XF86BigfontFreeFontMetrics (XFontStruct *fs)
XFontStruct *fs;
{ {
#ifdef HAS_SHM #ifdef HAS_SHM
XExtData *pData; XExtData *pData;
...@@ -633,7 +632,7 @@ int _XF86LoadQueryLocaleFont( ...@@ -633,7 +632,7 @@ int _XF86LoadQueryLocaleFont(
Font *fidp) Font *fidp)
{ {
int l; int l;
char *charset, *p; const char *charset, *p;
char buf[256]; char buf[256];
XFontStruct *fs; XFontStruct *fs;
XLCd lcd; XLCd lcd;
...@@ -643,7 +642,7 @@ int _XF86LoadQueryLocaleFont( ...@@ -643,7 +642,7 @@ int _XF86LoadQueryLocaleFont(
l = strlen(name); l = strlen(name);
if (l < 2 || name[l - 1] != '*' || name[l - 2] != '-') if (l < 2 || name[l - 1] != '*' || name[l - 2] != '-')
return 0; return 0;
charset = 0; charset = NULL;
/* next three lines stolen from _XkbGetCharset() */ /* next three lines stolen from _XkbGetCharset() */
lcd = _XlcCurrentLC(); lcd = _XlcCurrentLC();
if ((lcd = _XlcCurrentLC()) != 0) if ((lcd = _XlcCurrentLC()) != 0)
......
...@@ -44,7 +44,7 @@ _Xconst char *pattern, /* null-terminated */ ...@@ -44,7 +44,7 @@ _Xconst char *pattern, /* null-terminated */
int maxNames, int maxNames,
int *actualCount, /* RETURN */ int *actualCount, /* RETURN */
XFontStruct **info) /* RETURN */ XFontStruct **info) /* RETURN */
{ {
register long nbytes; register long nbytes;
register int i; register int i;
register XFontStruct *fs; register XFontStruct *fs;
...@@ -65,7 +65,7 @@ XFontStruct **info) /* RETURN */ ...@@ -65,7 +65,7 @@ XFontStruct **info) /* RETURN */
for (i = 0; ; i++) { for (i = 0; ; i++) {
if (!_XReply (dpy, (xReply *) &reply, if (!_XReply (dpy, (xReply *) &reply,
((SIZEOF(xListFontsWithInfoReply) - ((SIZEOF(xListFontsWithInfoReply) -
SIZEOF(xGenericReply)) >> 2), xFalse)) { SIZEOF(xGenericReply)) >> 2), xFalse)) {
for (j=(i-1); (j >= 0); j--) { for (j=(i-1); (j >= 0); j--) {
Xfree(flist[j]); Xfree(flist[j]);
...@@ -83,7 +83,7 @@ XFontStruct **info) /* RETURN */ ...@@ -83,7 +83,7 @@ XFontStruct **info) /* RETURN */
size = i + reply.nReplies + 1; size = i + reply.nReplies + 1;
if (finfo) { if (finfo) {
XFontStruct * tmp_finfo = (XFontStruct *) XFontStruct * tmp_finfo = (XFontStruct *)
Xrealloc ((char *) finfo, Xrealloc ((char *) finfo,
(unsigned) (sizeof(XFontStruct) * size)); (unsigned) (sizeof(XFontStruct) * size));
char ** tmp_flist = (char **) char ** tmp_flist = (char **)
...@@ -131,7 +131,7 @@ XFontStruct **info) /* RETURN */ ...@@ -131,7 +131,7 @@ XFontStruct **info) /* RETURN */
fs->all_chars_exist = reply.allCharsExist; fs->all_chars_exist = reply.allCharsExist;
fs->ascent = cvtINT16toInt (reply.fontAscent); fs->ascent = cvtINT16toInt (reply.fontAscent);
fs->descent = cvtINT16toInt (reply.fontDescent); fs->descent = cvtINT16toInt (reply.fontDescent);
/* XXX the next two statements won't work if short isn't 16 bits */ /* XXX the next two statements won't work if short isn't 16 bits */
fs->min_bounds = * (XCharStruct *) &reply.minBounds; fs->min_bounds = * (XCharStruct *) &reply.minBounds;
fs->max_bounds = * (XCharStruct *) &reply.maxBounds; fs->max_bounds = * (XCharStruct *) &reply.maxBounds;
...@@ -201,10 +201,10 @@ XFontStruct **info) /* RETURN */ ...@@ -201,10 +201,10 @@ XFontStruct **info) /* RETURN */
} }
int int
XFreeFontInfo (names, info, actualCount) XFreeFontInfo (
char **names; char **names,
XFontStruct *info; XFontStruct *info,
int actualCount; int actualCount)
{ {
register int i; register int i;
if (names) { if (names) {
......
...@@ -36,7 +36,7 @@ register Display *dpy, ...@@ -36,7 +36,7 @@ register Display *dpy,
_Xconst char *pattern, /* null-terminated */ _Xconst char *pattern, /* null-terminated */
int maxNames, int maxNames,
int *actualCount) /* RETURN */ int *actualCount) /* RETURN */
{ {
register long nbytes; register long nbytes;
register unsigned i; register unsigned i;
register int length; register int length;
...@@ -98,9 +98,8 @@ int *actualCount) /* RETURN */ ...@@ -98,9 +98,8 @@ int *actualCount) /* RETURN */
} }
int int
XFreeFontNames(list) XFreeFontNames(char **list)
char **list; {
{
if (list) { if (list) {
if (!*(list[0]-1)) { /* from ListFontsWithInfo */ if (!*(list[0]-1)) { /* from ListFontsWithInfo */
register char **names; register char **names;
......
...@@ -44,6 +44,9 @@ XFreeColormap( ...@@ -44,6 +44,9 @@ XFreeColormap(
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
#ifdef XCMS
_XcmsDeleteCmapRec(dpy, cmap); _XcmsDeleteCmapRec(dpy, cmap);
#endif
return 1; return 1;
} }
...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFreeColors(dpy, cmap, pixels, npixels, planes) XFreeColors(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
unsigned long *pixels; /* LISTofCARD32 */ unsigned long *pixels, /* LISTofCARD32 */
int npixels; int npixels,
unsigned long planes; /* CARD32 */ unsigned long planes) /* CARD32 */
{ {
register xFreeColorsReq *req; register xFreeColorsReq *req;
register long nbytes; register long nbytes;
......
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFreeCursor(dpy, cursor) XFreeCursor(
register Display *dpy; register Display *dpy,
Cursor cursor; Cursor cursor)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -30,12 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
_XFreeExtData (extension) _XFreeExtData (XExtData *extension)
XExtData *extension;
{ {
XExtData *temp; XExtData *temp;
while (extension) { while (extension) {
if (extension->free_private) if (extension->free_private)
(*extension->free_private)(extension); (*extension->free_private)(extension);
else Xfree ((char *)extension->private_data); else Xfree ((char *)extension->private_data);
temp = extension->next; temp = extension->next;
......
/*
* Copyright © 2009 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
void
XFreeEventData(Display *dpy, XGenericEventCookie *event)
{
if (_XIsEventCookie(dpy, (XEvent*)event) && event->data)
{
XFree(event->data);
event->data = NULL;
event->cookie = 0;
}
return;
}
...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,9 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFreeGC (dpy, gc) XFreeGC (
register Display *dpy; register Display *dpy,
GC gc; GC gc)
{ {
register xResourceReq *req; register xResourceReq *req;
register _XExtension *ext; register _XExtension *ext;
...@@ -47,4 +47,3 @@ XFreeGC (dpy, gc) ...@@ -47,4 +47,3 @@ XFreeGC (dpy, gc)
Xfree ((char *) gc); Xfree ((char *) gc);
return 1; return 1;
} }
...@@ -30,12 +30,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,12 +30,11 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XFreePixmap(dpy, pixmap) XFreePixmap(
register Display *dpy; register Display *dpy,
Pixmap pixmap; Pixmap pixmap)
{
{ register xResourceReq *req;
register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
GetResReq(FreePixmap, pixmap, req); GetResReq(FreePixmap, pixmap, req);
UnlockDisplay(dpy); UnlockDisplay(dpy);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment