Commit 687d44b6 authored by Ulrich Sibiller's avatar Ulrich Sibiller

update src files *[ch] to libX11 1.3.4

parent ea24f0b0
...@@ -24,19 +24,21 @@ in this Software without prior written authorization from The Open Group. ...@@ -24,19 +24,21 @@ in this Software without prior written authorization from The Open Group.
*/ */
#define NEED_REPLIES
#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;
......
...@@ -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;
......
...@@ -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);
} }
...@@ -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;
......
...@@ -29,14 +29,14 @@ from The Open Group. ...@@ -29,14 +29,14 @@ from The Open Group.
/* $XFree86$ */ /* $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;
......
...@@ -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);
......
...@@ -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
XSetArcMode (dpy, gc, arc_mode) XSetArcMode (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
int arc_mode; int arc_mode)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.arc_mode != arc_mode) { if (gc->values.arc_mode != arc_mode) {
...@@ -46,10 +46,10 @@ int arc_mode; ...@@ -46,10 +46,10 @@ int arc_mode;
} }
int int
XSetFillRule (dpy, gc, fill_rule) XSetFillRule (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
int fill_rule; int fill_rule)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.fill_rule != fill_rule) { if (gc->values.fill_rule != fill_rule) {
...@@ -62,10 +62,10 @@ int fill_rule; ...@@ -62,10 +62,10 @@ int fill_rule;
} }
int int
XSetFillStyle (dpy, gc, fill_style) XSetFillStyle (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
int fill_style; int fill_style)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.fill_style != fill_style) { if (gc->values.fill_style != fill_style) {
...@@ -78,10 +78,10 @@ int fill_style; ...@@ -78,10 +78,10 @@ int fill_style;
} }
int int
XSetGraphicsExposures (dpy, gc, graphics_exposures) XSetGraphicsExposures (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
Bool graphics_exposures; Bool graphics_exposures)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.graphics_exposures != graphics_exposures) { if (gc->values.graphics_exposures != graphics_exposures) {
...@@ -94,10 +94,10 @@ Bool graphics_exposures; ...@@ -94,10 +94,10 @@ Bool graphics_exposures;
} }
int int
XSetSubwindowMode (dpy, gc, subwindow_mode) XSetSubwindowMode (
register Display *dpy; register Display *dpy,
register GC gc; register GC gc,
int subwindow_mode; int subwindow_mode)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.subwindow_mode != subwindow_mode) { if (gc->values.subwindow_mode != subwindow_mode) {
......
...@@ -26,7 +26,6 @@ other dealings in this Software without prior written authorization ...@@ -26,7 +26,6 @@ other dealings in this Software without prior written authorization
from The Open Group. from The Open Group.
*/ */
/* $XFree86$ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
...@@ -66,11 +65,11 @@ XGeometry ( ...@@ -66,11 +65,11 @@ XGeometry (
dmask = XParseGeometry(def, &dx, &dy, &dwidth, &dheight); dmask = XParseGeometry(def, &dx, &dy, &dwidth, &dheight);
/* set default values */ /* set default values */
*x = (dmask & XNegative) ? *x = (dmask & XNegative) ?
DisplayWidth(dpy, screen) + dx - dwidth * fwidth - DisplayWidth(dpy, screen) + dx - dwidth * fwidth -
2 * bwidth - xadd : dx; 2 * bwidth - xadd : dx;
*y = (dmask & YNegative) ? *y = (dmask & YNegative) ?
DisplayHeight(dpy, screen) + dy - dheight * fheight - DisplayHeight(dpy, screen) + dy - dheight * fheight -
2 * bwidth - yadd : dy; 2 * bwidth - yadd : dy;
*width = dwidth; *width = dwidth;
*height = dheight; *height = dheight;
...@@ -80,11 +79,11 @@ XGeometry ( ...@@ -80,11 +79,11 @@ XGeometry (
if (pmask & XValue) if (pmask & XValue)
*x = (pmask & XNegative) ? *x = (pmask & XNegative) ?
DisplayWidth(dpy, screen) + px - *width * fwidth - DisplayWidth(dpy, screen) + px - *width * fwidth -
2 * bwidth - xadd : px; 2 * bwidth - xadd : px;
if (pmask & YValue) if (pmask & YValue)
*y = (pmask & YNegative) ? *y = (pmask & YNegative) ?
DisplayHeight(dpy, screen) + py - *height * fheight - DisplayHeight(dpy, screen) + py - *height * fheight -
2 * bwidth - yadd : py; 2 * bwidth - yadd : py;
return (pmask); return (pmask);
} }
...@@ -49,16 +49,16 @@ char *_XGetAtomName( ...@@ -49,16 +49,16 @@ char *_XGetAtomName(
if ((name = (char *)Xmalloc(idx))) if ((name = (char *)Xmalloc(idx)))
strcpy(name, EntryName(e)); strcpy(name, EntryName(e));
return name; return name;
} }
} }
} }
GetResReq(GetAtomName, atom, req); GetResReq(GetAtomName, atom, req);
return (char *)NULL; return (char *)NULL;
} }
char *XGetAtomName(dpy, atom) char *XGetAtomName(
register Display *dpy; register Display *dpy,
Atom atom; Atom atom)
{ {
xGetAtomNameReply rep; xGetAtomNameReply rep;
char *name; char *name;
...@@ -67,7 +67,7 @@ char *XGetAtomName(dpy, atom) ...@@ -67,7 +67,7 @@ char *XGetAtomName(dpy, atom)
if ((name = _XGetAtomName(dpy, atom))) { if ((name = _XGetAtomName(dpy, atom))) {
UnlockDisplay(dpy); UnlockDisplay(dpy);
return name; return name;
} }
if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) { if (_XReply(dpy, (xReply *)&rep, 0, xFalse) == 0) {
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
...@@ -139,11 +139,11 @@ Bool _XGetAtomNameHandler( ...@@ -139,11 +139,11 @@ Bool _XGetAtomNameHandler(
} }
Status Status
XGetAtomNames (dpy, atoms, count, names_return) XGetAtomNames (
Display *dpy; Display *dpy,
Atom *atoms; Atom *atoms,
int count; int count,
char **names_return; char **names_return)
{ {
_XAsyncHandler async; _XAsyncHandler async;
_XGetAtomNameState async_state; _XGetAtomNameState async_state;
......
...@@ -48,6 +48,7 @@ XColor *exact_def) /* RETURN */ ...@@ -48,6 +48,7 @@ XColor *exact_def) /* RETURN */
XcmsColor cmsColor_exact; XcmsColor cmsColor_exact;
Status ret; Status ret;
#ifdef XCMS
/* /*
* Let's Attempt to use Xcms and i18n approach to Parse Color * Let's Attempt to use Xcms and i18n approach to Parse Color
*/ */
...@@ -73,6 +74,7 @@ XColor *exact_def) /* RETURN */ ...@@ -73,6 +74,7 @@ XColor *exact_def) /* RETURN */
break; break;
} }
} }
#endif
/* /*
* Xcms and i18n approach failed. * Xcms and i18n approach failed.
......
...@@ -28,13 +28,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,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
...@@ -96,16 +96,16 @@ GetHomeDir( ...@@ -96,16 +96,16 @@ GetHomeDir(
int len) int len)
{ {
#ifdef WIN32 #ifdef WIN32
register char *ptr1; register char *ptr1 = NULL;
register char *ptr2; register char *ptr2 = NULL;
int len1 = 0, len2 = 0; int len1 = 0, len2 = 0;
if (ptr1 = getenv("HOME")) { /* old, deprecated */ if ((ptr1 = getenv("HOME"))) { /* old, deprecated */
len1 = strlen (ptr1); len1 = strlen (ptr1);
} else if ((ptr1 = getenv("HOMEDRIVE")) && (ptr2 = getenv("HOMEDIR"))) { } else if ((ptr1 = getenv("HOMEDRIVE")) && (ptr2 = getenv("HOMEDIR"))) {
len1 = strlen (ptr1); len1 = strlen (ptr1);
len2 = strlen (ptr2); len2 = strlen (ptr2);
} else if (ptr2 = getenv("USERNAME")) { } else if ((ptr2 = getenv("USERNAME"))) {
len1 = strlen (ptr1 = "/users/"); len1 = strlen (ptr1 = "/users/");
len2 = strlen (ptr2); len2 = strlen (ptr2);
} }
...@@ -162,7 +162,7 @@ InitDefaults( ...@@ -162,7 +162,7 @@ InitDefaults(
*/ */
if (dpy->xdefaults == NULL) { if (dpy->xdefaults == NULL) {
char *slashDotXdefaults = "/.Xdefaults"; const char *slashDotXdefaults = "/.Xdefaults";
(void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaults) - 1); (void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaults) - 1);
(void) strcat (fname, slashDotXdefaults); (void) strcat (fname, slashDotXdefaults);
...@@ -172,7 +172,7 @@ InitDefaults( ...@@ -172,7 +172,7 @@ InitDefaults(
} }
if (!(xenv = getenv ("XENVIRONMENT"))) { if (!(xenv = getenv ("XENVIRONMENT"))) {
char *slashDotXdefaultsDash = "/.Xdefaults-"; const char *slashDotXdefaultsDash = "/.Xdefaults-";
int len; int len;
(void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaultsDash) - 1); (void) GetHomeDir (fname, PATH_MAX - strlen (slashDotXdefaultsDash) - 1);
......
...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
char **XGetFontPath(dpy, npaths) char **XGetFontPath(
register Display *dpy; register Display *dpy,
int *npaths; /* RETURN */ int *npaths) /* RETURN */
{ {
xGetFontPathReply rep; xGetFontPathReply rep;
register long nbytes; register long nbytes;
...@@ -81,8 +81,7 @@ int *npaths; /* RETURN */ ...@@ -81,8 +81,7 @@ int *npaths; /* RETURN */
} }
int int
XFreeFontPath (list) XFreeFontPath (char **list)
char **list;
{ {
if (list != NULL) { if (list != NULL) {
Xfree (list[0]-1); Xfree (list[0]-1);
......
...@@ -29,11 +29,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,11 +29,11 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Bool XGetFontProperty (fs, name, valuePtr) Bool XGetFontProperty (
XFontStruct *fs; XFontStruct *fs,
register Atom name; register Atom name,
unsigned long *valuePtr; unsigned long *valuePtr)
{ {
/* XXX this is a simple linear search for now. If the /* XXX this is a simple linear search for now. If the
protocol is changed to sort the property list, this should protocol is changed to sort the property list, this should
become a binary search. */ become a binary search. */
...@@ -49,7 +49,4 @@ Bool XGetFontProperty (fs, name, valuePtr) ...@@ -49,7 +49,4 @@ Bool XGetFontProperty (fs, name, valuePtr)
return (0); return (0);
} }
...@@ -43,11 +43,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -43,11 +43,11 @@ in this Software without prior written authorization from The Open Group.
GCArcMode) GCArcMode)
/*ARGSUSED*/ /*ARGSUSED*/
Status XGetGCValues (dpy, gc, valuemask, values) Status XGetGCValues (
Display *dpy; Display *dpy,
GC gc; GC gc,
unsigned long valuemask; unsigned long valuemask,
XGCValues *values; XGCValues *values)
{ {
if (valuemask == ValidGCValuesBits) { if (valuemask == ValidGCValuesBits) {
char dashes = values->dashes; char dashes = values->dashes;
......
...@@ -29,12 +29,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XGetGeometry (dpy, d, root, x, y, width, height, borderWidth, depth) Status XGetGeometry (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
Window *root; /* RETURN */ Window *root, /* RETURN */
int *x, *y; /* RETURN */ int *x,
unsigned int *width, *height, *borderWidth, *depth; /* RETURN */ int *y, /* RETURN */
unsigned int *width,
unsigned int *height,
unsigned int *borderWidth,
unsigned int *depth) /* RETURN */
{ {
xGetGeometryReply rep; xGetGeometryReply rep;
register xResourceReq *req; register xResourceReq *req;
......
...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XAllocColor(dpy, cmap, def) Status XAllocColor(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *def; XColor *def)
{ {
Status status; Status status;
xAllocColorReply rep; xAllocColorReply rep;
......
...@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,13 @@ Copyright 1987 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
...@@ -56,11 +56,11 @@ SOFTWARE. ...@@ -56,11 +56,11 @@ SOFTWARE.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <stdio.h> #include <stdio.h>
Status XGetSizeHints (dpy, w, hints, property) Status XGetSizeHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
Atom property; Atom property)
{ {
xPropSizeHints *prop = NULL; xPropSizeHints *prop = NULL;
Atom actual_type; Atom actual_type;
...@@ -97,15 +97,15 @@ Status XGetSizeHints (dpy, w, hints, property) ...@@ -97,15 +97,15 @@ Status XGetSizeHints (dpy, w, hints, property)
return(1); return(1);
} }
/* /*
* must return a pointer to the hint, in malloc'd memory, or routine is not * must return a pointer to the hint, in malloc'd memory, or routine is not
* extensible; any use of the caller's memory would cause things to be stepped * extensible; any use of the caller's memory would cause things to be stepped
* on. * on.
*/ */
XWMHints *XGetWMHints (dpy, w) XWMHints *XGetWMHints (
Display *dpy; Display *dpy,
Window w; Window w)
{ {
xPropWMHints *prop = NULL; xPropWMHints *prop = NULL;
register XWMHints *hints; register XWMHints *hints;
...@@ -113,7 +113,7 @@ XWMHints *XGetWMHints (dpy, w) ...@@ -113,7 +113,7 @@ XWMHints *XGetWMHints (dpy, w)
int actual_format; int actual_format;
unsigned long leftover; unsigned long leftover;
unsigned long nitems; unsigned long nitems;
if (XGetWindowProperty(dpy, w, XA_WM_HINTS, if (XGetWindowProperty(dpy, w, XA_WM_HINTS,
0L, (long)NumPropWMHintsElements, 0L, (long)NumPropWMHintsElements,
False, XA_WM_HINTS, &actual_type, &actual_format, False, XA_WM_HINTS, &actual_type, &actual_format,
&nitems, &leftover, (unsigned char **)&prop) &nitems, &leftover, (unsigned char **)&prop)
...@@ -147,34 +147,34 @@ XWMHints *XGetWMHints (dpy, w) ...@@ -147,34 +147,34 @@ XWMHints *XGetWMHints (dpy, w)
} }
Status Status
XGetZoomHints (dpy, w, zhints) XGetZoomHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *zhints; XSizeHints *zhints)
{ {
return (XGetSizeHints(dpy, w, zhints, XA_WM_ZOOM_HINTS)); return (XGetSizeHints(dpy, w, zhints, XA_WM_ZOOM_HINTS));
} }
Status Status
XGetNormalHints (dpy, w, hints) XGetNormalHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints)
{ {
return (XGetSizeHints(dpy, w, hints, XA_WM_NORMAL_HINTS)); return (XGetSizeHints(dpy, w, hints, XA_WM_NORMAL_HINTS));
} }
/* /*
* XGetIconSizes reads the property * XGetIconSizes reads the property
* ICONSIZE_ATOM type: ICONSIZE_ATOM format: 32 * ICONSIZE_ATOM type: ICONSIZE_ATOM format: 32
*/ */
Status XGetIconSizes (dpy, w, size_list, count) Status XGetIconSizes (
Display *dpy; Display *dpy,
Window w; /* typically, root */ Window w, /* typically, root */
XIconSize **size_list; /* RETURN */ XIconSize **size_list, /* RETURN */
int *count; /* RETURN number of items on the list */ int *count) /* RETURN number of items on the list */
{ {
xPropIconSize *prop = NULL; xPropIconSize *prop = NULL;
register xPropIconSize *pp; register xPropIconSize *pp;
...@@ -203,7 +203,7 @@ Status XGetIconSizes (dpy, w, size_list, count) ...@@ -203,7 +203,7 @@ Status XGetIconSizes (dpy, w, size_list, count)
/* static copies not allowed in library, due to reentrancy constraint*/ /* static copies not allowed in library, due to reentrancy constraint*/
nitems /= NumPropIconSizeElements; nitems /= NumPropIconSizeElements;
if (! (hp = hints = (XIconSize *) if (! (hp = hints = (XIconSize *)
Xcalloc ((unsigned) nitems, (unsigned) sizeof(XIconSize)))) { Xcalloc ((unsigned) nitems, (unsigned) sizeof(XIconSize)))) {
if (prop) Xfree ((char *) prop); if (prop) Xfree ((char *) prop);
return 0; return 0;
...@@ -227,11 +227,11 @@ Status XGetIconSizes (dpy, w, size_list, count) ...@@ -227,11 +227,11 @@ Status XGetIconSizes (dpy, w, size_list, count)
} }
Status XGetCommand (dpy, w, argvp, argcp) Status XGetCommand (
Display *dpy; Display *dpy,
Window w; Window w,
char ***argvp; char ***argvp,
int *argcp; int *argcp)
{ {
XTextProperty tp; XTextProperty tp;
int argc; int argc;
...@@ -267,10 +267,10 @@ Status XGetCommand (dpy, w, argvp, argcp) ...@@ -267,10 +267,10 @@ Status XGetCommand (dpy, w, argvp, argcp)
Status Status
XGetTransientForHint(dpy, w, propWindow) XGetTransientForHint(
Display *dpy; Display *dpy,
Window w; Window w,
Window *propWindow; Window *propWindow)
{ {
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
...@@ -278,7 +278,7 @@ XGetTransientForHint(dpy, w, propWindow) ...@@ -278,7 +278,7 @@ XGetTransientForHint(dpy, w, propWindow)
unsigned long leftover; unsigned long leftover;
Window *data = NULL; Window *data = NULL;
if (XGetWindowProperty(dpy, w, XA_WM_TRANSIENT_FOR, 0L, 1L, False, if (XGetWindowProperty(dpy, w, XA_WM_TRANSIENT_FOR, 0L, 1L, False,
XA_WINDOW, XA_WINDOW,
&actual_type, &actual_type,
&actual_format, &nitems, &leftover, (unsigned char **) &data) &actual_format, &nitems, &leftover, (unsigned char **) &data)
!= Success) { != Success) {
...@@ -297,10 +297,10 @@ XGetTransientForHint(dpy, w, propWindow) ...@@ -297,10 +297,10 @@ XGetTransientForHint(dpy, w, propWindow)
} }
Status Status
XGetClassHint(dpy, w, classhint) XGetClassHint(
Display *dpy; Display *dpy,
Window w; Window w,
XClassHint *classhint; /* RETURN */ XClassHint *classhint) /* RETURN */
{ {
int len_name, len_class; int len_name, len_class;
...@@ -310,11 +310,11 @@ XGetClassHint(dpy, w, classhint) ...@@ -310,11 +310,11 @@ XGetClassHint(dpy, w, classhint)
unsigned long leftover; unsigned long leftover;
unsigned char *data = NULL; unsigned char *data = NULL;
if (XGetWindowProperty(dpy, w, XA_WM_CLASS, 0L, (long)BUFSIZ, False, if (XGetWindowProperty(dpy, w, XA_WM_CLASS, 0L, (long)BUFSIZ, False,
XA_STRING, XA_STRING,
&actual_type, &actual_type,
&actual_format, &nitems, &leftover, &data) != Success) &actual_format, &nitems, &leftover, &data) != Success)
return (0); return (0);
if ( (actual_type == XA_STRING) && (actual_format == 8) ) { if ( (actual_type == XA_STRING) && (actual_format == 8) ) {
len_name = strlen((char *) data); len_name = strlen((char *) data);
if (! (classhint->res_name = Xmalloc((unsigned) (len_name+1)))) { if (! (classhint->res_name = Xmalloc((unsigned) (len_name+1)))) {
......
...@@ -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
XGetInputFocus(dpy, focus, revert_to) XGetInputFocus(
register Display *dpy; register Display *dpy,
Window *focus; Window *focus,
int *revert_to; int *revert_to)
{ {
xGetInputFocusReply rep; xGetInputFocusReply rep;
register xReq *req; register xReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -43,13 +43,15 @@ static unsigned int Ones( /* HACKMEM 169 */ ...@@ -43,13 +43,15 @@ static unsigned int Ones( /* HACKMEM 169 */
return ((unsigned int) (((y + (y >> 3)) & 030707070707) % 077)); return ((unsigned int) (((y + (y >> 3)) & 030707070707) % 077));
} }
XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format) XImage *XGetImage (
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
int x, y; int x,
unsigned int width, height; int y,
unsigned long plane_mask; unsigned int width,
int format; /* either XYPixmap or ZPixmap */ unsigned int height,
unsigned long plane_mask,
int format) /* either XYPixmap or ZPixmap */
{ {
xGetImageReply rep; xGetImageReply rep;
register xGetImageReq *req; register xGetImageReq *req;
...@@ -68,14 +70,14 @@ XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format) ...@@ -68,14 +70,14 @@ XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format)
req->height = height; req->height = height;
req->planeMask = plane_mask; req->planeMask = plane_mask;
req->format = format; req->format = format;
if (_XReply (dpy, (xReply *) &rep, 0, xFalse) == 0 || if (_XReply (dpy, (xReply *) &rep, 0, xFalse) == 0 ||
rep.length == 0) { rep.length == 0) {
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return (XImage *)NULL; return (XImage *)NULL;
} }
nbytes = (long)rep.length << 2; nbytes = (long)rep.length << 2;
data = (char *) Xmalloc((unsigned) nbytes); data = (char *) Xmalloc((unsigned) nbytes);
if (! data) { if (! data) {
...@@ -102,23 +104,25 @@ XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format) ...@@ -102,23 +104,25 @@ XImage *XGetImage (dpy, d, x, y, width, height, plane_mask, format)
return (image); return (image);
} }
XImage *XGetSubImage(dpy, d, x, y, width, height, plane_mask, format, XImage *XGetSubImage(
dest_image, dest_x, dest_y) register Display *dpy,
register Display *dpy; Drawable d,
Drawable d; int x,
int x, y; int y,
unsigned int width, height; unsigned int width,
unsigned long plane_mask; unsigned int height,
int format; /* either XYPixmap or ZPixmap */ unsigned long plane_mask,
XImage *dest_image; int format, /* either XYPixmap or ZPixmap */
int dest_x, dest_y; XImage *dest_image,
int dest_x,
int dest_y)
{ {
XImage *temp_image; XImage *temp_image;
temp_image = XGetImage(dpy, d, x, y, width, height, temp_image = XGetImage(dpy, d, x, y, width, height,
plane_mask, format); plane_mask, format);
if (!temp_image) if (!temp_image)
return (XImage *)NULL; return (XImage *)NULL;
_XSetImage(temp_image, dest_image, dest_x, dest_y); _XSetImage(temp_image, dest_image, dest_x, dest_y);
XDestroyImage(temp_image); XDestroyImage(temp_image);
return (dest_image); return (dest_image);
} }
...@@ -30,15 +30,15 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,15 +30,15 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGetKeyboardControl (dpy, state) XGetKeyboardControl (
register Display *dpy; register Display *dpy,
register XKeyboardState *state; register XKeyboardState *state)
{ {
xGetKeyboardControlReply rep; xGetKeyboardControlReply rep;
register xReq *req; register xReq *req;
LockDisplay(dpy); LockDisplay(dpy);
GetEmptyReq (GetKeyboardControl, req); GetEmptyReq (GetKeyboardControl, req);
(void) _XReply (dpy, (xReply *) &rep, (void) _XReply (dpy, (xReply *) &rep,
(SIZEOF(xGetKeyboardControlReply) - SIZEOF(xReply)) >> 2, xTrue); (SIZEOF(xGetKeyboardControlReply) - SIZEOF(xReply)) >> 2, xTrue);
state->key_click_percent = rep.keyClickPercent; state->key_click_percent = rep.keyClickPercent;
......
...@@ -29,12 +29,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,13 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
XTimeCoord *XGetMotionEvents(dpy, w, start, stop, nEvents) XTimeCoord *XGetMotionEvents(
register Display *dpy; register Display *dpy,
Time start, stop; Window w,
Window w; Time start,
int *nEvents; /* RETURN */ Time stop,
{ int *nEvents) /* RETURN */
{
xGetMotionEventsReply rep; xGetMotionEventsReply rep;
register xGetMotionEventsReq *req; register xGetMotionEventsReq *req;
XTimeCoord *tc = NULL; XTimeCoord *tc = NULL;
...@@ -50,10 +51,10 @@ XTimeCoord *XGetMotionEvents(dpy, w, start, stop, nEvents) ...@@ -50,10 +51,10 @@ XTimeCoord *XGetMotionEvents(dpy, w, start, stop, nEvents)
SyncHandle(); SyncHandle();
return (NULL); return (NULL);
} }
if (rep.nEvents) { if (rep.nEvents) {
if (! (tc = (XTimeCoord *) if (! (tc = (XTimeCoord *)
Xmalloc( (unsigned) Xmalloc( (unsigned)
(nbytes = (long) rep.nEvents * sizeof(XTimeCoord))))) { (nbytes = (long) rep.nEvents * sizeof(XTimeCoord))))) {
_XEatData (dpy, (unsigned long) nbytes); _XEatData (dpy, (unsigned long) nbytes);
UnlockDisplay(dpy); UnlockDisplay(dpy);
......
...@@ -4,20 +4,20 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, ...@@ -4,20 +4,20 @@ Copyright 1987 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 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 AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
******************************************************************/ ******************************************************************/
...@@ -60,12 +60,12 @@ from The Open Group. ...@@ -60,12 +60,12 @@ from The Open Group.
#include <nx-X11/Xutil.h> #include <nx-X11/Xutil.h>
#include <stdio.h> #include <stdio.h>
Status XGetWMSizeHints (dpy, w, hints, supplied, property) Status XGetWMSizeHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
long *supplied; long *supplied,
Atom property; Atom property)
{ {
xPropSizeHints *prop = NULL; xPropSizeHints *prop = NULL;
Atom actual_type; Atom actual_type;
...@@ -73,10 +73,10 @@ Status XGetWMSizeHints (dpy, w, hints, supplied, property) ...@@ -73,10 +73,10 @@ Status XGetWMSizeHints (dpy, w, hints, supplied, property)
unsigned long leftover; unsigned long leftover;
unsigned long nitems; unsigned long nitems;
if (XGetWindowProperty (dpy, w, property, 0L, if (XGetWindowProperty (dpy, w, property, 0L,
(long)NumPropSizeElements, (long)NumPropSizeElements,
False, XA_WM_SIZE_HINTS, &actual_type, False, XA_WM_SIZE_HINTS, &actual_type,
&actual_format, &nitems, &leftover, &actual_format, &nitems, &leftover,
(unsigned char **)&prop) (unsigned char **)&prop)
!= Success) != Success)
return False; return False;
...@@ -117,11 +117,11 @@ Status XGetWMSizeHints (dpy, w, hints, supplied, property) ...@@ -117,11 +117,11 @@ Status XGetWMSizeHints (dpy, w, hints, supplied, property)
} }
Status XGetWMNormalHints (dpy, w, hints, supplied) Status XGetWMNormalHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
long *supplied; long *supplied)
{ {
return (XGetWMSizeHints (dpy, w, hints, supplied, XA_WM_NORMAL_HINTS)); return (XGetWMSizeHints (dpy, w, hints, supplied, XA_WM_NORMAL_HINTS));
} }
...@@ -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
XGetPointerControl(dpy, accel_numer, accel_denom, threshold) XGetPointerControl(
register Display *dpy; register Display *dpy,
/* the following are return only vars */ /* the following are return only vars */
int *accel_numer, *accel_denom; int *accel_numer,
int *threshold; int *accel_denom,
{ int *threshold)
{
xGetPointerControlReply rep; xGetPointerControlReply rep;
xReq *req; xReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -35,10 +35,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -35,10 +35,10 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b))
int XGetPointerMapping (dpy, map, nmaps) int XGetPointerMapping (
register Display *dpy; register Display *dpy,
unsigned char *map; /* RETURN */ unsigned char *map, /* RETURN */
int nmaps; int nmaps)
{ {
unsigned char mapping[256]; /* known fixed size */ unsigned char mapping[256]; /* known fixed size */
...@@ -64,11 +64,11 @@ int XGetPointerMapping (dpy, map, nmaps) ...@@ -64,11 +64,11 @@ int XGetPointerMapping (dpy, map, nmaps)
_XRead (dpy, (char *)mapping, nbytes); _XRead (dpy, (char *)mapping, nbytes);
/* don't return more data than the user asked for. */ /* don't return more data than the user asked for. */
if (rep.nElts) { if (rep.nElts) {
memcpy ((char *) map, (char *) mapping, memcpy ((char *) map, (char *) mapping,
MIN((int)rep.nElts, nmaps) ); MIN((int)rep.nElts, nmaps) );
} }
if (remainder) if (remainder)
_XEatData(dpy, (unsigned long)remainder); _XEatData(dpy, (unsigned long)remainder);
UnlockDisplay(dpy); UnlockDisplay(dpy);
......
...@@ -30,19 +30,19 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,19 +30,19 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGetWindowProperty(dpy, w, property, offset, length, delete, XGetWindowProperty(
req_type, actual_type, actual_format, nitems, bytesafter, prop) register Display *dpy,
register Display *dpy; Window w,
Window w; Atom property,
Atom property; long offset,
Bool delete; long length,
Atom req_type; Bool delete,
Atom *actual_type; /* RETURN */ Atom req_type,
int *actual_format; /* RETURN 8, 16, or 32 */ Atom *actual_type, /* RETURN */
long offset, length; int *actual_format, /* RETURN 8, 16, or 32 */
unsigned long *nitems; /* RETURN # of 8-, 16-, or 32-bit entities */ unsigned long *nitems, /* RETURN # of 8-, 16-, or 32-bit entities */
unsigned long *bytesafter; /* RETURN */ unsigned long *bytesafter, /* RETURN */
unsigned char **prop; /* RETURN */ unsigned char **prop) /* RETURN */
{ {
xGetPropertyReply reply; xGetPropertyReply reply;
register xGetPropertyReq *req; register xGetPropertyReq *req;
...@@ -57,22 +57,22 @@ XGetWindowProperty(dpy, w, property, offset, length, delete, ...@@ -57,22 +57,22 @@ XGetWindowProperty(dpy, w, property, offset, length, delete,
req->longOffset = offset; req->longOffset = offset;
req->longLength = length; req->longLength = length;
error.sequenceNumber = dpy->request; error.sequenceNumber = dpy->request;
if (!_XReply (dpy, (xReply *) &reply, 0, xFalse)) { if (!_XReply (dpy, (xReply *) &reply, 0, xFalse)) {
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return (1); /* not Success */ return (1); /* not Success */
} }
*prop = (unsigned char *) NULL; *prop = (unsigned char *) NULL;
if (reply.propertyType != None) { if (reply.propertyType != None) {
long nbytes, netbytes; long nbytes, netbytes;
switch (reply.format) { switch (reply.format) {
/* /*
* One extra byte is malloced than is needed to contain the property * One extra byte is malloced than is needed to contain the property
* data, but this last byte is null terminated and convenient for * data, but this last byte is null terminated and convenient for
* returning string properties, so the client doesn't then have to * returning string properties, so the client doesn't then have to
* recopy the string to make it null terminated. * recopy the string to make it null terminated.
*/ */
case 8: case 8:
nbytes = netbytes = reply.nItems; nbytes = netbytes = reply.nItems;
...@@ -101,7 +101,7 @@ XGetWindowProperty(dpy, w, property, offset, length, delete, ...@@ -101,7 +101,7 @@ XGetWindowProperty(dpy, w, property, offset, length, delete,
/* /*
* This part of the code should never be reached. If it is, * This part of the code should never be reached. If it is,
* the server sent back a property with an invalid format. * the server sent back a property with an invalid format.
* This is a BadImplementation error. * This is a BadImplementation error.
*/ */
{ {
/* sequence number stored above */ /* sequence number stored above */
......
...@@ -35,12 +35,12 @@ from The Open Group. ...@@ -35,12 +35,12 @@ from The Open Group.
#include "Xatomtype.h" #include "Xatomtype.h"
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
Status XGetRGBColormaps (dpy, w, stdcmap, count, property) Status XGetRGBColormaps (
Display *dpy; Display *dpy,
Window w; Window w,
XStandardColormap **stdcmap; /* RETURN */ XStandardColormap **stdcmap, /* RETURN */
int *count; /* RETURN */ int *count, /* RETURN */
Atom property; /* XA_RGB_BEST_MAP, etc. */ Atom property) /* XA_RGB_BEST_MAP, etc. */
{ {
register int i; /* iterator variable */ register int i; /* iterator variable */
xPropStandardColormap *data = NULL; /* data read in from prop */ xPropStandardColormap *data = NULL; /* data read in from prop */
...@@ -68,7 +68,7 @@ Status XGetRGBColormaps (dpy, w, stdcmap, count, property) ...@@ -68,7 +68,7 @@ Status XGetRGBColormaps (dpy, w, stdcmap, count, property)
} }
/* /*
* See how many properties were found; if pre-ICCCM then assume * See how many properties were found; if pre-ICCCM then assume
* default visual and a kill id of 1. * default visual and a kill id of 1.
*/ */
if (nitems < NumPropStandardColormapElements) { if (nitems < NumPropStandardColormapElements) {
...@@ -85,7 +85,7 @@ Status XGetRGBColormaps (dpy, w, stdcmap, count, property) ...@@ -85,7 +85,7 @@ Status XGetRGBColormaps (dpy, w, stdcmap, count, property)
} }
} else { } else {
/* /*
* make sure we have an integral number of colormaps * make sure we have an integral number of colormaps
*/ */
ncmaps = (nitems / NumPropStandardColormapElements); ncmaps = (nitems / NumPropStandardColormapElements);
if ((((unsigned long) ncmaps) * NumPropStandardColormapElements) != if ((((unsigned long) ncmaps) * NumPropStandardColormapElements) !=
...@@ -95,7 +95,7 @@ Status XGetRGBColormaps (dpy, w, stdcmap, count, property) ...@@ -95,7 +95,7 @@ Status XGetRGBColormaps (dpy, w, stdcmap, count, property)
} }
} }
/* /*
* allocate array * allocate array
*/ */
......
...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Window XGetSelectionOwner(dpy, selection) Window XGetSelectionOwner(
register Display *dpy; register Display *dpy,
Atom selection; Atom selection)
{ {
xGetSelectionOwnerReply rep; xGetSelectionOwnerReply rep;
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,13 +30,15 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,13 +30,15 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGetScreenSaver(dpy, timeout, interval, prefer_blanking, allow_exp) XGetScreenSaver(
register Display *dpy; register Display *dpy,
/* the following are return only vars */ /* the following are return only vars */
int *timeout, *interval; int *timeout,
int *prefer_blanking, *allow_exp; /*boolean */ int *interval,
int *prefer_blanking,
{ int *allow_exp) /*boolean */
{
xGetScreenSaverReply rep; xGetScreenSaverReply rep;
register xReq *req; register xReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,13 @@ Copyright 1987 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
...@@ -56,16 +56,16 @@ SOFTWARE. ...@@ -56,16 +56,16 @@ SOFTWARE.
/* /*
* WARNING * WARNING
* *
* This is a pre-ICCCM routine. It must not reference any of the new fields * This is a pre-ICCCM routine. It must not reference any of the new fields
* in the XStandardColormap structure. * in the XStandardColormap structure.
*/ */
Status XGetStandardColormap (dpy, w, cmap, property) Status XGetStandardColormap (
Display *dpy; Display *dpy,
Window w; Window w,
XStandardColormap *cmap; XStandardColormap *cmap,
Atom property; /* XA_RGB_BEST_MAP, etc. */ Atom property) /* XA_RGB_BEST_MAP, etc. */
{ {
Status stat; /* return value */ Status stat; /* return value */
XStandardColormap *stdcmaps; /* will get malloced value */ XStandardColormap *stdcmaps; /* will get malloced value */
...@@ -98,7 +98,7 @@ Status XGetStandardColormap (dpy, w, cmap, property) ...@@ -98,7 +98,7 @@ Status XGetStandardColormap (dpy, w, cmap, property)
} else { } else {
use = stdcmaps; use = stdcmaps;
} }
/* /*
* assign only those fields which were in the pre-ICCCM version * assign only those fields which were in the pre-ICCCM version
*/ */
......
...@@ -3,13 +3,13 @@ Copyright 1988 by Wyse Technology, Inc., San Jose, Ca., ...@@ -3,13 +3,13 @@ Copyright 1988 by Wyse Technology, Inc., San Jose, Ca.,
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 Wyse not be supporting documentation, and that the name Wyse 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.
WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WYSE 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
...@@ -57,11 +57,11 @@ from The Open Group. ...@@ -57,11 +57,11 @@ from The Open Group.
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
#include <stdio.h> #include <stdio.h>
Status XGetTextProperty (display, window, tp, property) Status XGetTextProperty (
Display *display; Display *display,
Window window; Window window,
XTextProperty *tp; XTextProperty *tp,
Atom property; Atom property)
{ {
Atom actual_type; Atom actual_type;
int actual_format = 0; int actual_format = 0;
...@@ -87,26 +87,26 @@ Status XGetTextProperty (display, window, tp, property) ...@@ -87,26 +87,26 @@ Status XGetTextProperty (display, window, tp, property)
return False; return False;
} }
Status XGetWMName (dpy, w, tp) Status XGetWMName (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
return (XGetTextProperty (dpy, w, tp, XA_WM_NAME)); return (XGetTextProperty (dpy, w, tp, XA_WM_NAME));
} }
Status XGetWMIconName (dpy, w, tp) Status XGetWMIconName (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
return (XGetTextProperty (dpy, w, tp, XA_WM_ICON_NAME)); return (XGetTextProperty (dpy, w, tp, XA_WM_ICON_NAME));
} }
Status XGetWMClientMachine (dpy, w, tp) Status XGetWMClientMachine (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
return (XGetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE)); return (XGetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE));
} }
......
...@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,13 @@ Copyright 1987 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
...@@ -53,11 +53,11 @@ SOFTWARE. ...@@ -53,11 +53,11 @@ SOFTWARE.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <stdio.h> #include <stdio.h>
Status XGetWMColormapWindows (dpy, w, colormapWindows, countReturn) Status XGetWMColormapWindows (
Display *dpy; Display *dpy,
Window w; Window w,
Window **colormapWindows; Window **colormapWindows,
int *countReturn; int *countReturn)
{ {
Atom *data = NULL; Atom *data = NULL;
Atom actual_type; Atom actual_type;
......
...@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,13 @@ Copyright 1987 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
...@@ -53,11 +53,11 @@ SOFTWARE. ...@@ -53,11 +53,11 @@ SOFTWARE.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <stdio.h> #include <stdio.h>
Status XGetWMProtocols (dpy, w, protocols, countReturn) Status XGetWMProtocols (
Display *dpy; Display *dpy,
Window w; Window w,
Atom **protocols; Atom **protocols,
int *countReturn; int *countReturn)
{ {
Atom *data = NULL; Atom *data = NULL;
Atom actual_type; Atom actual_type;
......
...@@ -30,17 +30,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,17 +30,17 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XGrabButton(dpy, button, modifiers, grab_window, owner_events, event_mask, XGrabButton(
pointer_mode, keyboard_mode, confine_to, curs) register Display *dpy,
register Display *dpy; unsigned int button, /* CARD8 */
unsigned int modifiers; /* CARD16 */ unsigned int modifiers, /* CARD16 */
unsigned int button; /* CARD8 */ Window grab_window,
Window grab_window; Bool owner_events,
Bool owner_events; unsigned int event_mask, /* CARD16 */
unsigned int event_mask; /* CARD16 */ int pointer_mode,
int pointer_mode, keyboard_mode; int keyboard_mode,
Window confine_to; Window confine_to,
Cursor curs; Cursor curs)
{ {
register xGrabButtonReq *req; register xGrabButtonReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -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
XGrabKey(dpy, key, modifiers, grab_window, owner_events, XGrabKey(
pointer_mode, keyboard_mode) register Display *dpy,
register Display *dpy; int key,
int key; unsigned int modifiers,
unsigned int modifiers; Window grab_window,
Window grab_window; Bool owner_events,
Bool owner_events; int pointer_mode,
int pointer_mode, keyboard_mode; int keyboard_mode)
{ {
register xGrabKeyReq *req; register xGrabKeyReq *req;
......
...@@ -28,12 +28,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -28,12 +28,13 @@ in this Software without prior written authorization from The Open Group.
#include <config.h> #include <config.h>
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
int XGrabKeyboard (dpy, window, ownerEvents, pointerMode, keyboardMode, time) int XGrabKeyboard (
register Display *dpy; register Display *dpy,
Window window; Window window,
Bool ownerEvents; Bool ownerEvents,
int pointerMode, keyboardMode; int pointerMode,
Time time; int keyboardMode,
Time time)
{ {
xGrabKeyboardReply rep; xGrabKeyboardReply rep;
register xGrabKeyboardReq *req; register xGrabKeyboardReq *req;
...@@ -47,7 +48,7 @@ int XGrabKeyboard (dpy, window, ownerEvents, pointerMode, keyboardMode, time) ...@@ -47,7 +48,7 @@ int XGrabKeyboard (dpy, window, ownerEvents, pointerMode, keyboardMode, time)
req->time = time; req->time = time;
/* if we ever return, suppress the error */ /* if we ever return, suppress the error */
if (_XReply (dpy, (xReply *) &rep, 0, xTrue) == 0) if (_XReply (dpy, (xReply *) &rep, 0, xTrue) == 0)
rep.status = GrabSuccess; rep.status = GrabSuccess;
status = rep.status; status = rep.status;
UnlockDisplay(dpy); UnlockDisplay(dpy);
......
...@@ -29,16 +29,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,16 +29,16 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
int XGrabPointer(dpy, grab_window, owner_events, event_mask, pointer_mode, int XGrabPointer(
keyboard_mode, confine_to, curs, time) register Display *dpy,
register Display *dpy; Window grab_window,
Window grab_window; Bool owner_events,
Bool owner_events; unsigned int event_mask, /* CARD16 */
unsigned int event_mask; /* CARD16 */ int pointer_mode,
int pointer_mode, keyboard_mode; int keyboard_mode,
Window confine_to; Window confine_to,
Cursor curs; Cursor curs,
Time time; Time time)
{ {
xGrabPointerReply rep; xGrabPointerReply rep;
register xGrabPointerReq *req; register xGrabPointerReq *req;
...@@ -53,7 +53,7 @@ Time time; ...@@ -53,7 +53,7 @@ Time time;
req->confineTo = confine_to; req->confineTo = confine_to;
req->cursor = curs; req->cursor = curs;
req->time = time; req->time = time;
/* if we ever return, suppress the error */ /* if we ever return, suppress the error */
if (_XReply (dpy, (xReply *) &rep, 0, xTrue) == 0) if (_XReply (dpy, (xReply *) &rep, 0, xTrue) == 0)
rep.status = GrabSuccess; rep.status = GrabSuccess;
......
...@@ -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
XGrabServer (dpy) XGrabServer (register Display *dpy)
register Display *dpy;
{ {
register xReq *req; register xReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
/* /*
Copyright 1986, 1998 The Open Group Copyright 1986, 1998 The Open Group
Copyright 2004 Sun Microsystems, Inc.
All rights reserved. All rights reserved.
...@@ -34,6 +33,30 @@ X Window System is a trademark of The Open Group. ...@@ -34,6 +33,30 @@ X Window System is a trademark of The Open Group.
*/ */
/*
* Copyright 2004 Sun Microsystems, Inc. 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.
*/
/* this might be rightly regarded an os dependent file */ /* this might be rightly regarded an os dependent file */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
...@@ -48,14 +71,14 @@ changehost (Display *dpy, XHostAddress *host, BYTE mode) ...@@ -48,14 +71,14 @@ changehost (Display *dpy, XHostAddress *host, BYTE mode)
int length; int length;
XServerInterpretedAddress *siAddr; XServerInterpretedAddress *siAddr;
int addrlen; int addrlen;
siAddr = host->family == FamilyServerInterpreted ? siAddr = host->family == FamilyServerInterpreted ?
(XServerInterpretedAddress *)host->address : NULL; (XServerInterpretedAddress *)host->address : NULL;
addrlen = siAddr ? addrlen = siAddr ?
siAddr->typelength + siAddr->valuelength + 1 : host->length; siAddr->typelength + siAddr->valuelength + 1 : host->length;
length = (addrlen + 3) & ~0x3; /* round up */ length = (addrlen + 3) & ~0x3; /* round up */
LockDisplay(dpy); LockDisplay(dpy);
GetReqExtra (ChangeHosts, length, req); GetReqExtra (ChangeHosts, length, req);
if (!req) { if (!req) {
......
...@@ -4,13 +4,13 @@ Copyright 1988 by Wyse Technology, Inc., San Jose, Ca. ...@@ -4,13 +4,13 @@ Copyright 1988 by Wyse Technology, Inc., San Jose, Ca.
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 Wyse not be supporting documentation, and that the name Wyse 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.
WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WYSE 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
...@@ -62,10 +62,10 @@ from The Open Group. ...@@ -62,10 +62,10 @@ from The Open Group.
* This function instructs the window manager to change this window from * This function instructs the window manager to change this window from
* NormalState to IconicState. * NormalState to IconicState.
*/ */
Status XIconifyWindow (dpy, w, screen) Status XIconifyWindow (
Display *dpy; Display *dpy,
Window w; Window w,
int screen; int screen)
{ {
XClientMessageEvent ev; XClientMessageEvent ev;
Window root = RootWindow (dpy, screen); Window root = RootWindow (dpy, screen);
......
...@@ -38,7 +38,7 @@ XDrawImageString( ...@@ -38,7 +38,7 @@ XDrawImageString(
int y, int y,
_Xconst char *string, _Xconst char *string,
int length) int length)
{ {
register xImageText8Req *req; register xImageText8Req *req;
char *CharacterOffset = (char *)string; char *CharacterOffset = (char *)string;
int FirstTimeThrough = True; int FirstTimeThrough = True;
...@@ -47,7 +47,7 @@ XDrawImageString( ...@@ -47,7 +47,7 @@ XDrawImageString(
LockDisplay(dpy); LockDisplay(dpy);
FlushGC(dpy, gc); FlushGC(dpy, gc);
while (length > 0) while (length > 0)
{ {
int Unit; int Unit;
......
...@@ -38,7 +38,7 @@ XDrawImageString16( ...@@ -38,7 +38,7 @@ XDrawImageString16(
int y, int y,
_Xconst XChar2b *string, _Xconst XChar2b *string,
int length) int length)
{ {
register xImageText16Req *req; register xImageText16Req *req;
XChar2b *CharacterOffset = (XChar2b *)string; XChar2b *CharacterOffset = (XChar2b *)string;
int FirstTimeThrough = True; int FirstTimeThrough = True;
...@@ -47,7 +47,7 @@ XDrawImageString16( ...@@ -47,7 +47,7 @@ XDrawImageString16(
LockDisplay(dpy); LockDisplay(dpy);
FlushGC(dpy, gc); FlushGC(dpy, gc);
while (length > 0) while (length > 0)
{ {
int Unit, Datalength; int Unit, Datalength;
......
...@@ -49,8 +49,8 @@ static int _XAddPixel(XImage *, long); ...@@ -49,8 +49,8 @@ static int _XAddPixel(XImage *, long);
static unsigned char const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; static unsigned char const _lomask[0x09] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff };
static unsigned char const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00 }; static unsigned char const _himask[0x09] = { 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00 };
/* These two convenience routines return the scanline_pad and bits_per_pixel /* These two convenience routines return the scanline_pad and bits_per_pixel
associated with a specific depth of ZPixmap format image for a associated with a specific depth of ZPixmap format image for a
display. */ display. */
int int
...@@ -60,14 +60,14 @@ _XGetScanlinePad( ...@@ -60,14 +60,14 @@ _XGetScanlinePad(
{ {
register ScreenFormat *fmt = dpy->pixmap_format; register ScreenFormat *fmt = dpy->pixmap_format;
register int i; register int i;
for (i = dpy->nformats + 1; --i; ++fmt) for (i = dpy->nformats + 1; --i; ++fmt)
if (fmt->depth == depth) if (fmt->depth == depth)
return(fmt->scanline_pad); return(fmt->scanline_pad);
return(dpy->bitmap_pad); return(dpy->bitmap_pad);
} }
int int
_XGetBitsPerPixel( _XGetBitsPerPixel(
Display *dpy, Display *dpy,
...@@ -75,7 +75,7 @@ _XGetBitsPerPixel( ...@@ -75,7 +75,7 @@ _XGetBitsPerPixel(
{ {
register ScreenFormat *fmt = dpy->pixmap_format; register ScreenFormat *fmt = dpy->pixmap_format;
register int i; register int i;
for (i = dpy->nformats + 1; --i; ++fmt) for (i = dpy->nformats + 1; --i; ++fmt)
if (fmt->depth == depth) if (fmt->depth == depth)
return(fmt->bits_per_pixel); return(fmt->bits_per_pixel);
...@@ -87,7 +87,7 @@ _XGetBitsPerPixel( ...@@ -87,7 +87,7 @@ _XGetBitsPerPixel(
return 16; return 16;
return 32; return 32;
} }
/* /*
* This module provides rudimentary manipulation routines for image data * This module provides rudimentary manipulation routines for image data
...@@ -111,7 +111,7 @@ _XGetBitsPerPixel( ...@@ -111,7 +111,7 @@ _XGetBitsPerPixel(
* *
* The logic contained in these routines makes several assumptions about * The logic contained in these routines makes several assumptions about
* the image data structures, and at least for current implementations * the image data structures, and at least for current implementations
* these assumptions are believed to be true. They are: * these assumptions are believed to be true. They are:
* *
* For all formats, bits_per_pixel is less than or equal to 32. * For all formats, bits_per_pixel is less than or equal to 32.
* For XY formats, bitmap_unit is always less than or equal to bitmap_pad. * For XY formats, bitmap_unit is always less than or equal to bitmap_pad.
...@@ -211,31 +211,31 @@ static void _putbits( ...@@ -211,31 +211,31 @@ static void _putbits(
break; break;
} }
numbits = numbits - dstoffset; numbits = numbits - dstoffset;
} }
} }
/* /*
* Macros * Macros
* *
* The ROUNDUP macro rounds up a quantity to the specified boundary, * The ROUNDUP macro rounds up a quantity to the specified boundary,
* then truncates to bytes. * then truncates to bytes.
* *
* The XYNORMALIZE macro determines whether XY format data requires * The XYNORMALIZE macro determines whether XY format data requires
* normalization and calls a routine to do so if needed. The logic in * normalization and calls a routine to do so if needed. The logic in
* this module is designed for LSBFirst byte and bit order, so * this module is designed for LSBFirst byte and bit order, so
* normalization is done as required to present the data in this order. * normalization is done as required to present the data in this order.
* *
* The ZNORMALIZE macro performs byte and nibble order normalization if * The ZNORMALIZE macro performs byte and nibble order normalization if
* required for Z format data. * required for Z format data.
* *
* The XYINDEX macro computes the index to the starting byte (char) boundary * The XYINDEX macro computes the index to the starting byte (char) boundary
* for a bitmap_unit containing a pixel with coordinates x and y for image * for a bitmap_unit containing a pixel with coordinates x and y for image
* data in XY format. * data in XY format.
* *
* The ZINDEX macro computes the index to the starting byte (char) boundary * The ZINDEX macro computes the index to the starting byte (char) boundary
* for a pixel with coordinates x and y for image data in ZPixmap format. * for a pixel with coordinates x and y for image data in ZPixmap format.
* *
*/ */
#if defined(Lynx) && defined(ROUNDUP) #if defined(Lynx) && defined(ROUNDUP)
...@@ -299,26 +299,25 @@ void _XInitImageFuncPtrs ( ...@@ -299,26 +299,25 @@ void _XInitImageFuncPtrs (
/* /*
* CreateImage * CreateImage
* *
* Allocates the memory necessary for an XImage data structure. * Allocates the memory necessary for an XImage data structure.
* Initializes the structure with "default" values and returns XImage. * Initializes the structure with "default" values and returns XImage.
* *
*/ */
XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height, XImage *XCreateImage (
xpad, image_bytes_per_line) register Display *dpy,
register Display *dpy; register Visual *visual,
register Visual *visual; unsigned int depth,
unsigned int depth; int format,
int format; int offset, /*How many pixels from the start of the data does the
int offset; /*How many pixels from the start of the data does the
picture to be transmitted start?*/ picture to be transmitted start?*/
char *data; char *data,
unsigned int width; unsigned int width,
unsigned int height; unsigned int height,
int xpad; int xpad,
int image_bytes_per_line; int image_bytes_per_line)
/*How many bytes between a pixel on one line and the pixel with /*How many bytes between a pixel on one line and the pixel with
the same X coordinate on the next line? 0 means the same X coordinate on the next line? 0 means
XCreateImage can calculate it.*/ XCreateImage can calculate it.*/
...@@ -350,7 +349,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height, ...@@ -350,7 +349,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height,
else { else {
image->red_mask = image->green_mask = image->blue_mask = 0; image->red_mask = image->green_mask = image->blue_mask = 0;
} }
if (format == ZPixmap) if (format == ZPixmap)
{ {
bits_per_pixel = _XGetBitsPerPixel(dpy, (int) depth); bits_per_pixel = _XGetBitsPerPixel(dpy, (int) depth);
} }
...@@ -364,7 +363,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height, ...@@ -364,7 +363,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height,
*/ */
{ {
if (format == ZPixmap) if (format == ZPixmap)
min_bytes_per_line = min_bytes_per_line =
ROUNDUP((bits_per_pixel * width), image->bitmap_pad); ROUNDUP((bits_per_pixel * width), image->bitmap_pad);
else else
min_bytes_per_line = min_bytes_per_line =
...@@ -373,7 +372,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height, ...@@ -373,7 +372,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height,
if (image_bytes_per_line == 0) { if (image_bytes_per_line == 0) {
image->bytes_per_line = min_bytes_per_line; image->bytes_per_line = min_bytes_per_line;
} else if (image_bytes_per_line < min_bytes_per_line) { } else if (image_bytes_per_line < min_bytes_per_line) {
return 0; return NULL;
} else { } else {
image->bytes_per_line = image_bytes_per_line; image->bytes_per_line = image_bytes_per_line;
} }
...@@ -385,8 +384,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height, ...@@ -385,8 +384,7 @@ XImage *XCreateImage (dpy, visual, depth, format, offset, data, width, height,
return image; return image;
} }
Status XInitImage (image) Status XInitImage (XImage *image)
XImage *image;
{ {
int min_bytes_per_line; int min_bytes_per_line;
...@@ -407,7 +405,7 @@ Status XInitImage (image) ...@@ -407,7 +405,7 @@ Status XInitImage (image)
* compute per line accelerator. * compute per line accelerator.
*/ */
if (image->format == ZPixmap) if (image->format == ZPixmap)
min_bytes_per_line = min_bytes_per_line =
ROUNDUP((image->bits_per_pixel * image->width), ROUNDUP((image->bits_per_pixel * image->width),
image->bitmap_pad); image->bitmap_pad);
else else
...@@ -427,15 +425,13 @@ Status XInitImage (image) ...@@ -427,15 +425,13 @@ Status XInitImage (image)
/* /*
* _DestroyImage * _DestroyImage
* *
* Deallocates the memory associated with the ximage data structure. * Deallocates the memory associated with the ximage data structure.
* this version handles the case of the image data being malloc'd * this version handles the case of the image data being malloc'd
* entirely by the library. * entirely by the library.
*/ */
static int _XDestroyImage (ximage) static int _XDestroyImage (XImage *ximage)
XImage *ximage;
{ {
if (ximage->data != NULL) Xfree((char *)ximage->data); if (ximage->data != NULL) Xfree((char *)ximage->data);
if (ximage->obdata != NULL) Xfree((char *)ximage->obdata); if (ximage->obdata != NULL) Xfree((char *)ximage->obdata);
...@@ -446,8 +442,8 @@ static int _XDestroyImage (ximage) ...@@ -446,8 +442,8 @@ static int _XDestroyImage (ximage)
/* /*
* GetPixel * GetPixel
* *
* Returns the specified pixel. The X and Y coordinates are relative to * Returns the specified pixel. The X and Y coordinates are relative to
* the origin (upper left [0,0]) of the image. The pixel value is returned * the origin (upper left [0,0]) of the image. The pixel value is returned
* in normalized format, i.e. the LSB of the long is the LSB of the pixel. * in normalized format, i.e. the LSB of the long is the LSB of the pixel.
* The algorithm used is: * The algorithm used is:
...@@ -470,10 +466,10 @@ static unsigned long const low_bits_table[] = { ...@@ -470,10 +466,10 @@ static unsigned long const low_bits_table[] = {
0xffffffff 0xffffffff
}; };
static unsigned long _XGetPixel (ximage, x, y) static unsigned long _XGetPixel (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
unsigned long pixel, px; unsigned long pixel, px;
...@@ -482,7 +478,7 @@ static unsigned long _XGetPixel (ximage, x, y) ...@@ -482,7 +478,7 @@ static unsigned long _XGetPixel (ximage, x, y)
register int i, j; register int i, j;
int bits, nbytes; int bits, nbytes;
long plane; long plane;
if ((ximage->bits_per_pixel | ximage->depth) == 1) { if ((ximage->bits_per_pixel | ximage->depth) == 1) {
src = &ximage->data[XYINDEX(x, y, ximage)]; src = &ximage->data[XYINDEX(x, y, ximage)];
dst = (char *)&pixel; dst = (char *)&pixel;
...@@ -511,7 +507,7 @@ static unsigned long _XGetPixel (ximage, x, y) ...@@ -511,7 +507,7 @@ static unsigned long _XGetPixel (ximage, x, y)
dst = (char *)&px; dst = (char *)&px;
px = 0; px = 0;
for (i = (ximage->bits_per_pixel + 7) >> 3; --i >= 0; ) for (i = (ximage->bits_per_pixel + 7) >> 3; --i >= 0; )
*dst++ = *src++; *dst++ = *src++;
ZNORMALIZE(&px, ximage); ZNORMALIZE(&px, ximage);
pixel = 0; pixel = 0;
for (i=sizeof(unsigned long); --i >= 0; ) for (i=sizeof(unsigned long); --i >= 0; )
...@@ -533,10 +529,10 @@ static unsigned long _XGetPixel (ximage, x, y) ...@@ -533,10 +529,10 @@ static unsigned long _XGetPixel (ximage, x, y)
static CARD32 const byteorderpixel = MSBFirst << 24; static CARD32 const byteorderpixel = MSBFirst << 24;
static unsigned long _XGetPixel32 (ximage, x, y) static unsigned long _XGetPixel32 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
register unsigned char *addr; register unsigned char *addr;
unsigned long pixel; unsigned long pixel;
...@@ -566,10 +562,10 @@ static unsigned long _XGetPixel32 (ximage, x, y) ...@@ -566,10 +562,10 @@ static unsigned long _XGetPixel32 (ximage, x, y)
} }
} }
static unsigned long _XGetPixel16 (ximage, x, y) static unsigned long _XGetPixel16 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
register unsigned char *addr; register unsigned char *addr;
unsigned long pixel; unsigned long pixel;
...@@ -590,10 +586,10 @@ static unsigned long _XGetPixel16 (ximage, x, y) ...@@ -590,10 +586,10 @@ static unsigned long _XGetPixel16 (ximage, x, y)
} }
} }
static unsigned long _XGetPixel8 (ximage, x, y) static unsigned long _XGetPixel8 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
unsigned char pixel; unsigned char pixel;
...@@ -609,10 +605,10 @@ static unsigned long _XGetPixel8 (ximage, x, y) ...@@ -609,10 +605,10 @@ static unsigned long _XGetPixel8 (ximage, x, y)
} }
} }
static unsigned long _XGetPixel1 (ximage, x, y) static unsigned long _XGetPixel1 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y)
{ {
unsigned char bit; unsigned char bit;
int xoff, yoff; int xoff, yoff;
...@@ -632,11 +628,11 @@ static unsigned long _XGetPixel1 (ximage, x, y) ...@@ -632,11 +628,11 @@ static unsigned long _XGetPixel1 (ximage, x, y)
return XGetPixel(ximage, x, y); return XGetPixel(ximage, x, y);
} }
} }
/* /*
* PutPixel * PutPixel
* *
* Overwrites the specified pixel. The X and Y coordinates are relative to * Overwrites the specified pixel. The X and Y coordinates are relative to
* the origin (upper left [0,0]) of the image. The input pixel value must be * the origin (upper left [0,0]) of the image. The input pixel value must be
* in normalized format, i.e. the LSB of the long is the LSB of the pixel. * in normalized format, i.e. the LSB of the long is the LSB of the pixel.
* The algorithm used is: * The algorithm used is:
...@@ -649,11 +645,11 @@ static unsigned long _XGetPixel1 (ximage, x, y) ...@@ -649,11 +645,11 @@ static unsigned long _XGetPixel1 (ximage, x, y)
* *
*/ */
static int _XPutPixel (ximage, x, y, pixel) static int _XPutPixel (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
unsigned long px, npixel; unsigned long px, npixel;
...@@ -709,8 +705,8 @@ static int _XPutPixel (ximage, x, y, pixel) ...@@ -709,8 +705,8 @@ static int _XPutPixel (ximage, x, y, pixel)
nbytes = (ximage->bits_per_pixel + 7) >> 3; nbytes = (ximage->bits_per_pixel + 7) >> 3;
for (i = nbytes; --i >= 0; ) *dst++ = *src++; for (i = nbytes; --i >= 0; ) *dst++ = *src++;
ZNORMALIZE(&px, ximage); ZNORMALIZE(&px, ximage);
_putbits ((char *)&pixel, _putbits ((char *)&pixel,
(x * ximage->bits_per_pixel) & 7, (x * ximage->bits_per_pixel) & 7,
ximage->bits_per_pixel, (char *)&px); ximage->bits_per_pixel, (char *)&px);
ZNORMALIZE(&px, ximage); ZNORMALIZE(&px, ximage);
src = (char *)&px; src = (char *)&px;
...@@ -722,11 +718,11 @@ static int _XPutPixel (ximage, x, y, pixel) ...@@ -722,11 +718,11 @@ static int _XPutPixel (ximage, x, y, pixel)
return 1; return 1;
} }
static int _XPutPixel32 (ximage, x, y, pixel) static int _XPutPixel32 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
unsigned char *addr; unsigned char *addr;
...@@ -754,11 +750,11 @@ static int _XPutPixel32 (ximage, x, y, pixel) ...@@ -754,11 +750,11 @@ static int _XPutPixel32 (ximage, x, y, pixel)
} }
} }
static int _XPutPixel16 (ximage, x, y, pixel) static int _XPutPixel16 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
unsigned char *addr; unsigned char *addr;
...@@ -779,11 +775,11 @@ static int _XPutPixel16 (ximage, x, y, pixel) ...@@ -779,11 +775,11 @@ static int _XPutPixel16 (ximage, x, y, pixel)
} }
} }
static int _XPutPixel8 (ximage, x, y, pixel) static int _XPutPixel8 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 8)) { if ((ximage->format == ZPixmap) && (ximage->bits_per_pixel == 8)) {
ximage->data[y * ximage->bytes_per_line + x] = pixel; ximage->data[y * ximage->bytes_per_line + x] = pixel;
...@@ -794,11 +790,11 @@ static int _XPutPixel8 (ximage, x, y, pixel) ...@@ -794,11 +790,11 @@ static int _XPutPixel8 (ximage, x, y, pixel)
} }
} }
static int _XPutPixel1 (ximage, x, y, pixel) static int _XPutPixel1 (
register XImage *ximage; register XImage *ximage,
int x; int x,
int y; int y,
unsigned long pixel; unsigned long pixel)
{ {
unsigned char bit; unsigned char bit;
int xoff, yoff; int xoff, yoff;
...@@ -825,20 +821,20 @@ static int _XPutPixel1 (ximage, x, y, pixel) ...@@ -825,20 +821,20 @@ static int _XPutPixel1 (ximage, x, y, pixel)
/* /*
* SubImage * SubImage
* *
* Creates a new image that is a subsection of an existing one. * Creates a new image that is a subsection of an existing one.
* Allocates the memory necessary for the new XImage data structure. * Allocates the memory necessary for the new XImage data structure.
* Pointer to new image is returned. The algorithm used is repetitive * Pointer to new image is returned. The algorithm used is repetitive
* calls to get and put pixel. * calls to get and put pixel.
* *
*/ */
static XImage *_XSubImage (ximage, x, y, width, height) static XImage *_XSubImage (
XImage *ximage; XImage *ximage,
register int x; /* starting x coordinate in existing image */ register int x, /* starting x coordinate in existing image */
register int y; /* starting y coordinate in existing image */ register int y, /* starting y coordinate in existing image */
unsigned int width; /* width in pixels of new subimage */ unsigned int width, /* width in pixels of new subimage */
unsigned int height;/* height in pixels of new subimage */ unsigned int height)/* height in pixels of new subimage */
{ {
register XImage *subimage; register XImage *subimage;
...@@ -862,8 +858,8 @@ static XImage *_XSubImage (ximage, x, y, width, height) ...@@ -862,8 +858,8 @@ static XImage *_XSubImage (ximage, x, y, width, height)
/* /*
* compute per line accelerator. * compute per line accelerator.
*/ */
if (subimage->format == ZPixmap) if (subimage->format == ZPixmap)
subimage->bytes_per_line = subimage->bytes_per_line =
ROUNDUP(subimage->bits_per_pixel * width, ROUNDUP(subimage->bits_per_pixel * width,
subimage->bitmap_pad); subimage->bitmap_pad);
else else
...@@ -900,7 +896,7 @@ static XImage *_XSubImage (ximage, x, y, width, height) ...@@ -900,7 +896,7 @@ static XImage *_XSubImage (ximage, x, y, width, height)
/* /*
* SetImage * SetImage
* *
* Overwrites a section of one image with all of the data from another. * Overwrites a section of one image with all of the data from another.
* If the two images are not of the same format (i.e. XYPixmap and ZPixmap), * If the two images are not of the same format (i.e. XYPixmap and ZPixmap),
* the image data is converted to the destination format. The following * the image data is converted to the destination format. The following
...@@ -915,7 +911,7 @@ static XImage *_XSubImage (ximage, x, y, width, height) ...@@ -915,7 +911,7 @@ static XImage *_XSubImage (ximage, x, y, width, height)
* 3. If the width of the source image is too large to fit between * 3. If the width of the source image is too large to fit between
* the specified x starting point and the end of the scanline, * the specified x starting point and the end of the scanline,
* then pixels are truncated on the right. * then pixels are truncated on the right.
* *
* The images need not have the same bitmap_bit_order, byte_order, * The images need not have the same bitmap_bit_order, byte_order,
* bitmap_unit, bits_per_pixel, bitmap_pad, or xoffset. * bitmap_unit, bits_per_pixel, bitmap_pad, or xoffset.
* *
...@@ -959,15 +955,15 @@ int _XSetImage( ...@@ -959,15 +955,15 @@ int _XSetImage(
/* /*
* AddPixel * AddPixel
* *
* Adds a constant value to every pixel in a pixmap. * Adds a constant value to every pixel in a pixmap.
* *
*/ */
static int static int
_XAddPixel (ximage, value) _XAddPixel (
register XImage *ximage; register XImage *ximage,
register long value; register long value)
{ {
register int x; register int x;
register int y; register int y;
......
...@@ -90,6 +90,12 @@ NX_XCOMPEXTCONFIGTARGET = $(NX_XCOMPEXTLIBDIR)/config.status ...@@ -90,6 +90,12 @@ NX_XCOMPEXTCONFIGTARGET = $(NX_XCOMPEXTLIBDIR)/config.status
SUBDIRS = xlibi18n SUBDIRS = xlibi18n
#endif #endif
/*
FIXME: This is switchable upstream via configure option, we leave it
on for now as this is the upstream default.
*/
XCMS_DEFINES = -DXCMS
#include <Threads.tmpl> #include <Threads.tmpl>
#ifndef MotifBC #ifndef MotifBC
...@@ -187,7 +193,7 @@ XCURSOR_DEFINES = -DUSE_DYNAMIC_XCURSOR -DLIBXCURSOR=\"libXcursor.so.$(SOXCURSOR ...@@ -187,7 +193,7 @@ XCURSOR_DEFINES = -DUSE_DYNAMIC_XCURSOR -DLIBXCURSOR=\"libXcursor.so.$(SOXCURSOR
POSTLOCALELIBDEFINES = -DPOSTLOCALELIBDIR=\"$(POSTLOCALELIBDIR)\" POSTLOCALELIBDEFINES = -DPOSTLOCALELIBDIR=\"$(POSTLOCALELIBDIR)\"
#endif #endif
DEFINES = $(MALLOC_DEFINES) $(LIB_DEFINES) $(MISC_DEFINES)\ DEFINES = $(MALLOC_DEFINES) $(LIB_DEFINES) $(MISC_DEFINES)\
$(POSTLOCALELIBDEFINES) $(NX_INCLUDES) $(NX_DEFINES) $(POSTLOCALELIBDEFINES) $(NX_INCLUDES) $(NX_DEFINES) ${XCMS_DEFINES}
OPEN_DEFINES = -I$(EXTINCSRC) $(K5INCL) $(K5DEFS) OPEN_DEFINES = -I$(EXTINCSRC) $(K5INCL) $(K5DEFS)
DEPEND_DEFINES = $(OPEN_DEFINES) $(TRANS_INCLUDES) $(CONN_DEFINES) $(THREADS_DEFINES) DependDefines DEPEND_DEFINES = $(OPEN_DEFINES) $(TRANS_INCLUDES) $(CONN_DEFINES) $(THREADS_DEFINES) DependDefines
AUTHOBJS = AuDispose.o AuGetBest.o AuFileName.o AuRead.o AUTHOBJS = AuDispose.o AuGetBest.o AuFileName.o AuRead.o
......
...@@ -44,7 +44,7 @@ XExtCodes *XInitExtension ( ...@@ -44,7 +44,7 @@ XExtCodes *XInitExtension (
{ {
XExtCodes codes; /* temp. place for extension information. */ XExtCodes codes; /* temp. place for extension information. */
register _XExtension *ext;/* need a place to build it all */ register _XExtension *ext;/* need a place to build it all */
if (!XQueryExtension(dpy, name, if (!XQueryExtension(dpy, name,
&codes.major_opcode, &codes.first_event, &codes.major_opcode, &codes.first_event,
&codes.first_error)) return (NULL); &codes.first_error)) return (NULL);
...@@ -59,7 +59,7 @@ XExtCodes *XInitExtension ( ...@@ -59,7 +59,7 @@ XExtCodes *XInitExtension (
ext->codes = codes; ext->codes = codes;
(void) strcpy(ext->name, name); (void) strcpy(ext->name, name);
/* chain it onto the display list */ /* chain it onto the display list */
ext->next = dpy->ext_procs; ext->next = dpy->ext_procs;
dpy->ext_procs = ext; dpy->ext_procs = ext;
UnlockDisplay (dpy); UnlockDisplay (dpy);
...@@ -67,8 +67,7 @@ XExtCodes *XInitExtension ( ...@@ -67,8 +67,7 @@ XExtCodes *XInitExtension (
return (&ext->codes); /* tell him which extension */ return (&ext->codes); /* tell him which extension */
} }
XExtCodes *XAddExtension (dpy) XExtCodes *XAddExtension (Display *dpy)
Display *dpy;
{ {
register _XExtension *ext; register _XExtension *ext;
...@@ -97,25 +96,24 @@ static _XExtension *XLookupExtension ( ...@@ -97,25 +96,24 @@ static _XExtension *XLookupExtension (
return (NULL); return (NULL);
} }
XExtData **XEHeadOfExtensionList(object) XExtData **XEHeadOfExtensionList(XEDataObject object)
XEDataObject object;
{ {
return *(XExtData ***)&object; return *(XExtData ***)&object;
} }
int int
XAddToExtensionList(structure, ext_data) XAddToExtensionList(
XExtData **structure; XExtData **structure,
XExtData *ext_data; XExtData *ext_data)
{ {
ext_data->next = *structure; ext_data->next = *structure;
*structure = ext_data; *structure = ext_data;
return 1; return 1;
} }
XExtData *XFindOnExtensionList(structure, number) XExtData *XFindOnExtensionList(
XExtData **structure; XExtData **structure,
int number; int number)
{ {
XExtData *ext; XExtData *ext;
...@@ -128,10 +126,10 @@ XExtData *XFindOnExtensionList(structure, number) ...@@ -128,10 +126,10 @@ XExtData *XFindOnExtensionList(structure, number)
/* /*
* Routines to hang procs on the extension structure. * Routines to hang procs on the extension structure.
*/ */
CreateGCType XESetCreateGC(dpy, extension, proc) CreateGCType XESetCreateGC(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
CreateGCType proc; /* routine to call when GC created */ CreateGCType proc) /* routine to call when GC created */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register CreateGCType oldproc; register CreateGCType oldproc;
...@@ -143,10 +141,10 @@ CreateGCType XESetCreateGC(dpy, extension, proc) ...@@ -143,10 +141,10 @@ CreateGCType XESetCreateGC(dpy, extension, proc)
return (CreateGCType)oldproc; return (CreateGCType)oldproc;
} }
CopyGCType XESetCopyGC(dpy, extension, proc) CopyGCType XESetCopyGC(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
CopyGCType proc; /* routine to call when GC copied */ CopyGCType proc) /* routine to call when GC copied */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register CopyGCType oldproc; register CopyGCType oldproc;
...@@ -158,10 +156,10 @@ CopyGCType XESetCopyGC(dpy, extension, proc) ...@@ -158,10 +156,10 @@ CopyGCType XESetCopyGC(dpy, extension, proc)
return (CopyGCType)oldproc; return (CopyGCType)oldproc;
} }
FlushGCType XESetFlushGC(dpy, extension, proc) FlushGCType XESetFlushGC(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
FlushGCType proc; /* routine to call when GC copied */ FlushGCType proc) /* routine to call when GC copied */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register FlushGCType oldproc; register FlushGCType oldproc;
...@@ -173,10 +171,10 @@ FlushGCType XESetFlushGC(dpy, extension, proc) ...@@ -173,10 +171,10 @@ FlushGCType XESetFlushGC(dpy, extension, proc)
return (FlushGCType)oldproc; return (FlushGCType)oldproc;
} }
FreeGCType XESetFreeGC(dpy, extension, proc) FreeGCType XESetFreeGC(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
FreeGCType proc; /* routine to call when GC freed */ FreeGCType proc) /* routine to call when GC freed */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register FreeGCType oldproc; register FreeGCType oldproc;
...@@ -188,10 +186,10 @@ FreeGCType XESetFreeGC(dpy, extension, proc) ...@@ -188,10 +186,10 @@ FreeGCType XESetFreeGC(dpy, extension, proc)
return (FreeGCType)oldproc; return (FreeGCType)oldproc;
} }
CreateFontType XESetCreateFont(dpy, extension, proc) CreateFontType XESetCreateFont(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
CreateFontType proc; /* routine to call when font created */ CreateFontType proc) /* routine to call when font created */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register CreateFontType oldproc; register CreateFontType oldproc;
...@@ -203,10 +201,10 @@ CreateFontType XESetCreateFont(dpy, extension, proc) ...@@ -203,10 +201,10 @@ CreateFontType XESetCreateFont(dpy, extension, proc)
return (CreateFontType)oldproc; return (CreateFontType)oldproc;
} }
FreeFontType XESetFreeFont(dpy, extension, proc) FreeFontType XESetFreeFont(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
FreeFontType proc; /* routine to call when font freed */ FreeFontType proc) /* routine to call when font freed */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register FreeFontType oldproc; register FreeFontType oldproc;
...@@ -218,10 +216,10 @@ FreeFontType XESetFreeFont(dpy, extension, proc) ...@@ -218,10 +216,10 @@ FreeFontType XESetFreeFont(dpy, extension, proc)
return (FreeFontType)oldproc; return (FreeFontType)oldproc;
} }
CloseDisplayType XESetCloseDisplay(dpy, extension, proc) CloseDisplayType XESetCloseDisplay(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
CloseDisplayType proc; /* routine to call when display closed */ CloseDisplayType proc) /* routine to call when display closed */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register CloseDisplayType oldproc; register CloseDisplayType oldproc;
...@@ -239,10 +237,10 @@ typedef Bool (*WireToEventType) ( ...@@ -239,10 +237,10 @@ typedef Bool (*WireToEventType) (
xEvent* /* event */ xEvent* /* event */
); );
WireToEventType XESetWireToEvent(dpy, event_number, proc) WireToEventType XESetWireToEvent(
Display *dpy; /* display */ Display *dpy, /* display */
WireToEventType proc; /* routine to call when converting event */ int event_number, /* event routine to replace */
int event_number; /* event routine to replace */ WireToEventType proc) /* routine to call when converting event */
{ {
register WireToEventType oldproc; register WireToEventType oldproc;
if (proc == NULL) proc = (WireToEventType)_XUnknownWireEvent; if (proc == NULL) proc = (WireToEventType)_XUnknownWireEvent;
...@@ -253,16 +251,59 @@ WireToEventType XESetWireToEvent(dpy, event_number, proc) ...@@ -253,16 +251,59 @@ WireToEventType XESetWireToEvent(dpy, event_number, proc)
return (WireToEventType)oldproc; return (WireToEventType)oldproc;
} }
typedef Bool (*WireToEventCookieType) (
Display* /* display */,
XGenericEventCookie* /* re */,
xEvent* /* event */
);
WireToEventCookieType XESetWireToEventCookie(
Display *dpy, /* display */
int extension, /* extension major opcode */
WireToEventCookieType proc /* routine to call for generic events */
)
{
WireToEventCookieType oldproc;
if (proc == NULL) proc = (WireToEventCookieType)_XUnknownWireEventCookie;
LockDisplay (dpy);
oldproc = dpy->generic_event_vec[extension & 0x7F];
dpy->generic_event_vec[extension & 0x7F] = proc;
UnlockDisplay (dpy);
return (WireToEventCookieType)oldproc;
}
typedef Bool (*CopyEventCookieType) (
Display* /* display */,
XGenericEventCookie* /* in */,
XGenericEventCookie* /* out */
);
CopyEventCookieType XESetCopyEventCookie(
Display *dpy, /* display */
int extension, /* extension major opcode */
CopyEventCookieType proc /* routine to copy generic events */
)
{
CopyEventCookieType oldproc;
if (proc == NULL) proc = (CopyEventCookieType)_XUnknownCopyEventCookie;
LockDisplay (dpy);
oldproc = dpy->generic_event_copy_vec[extension & 0x7F];
dpy->generic_event_copy_vec[extension & 0x7F] = proc;
UnlockDisplay (dpy);
return (CopyEventCookieType)oldproc;
}
typedef Status (*EventToWireType) ( typedef Status (*EventToWireType) (
Display* /* display */, Display* /* display */,
XEvent* /* re */, XEvent* /* re */,
xEvent* /* event */ xEvent* /* event */
); );
EventToWireType XESetEventToWire(dpy, event_number, proc) EventToWireType XESetEventToWire(
Display *dpy; /* display */ Display *dpy, /* display */
EventToWireType proc; /* routine to call when converting event */ int event_number, /* event routine to replace */
int event_number; /* event routine to replace */ EventToWireType proc) /* routine to call when converting event */
{ {
register EventToWireType oldproc; register EventToWireType oldproc;
if (proc == NULL) proc = (EventToWireType) _XUnknownNativeEvent; if (proc == NULL) proc = (EventToWireType) _XUnknownNativeEvent;
...@@ -279,10 +320,10 @@ typedef Bool (*WireToErrorType) ( ...@@ -279,10 +320,10 @@ typedef Bool (*WireToErrorType) (
xError* /* we */ xError* /* we */
); );
WireToErrorType XESetWireToError(dpy, error_number, proc) WireToErrorType XESetWireToError(
Display *dpy; /* display */ Display *dpy, /* display */
WireToErrorType proc; /* routine to call when converting error */ int error_number, /* error routine to replace */
int error_number; /* error routine to replace */ WireToErrorType proc) /* routine to call when converting error */
{ {
register WireToErrorType oldproc = NULL; register WireToErrorType oldproc = NULL;
if (proc == NULL) proc = (WireToErrorType)_XDefaultWireError; if (proc == NULL) proc = (WireToErrorType)_XDefaultWireError;
...@@ -301,10 +342,10 @@ WireToErrorType XESetWireToError(dpy, error_number, proc) ...@@ -301,10 +342,10 @@ WireToErrorType XESetWireToError(dpy, error_number, proc)
return (WireToErrorType)oldproc; return (WireToErrorType)oldproc;
} }
ErrorType XESetError(dpy, extension, proc) ErrorType XESetError(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
ErrorType proc; /* routine to call when X error happens */ ErrorType proc) /* routine to call when X error happens */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register ErrorType oldproc; register ErrorType oldproc;
...@@ -316,10 +357,10 @@ ErrorType XESetError(dpy, extension, proc) ...@@ -316,10 +357,10 @@ ErrorType XESetError(dpy, extension, proc)
return (ErrorType)oldproc; return (ErrorType)oldproc;
} }
ErrorStringType XESetErrorString(dpy, extension, proc) ErrorStringType XESetErrorString(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
ErrorStringType proc; /* routine to call when I/O error happens */ ErrorStringType proc) /* routine to call when I/O error happens */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register ErrorStringType oldproc; register ErrorStringType oldproc;
...@@ -331,10 +372,10 @@ ErrorStringType XESetErrorString(dpy, extension, proc) ...@@ -331,10 +372,10 @@ ErrorStringType XESetErrorString(dpy, extension, proc)
return (ErrorStringType)oldproc; return (ErrorStringType)oldproc;
} }
PrintErrorType XESetPrintErrorValues(dpy, extension, proc) PrintErrorType XESetPrintErrorValues(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
PrintErrorType proc; /* routine to call to print */ PrintErrorType proc) /* routine to call to print */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register PrintErrorType oldproc; register PrintErrorType oldproc;
...@@ -346,10 +387,10 @@ PrintErrorType XESetPrintErrorValues(dpy, extension, proc) ...@@ -346,10 +387,10 @@ PrintErrorType XESetPrintErrorValues(dpy, extension, proc)
return (PrintErrorType)oldproc; return (PrintErrorType)oldproc;
} }
BeforeFlushType XESetBeforeFlush(dpy, extension, proc) BeforeFlushType XESetBeforeFlush(
Display *dpy; /* display */ Display *dpy, /* display */
int extension; /* extension number */ int extension, /* extension number */
BeforeFlushType proc; /* routine to call on flush */ BeforeFlushType proc) /* routine to call on flush */
{ {
register _XExtension *e; /* for lookup of extension */ register _XExtension *e; /* for lookup of extension */
register BeforeFlushType oldproc; register BeforeFlushType oldproc;
...@@ -363,7 +404,7 @@ BeforeFlushType XESetBeforeFlush(dpy, extension, proc) ...@@ -363,7 +404,7 @@ BeforeFlushType XESetBeforeFlush(dpy, extension, proc)
if (!ext) { if (!ext) {
e->next_flush = dpy->flushes; e->next_flush = dpy->flushes;
dpy->flushes = e; dpy->flushes = e;
} }
UnlockDisplay(dpy); UnlockDisplay(dpy);
return (BeforeFlushType)oldproc; return (BeforeFlushType)oldproc;
} }
...@@ -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
XInstallColormap(dpy, cmap) XInstallColormap(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -37,8 +37,7 @@ from The Open Group. ...@@ -37,8 +37,7 @@ from The Open Group.
#define REHASH(idx,rehash) ((idx + rehash) & (TABLESIZE-1)) #define REHASH(idx,rehash) ((idx + rehash) & (TABLESIZE-1))
void void
_XFreeAtomTable(dpy) _XFreeAtomTable(Display *dpy)
Display *dpy;
{ {
register Entry *table; register Entry *table;
register int i; register int i;
...@@ -113,13 +112,13 @@ nomatch: if (idx == firstidx) ...@@ -113,13 +112,13 @@ nomatch: if (idx == firstidx)
} }
void void
_XUpdateAtomCache(dpy, name, atom, sig, idx, n) _XUpdateAtomCache(
Display *dpy; Display *dpy,
const char *name; const char *name,
Atom atom; Atom atom,
unsigned long sig; unsigned long sig,
int idx; int idx,
int n; int n)
{ {
Entry e, oe; Entry e, oe;
register char *s1; register char *s1;
...@@ -238,12 +237,12 @@ Bool _XIntAtomHandler( ...@@ -238,12 +237,12 @@ Bool _XIntAtomHandler(
} }
Status Status
XInternAtoms (dpy, names, count, onlyIfExists, atoms_return) XInternAtoms (
Display *dpy; Display *dpy,
char **names; char **names,
int count; int count,
Bool onlyIfExists; Bool onlyIfExists,
Atom *atoms_return; Atom *atoms_return)
{ {
int i, idx, n, tidx; int i, idx, n, tidx;
unsigned long sig; unsigned long sig;
...@@ -283,7 +282,7 @@ XInternAtoms (dpy, names, count, onlyIfExists, atoms_return) ...@@ -283,7 +282,7 @@ XInternAtoms (dpy, names, count, onlyIfExists, atoms_return)
} }
if (_XReply (dpy, (xReply *)&rep, 0, xTrue)) { if (_XReply (dpy, (xReply *)&rep, 0, xTrue)) {
if ((atoms_return[missed] = rep.atom)) if ((atoms_return[missed] = rep.atom))
_XUpdateAtomCache(dpy, names[missed], (Atom) rep.atom, _XUpdateAtomCache(dpy, names[missed], (Atom) rep.atom,
sig, idx, n); sig, idx, n);
} else { } else {
atoms_return[missed] = None; atoms_return[missed] = None;
......
/* $XFree86$ */
#ifndef _KEY_H_ #ifndef _KEY_H_
#define _KEY_H_ #define _KEY_H_
......
/* /*
Copyright 1985, 1987, 1998 The Open Group Copyright 1985, 1987, 1998 The Open Group
...@@ -133,9 +133,9 @@ XKeycodeToKeysym(Display *dpy, ...@@ -133,9 +133,9 @@ XKeycodeToKeysym(Display *dpy,
} }
KeyCode KeyCode
XKeysymToKeycode(dpy, ks) XKeysymToKeycode(
Display *dpy; Display *dpy,
KeySym ks; KeySym ks)
{ {
register int i, j; register int i, j;
...@@ -151,9 +151,9 @@ XKeysymToKeycode(dpy, ks) ...@@ -151,9 +151,9 @@ XKeysymToKeycode(dpy, ks)
} }
KeySym KeySym
XLookupKeysym(event, col) XLookupKeysym(
register XKeyEvent *event; register XKeyEvent *event,
int col; int col)
{ {
if ((! event->display->keysyms) && (! _XKeyInitialize(event->display))) if ((! event->display->keysyms) && (! _XKeyInitialize(event->display)))
return NoSymbol; return NoSymbol;
...@@ -229,8 +229,7 @@ InitModMap( ...@@ -229,8 +229,7 @@ InitModMap(
} }
int int
XRefreshKeyboardMapping(event) XRefreshKeyboardMapping(register XMappingEvent *event)
register XMappingEvent *event;
{ {
if(event->request == MappingKeyboard) { if(event->request == MappingKeyboard) {
...@@ -265,7 +264,7 @@ _XKeyInitialize( ...@@ -265,7 +264,7 @@ _XKeyInitialize(
int per, n; int per, n;
KeySym *keysyms; KeySym *keysyms;
/* /*
* lets go get the keysyms from the server. * lets go get the keysyms from the server.
*/ */
if (!dpy->keysyms) { if (!dpy->keysyms) {
...@@ -338,35 +337,35 @@ UCSConvertCase( register unsigned code, ...@@ -338,35 +337,35 @@ UCSConvertCase( register unsigned code,
0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C6, 0x01C6, 0x01C6, 0x01C9, 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C6, 0x01C6, 0x01C6, 0x01C9,
0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC 0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC
}; };
static unsigned short const Greek_upper_mapping[] = { static unsigned short const Greek_upper_mapping[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000,
0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000, 0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x0386, 0x0387, 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x0386, 0x0387,
0x0388, 0x0389, 0x038A, 0x0000, 0x038C, 0x0000, 0x038E, 0x038F, 0x0388, 0x0389, 0x038A, 0x0000, 0x038C, 0x0000, 0x038E, 0x038F,
0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x0386, 0x0388, 0x0389, 0x038A, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x0386, 0x0388, 0x0389, 0x038A,
0x03B0, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x03B0, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
0x03A0, 0x03A1, 0x03A3, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A0, 0x03A1, 0x03A3, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x038C, 0x038E, 0x038F, 0x0000, 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x038C, 0x038E, 0x038F, 0x0000,
0x0392, 0x0398, 0x03D2, 0x03D3, 0x03D4, 0x03A6, 0x03A0, 0x03D7, 0x0392, 0x0398, 0x03D2, 0x03D3, 0x03D4, 0x03A6, 0x03A0, 0x03D7,
0x03D8, 0x03D8, 0x03DA, 0x03DA, 0x03DC, 0x03DC, 0x03DE, 0x03DE, 0x03D8, 0x03D8, 0x03DA, 0x03DA, 0x03DC, 0x03DC, 0x03DE, 0x03DE,
0x03E0, 0x03E0, 0x03E2, 0x03E2, 0x03E4, 0x03E4, 0x03E6, 0x03E6, 0x03E0, 0x03E0, 0x03E2, 0x03E2, 0x03E4, 0x03E4, 0x03E6, 0x03E6,
0x03E8, 0x03E8, 0x03EA, 0x03EA, 0x03EC, 0x03EC, 0x03EE, 0x03EE, 0x03E8, 0x03E8, 0x03EA, 0x03EA, 0x03EC, 0x03EC, 0x03EE, 0x03EE,
0x039A, 0x03A1, 0x03F9, 0x03F3, 0x03F4, 0x0395, 0x03F6, 0x03F7, 0x039A, 0x03A1, 0x03F9, 0x03F3, 0x03F4, 0x0395, 0x03F6, 0x03F7,
0x03F7, 0x03F9, 0x03FA, 0x03FA, 0x0000, 0x0000, 0x0000, 0x0000 0x03F7, 0x03F9, 0x03FA, 0x03FA, 0x0000, 0x0000, 0x0000, 0x0000
}; };
static unsigned short const Greek_lower_mapping[] = { static unsigned short const Greek_lower_mapping[] = {
0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0374, 0x0375, 0x0000, 0x0000,
0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000, 0x0000, 0x0000, 0x037A, 0x0000, 0x0000, 0x0000, 0x037E, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x03AC, 0x0387, 0x0000, 0x0000, 0x0000, 0x0000, 0x0384, 0x0385, 0x03AC, 0x0387,
0x03AD, 0x03AE, 0x03AF, 0x0000, 0x03CC, 0x0000, 0x03CD, 0x03CE, 0x03AD, 0x03AE, 0x03AF, 0x0000, 0x03CC, 0x0000, 0x03CD, 0x03CE,
0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
0x03C0, 0x03C1, 0x0000, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C0, 0x03C1, 0x0000, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
...@@ -383,71 +382,71 @@ UCSConvertCase( register unsigned code, ...@@ -383,71 +382,71 @@ UCSConvertCase( register unsigned code,
static unsigned short const GreekExt_lower_mapping[] = { static unsigned short const GreekExt_lower_mapping[] = {
0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07,
0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07,
0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000, 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000,
0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000, 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x0000, 0x0000,
0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27, 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27,
0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27, 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27,
0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37, 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37,
0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37, 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37,
0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000, 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000,
0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000, 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x0000, 0x0000,
0x1F50, 0x1F51, 0x1F52, 0x1F53, 0x1F54, 0x1F55, 0x1F56, 0x1F57, 0x1F50, 0x1F51, 0x1F52, 0x1F53, 0x1F54, 0x1F55, 0x1F56, 0x1F57,
0x0000, 0x1F51, 0x0000, 0x1F53, 0x0000, 0x1F55, 0x0000, 0x1F57, 0x0000, 0x1F51, 0x0000, 0x1F53, 0x0000, 0x1F55, 0x0000, 0x1F57,
0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67,
0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67,
0x1F70, 0x1F71, 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1F76, 0x1F77, 0x1F70, 0x1F71, 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1F76, 0x1F77,
0x1F78, 0x1F79, 0x1F7A, 0x1F7B, 0x1F7C, 0x1F7D, 0x0000, 0x0000, 0x1F78, 0x1F79, 0x1F7A, 0x1F7B, 0x1F7C, 0x1F7D, 0x0000, 0x0000,
0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87, 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87,
0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87, 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87,
0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97, 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97,
0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97, 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97,
0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7, 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7,
0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7, 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7,
0x1FB0, 0x1FB1, 0x1FB2, 0x1FB3, 0x1FB4, 0x0000, 0x1FB6, 0x1FB7, 0x1FB0, 0x1FB1, 0x1FB2, 0x1FB3, 0x1FB4, 0x0000, 0x1FB6, 0x1FB7,
0x1FB0, 0x1FB1, 0x1F70, 0x1F71, 0x1FB3, 0x1FBD, 0x1FBE, 0x1FBF, 0x1FB0, 0x1FB1, 0x1F70, 0x1F71, 0x1FB3, 0x1FBD, 0x1FBE, 0x1FBF,
0x1FC0, 0x1FC1, 0x1FC2, 0x1FC3, 0x1FC4, 0x0000, 0x1FC6, 0x1FC7, 0x1FC0, 0x1FC1, 0x1FC2, 0x1FC3, 0x1FC4, 0x0000, 0x1FC6, 0x1FC7,
0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1FC3, 0x1FCD, 0x1FCE, 0x1FCF, 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1FC3, 0x1FCD, 0x1FCE, 0x1FCF,
0x1FD0, 0x1FD1, 0x1FD2, 0x1FD3, 0x0000, 0x0000, 0x1FD6, 0x1FD7, 0x1FD0, 0x1FD1, 0x1FD2, 0x1FD3, 0x0000, 0x0000, 0x1FD6, 0x1FD7,
0x1FD0, 0x1FD1, 0x1F76, 0x1F77, 0x0000, 0x1FDD, 0x1FDE, 0x1FDF, 0x1FD0, 0x1FD1, 0x1F76, 0x1F77, 0x0000, 0x1FDD, 0x1FDE, 0x1FDF,
0x1FE0, 0x1FE1, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FE5, 0x1FE6, 0x1FE7, 0x1FE0, 0x1FE1, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FE5, 0x1FE6, 0x1FE7,
0x1FE0, 0x1FE1, 0x1F7A, 0x1F7B, 0x1FE5, 0x1FED, 0x1FEE, 0x1FEF, 0x1FE0, 0x1FE1, 0x1F7A, 0x1F7B, 0x1FE5, 0x1FED, 0x1FEE, 0x1FEF,
0x0000, 0x0000, 0x1FF2, 0x1FF3, 0x1FF4, 0x0000, 0x1FF6, 0x1FF7, 0x0000, 0x0000, 0x1FF2, 0x1FF3, 0x1FF4, 0x0000, 0x1FF6, 0x1FF7,
0x1F78, 0x1F79, 0x1F7C, 0x1F7D, 0x1FF3, 0x1FFD, 0x1FFE, 0x0000 0x1F78, 0x1F79, 0x1F7C, 0x1F7D, 0x1FF3, 0x1FFD, 0x1FFE, 0x0000
}; };
static unsigned short const GreekExt_upper_mapping[] = { static unsigned short const GreekExt_upper_mapping[] = {
0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F, 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F,
0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F, 0x1F08, 0x1F09, 0x1F0A, 0x1F0B, 0x1F0C, 0x1F0D, 0x1F0E, 0x1F0F,
0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000, 0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000,
0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000, 0x1F18, 0x1F19, 0x1F1A, 0x1F1B, 0x1F1C, 0x1F1D, 0x0000, 0x0000,
0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F, 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F,
0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F, 0x1F28, 0x1F29, 0x1F2A, 0x1F2B, 0x1F2C, 0x1F2D, 0x1F2E, 0x1F2F,
0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F, 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F,
0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F, 0x1F38, 0x1F39, 0x1F3A, 0x1F3B, 0x1F3C, 0x1F3D, 0x1F3E, 0x1F3F,
0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000, 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000,
0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000, 0x1F48, 0x1F49, 0x1F4A, 0x1F4B, 0x1F4C, 0x1F4D, 0x0000, 0x0000,
0x1F50, 0x1F59, 0x1F52, 0x1F5B, 0x1F54, 0x1F5D, 0x1F56, 0x1F5F, 0x1F50, 0x1F59, 0x1F52, 0x1F5B, 0x1F54, 0x1F5D, 0x1F56, 0x1F5F,
0x0000, 0x1F59, 0x0000, 0x1F5B, 0x0000, 0x1F5D, 0x0000, 0x1F5F, 0x0000, 0x1F59, 0x0000, 0x1F5B, 0x0000, 0x1F5D, 0x0000, 0x1F5F,
0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F, 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F,
0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F, 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, 0x1F6D, 0x1F6E, 0x1F6F,
0x1FBA, 0x1FBB, 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FDA, 0x1FDB, 0x1FBA, 0x1FBB, 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FDA, 0x1FDB,
0x1FF8, 0x1FF9, 0x1FEA, 0x1FEB, 0x1FFA, 0x1FFB, 0x0000, 0x0000, 0x1FF8, 0x1FF9, 0x1FEA, 0x1FEB, 0x1FFA, 0x1FFB, 0x0000, 0x0000,
0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F, 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F,
0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F, 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, 0x1F8D, 0x1F8E, 0x1F8F,
0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F, 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F,
0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F, 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, 0x1F9D, 0x1F9E, 0x1F9F,
0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF, 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF,
0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF, 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, 0x1FAD, 0x1FAE, 0x1FAF,
0x1FB8, 0x1FB9, 0x1FB2, 0x1FBC, 0x1FB4, 0x0000, 0x1FB6, 0x1FB7, 0x1FB8, 0x1FB9, 0x1FB2, 0x1FBC, 0x1FB4, 0x0000, 0x1FB6, 0x1FB7,
0x1FB8, 0x1FB9, 0x1FBA, 0x1FBB, 0x1FBC, 0x1FBD, 0x0399, 0x1FBF, 0x1FB8, 0x1FB9, 0x1FBA, 0x1FBB, 0x1FBC, 0x1FBD, 0x0399, 0x1FBF,
0x1FC0, 0x1FC1, 0x1FC2, 0x1FCC, 0x1FC4, 0x0000, 0x1FC6, 0x1FC7, 0x1FC0, 0x1FC1, 0x1FC2, 0x1FCC, 0x1FC4, 0x0000, 0x1FC6, 0x1FC7,
0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FCC, 0x1FCD, 0x1FCE, 0x1FCF, 0x1FC8, 0x1FC9, 0x1FCA, 0x1FCB, 0x1FCC, 0x1FCD, 0x1FCE, 0x1FCF,
0x1FD8, 0x1FD9, 0x1FD2, 0x1FD3, 0x0000, 0x0000, 0x1FD6, 0x1FD7, 0x1FD8, 0x1FD9, 0x1FD2, 0x1FD3, 0x0000, 0x0000, 0x1FD6, 0x1FD7,
0x1FD8, 0x1FD9, 0x1FDA, 0x1FDB, 0x0000, 0x1FDD, 0x1FDE, 0x1FDF, 0x1FD8, 0x1FD9, 0x1FDA, 0x1FDB, 0x0000, 0x1FDD, 0x1FDE, 0x1FDF,
0x1FE8, 0x1FE9, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FEC, 0x1FE6, 0x1FE7, 0x1FE8, 0x1FE9, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FEC, 0x1FE6, 0x1FE7,
0x1FE8, 0x1FE9, 0x1FEA, 0x1FEB, 0x1FEC, 0x1FED, 0x1FEE, 0x1FEF, 0x1FE8, 0x1FE9, 0x1FEA, 0x1FEB, 0x1FEC, 0x1FED, 0x1FEE, 0x1FEF,
0x0000, 0x0000, 0x1FF2, 0x1FFC, 0x1FF4, 0x0000, 0x1FF6, 0x1FF7, 0x0000, 0x0000, 0x1FF2, 0x1FFC, 0x1FF4, 0x0000, 0x1FF6, 0x1FF7,
0x1FF8, 0x1FF9, 0x1FFA, 0x1FFB, 0x1FFC, 0x1FFD, 0x1FFE, 0x0000 0x1FF8, 0x1FF9, 0x1FFA, 0x1FFB, 0x1FFC, 0x1FFD, 0x1FFE, 0x0000
}; };
...@@ -642,10 +641,10 @@ UCSConvertCase( register unsigned code, ...@@ -642,10 +641,10 @@ UCSConvertCase( register unsigned code,
} }
void void
XConvertCase(sym, lower, upper) XConvertCase(
register KeySym sym; register KeySym sym,
KeySym *lower; KeySym *lower,
KeySym *upper; KeySym *upper)
{ {
/* Latin 1 keysym */ /* Latin 1 keysym */
if (sym < 0x100) { if (sym < 0x100) {
...@@ -817,14 +816,14 @@ _XTranslateKey( register Display *dpy, ...@@ -817,14 +816,14 @@ _XTranslateKey( register Display *dpy,
} }
int int
_XTranslateKeySym(dpy, symbol, modifiers, buffer, nbytes) _XTranslateKeySym(
Display *dpy; Display *dpy,
register KeySym symbol; register KeySym symbol,
unsigned int modifiers; unsigned int modifiers,
char *buffer; char *buffer,
int nbytes; int nbytes)
{ {
register struct _XKeytrans *p; register struct _XKeytrans *p;
int length; int length;
unsigned long hiBytes; unsigned long hiBytes;
register unsigned char c; register unsigned char c;
...@@ -874,15 +873,15 @@ _XTranslateKeySym(dpy, symbol, modifiers, buffer, nbytes) ...@@ -874,15 +873,15 @@ _XTranslateKeySym(dpy, symbol, modifiers, buffer, nbytes)
buffer[0] = c; buffer[0] = c;
return 1; return 1;
} }
/*ARGSUSED*/ /*ARGSUSED*/
int int
XLookupString (event, buffer, nbytes, keysym, status) XLookupString (
register XKeyEvent *event; register XKeyEvent *event,
char *buffer; /* buffer */ char *buffer, /* buffer */
int nbytes; /* space in buffer for characters */ int nbytes, /* space in buffer for characters */
KeySym *keysym; KeySym *keysym,
XComposeStatus *status; /* not implemented */ XComposeStatus *status) /* not implemented */
{ {
unsigned int modifiers; unsigned int modifiers;
KeySym symbol; KeySym symbol;
...@@ -902,7 +901,7 @@ XLookupString (event, buffer, nbytes, keysym, status) ...@@ -902,7 +901,7 @@ XLookupString (event, buffer, nbytes, keysym, status)
status->compose_ptr = NULL; status->compose_ptr = NULL;
status->chars_matched = 0; status->chars_matched = 0;
} }
if ( ((status->chars_matched>0)&&(status->compose_ptr!=NULL)) || if ( ((status->chars_matched>0)&&(status->compose_ptr!=NULL)) ||
XimCompIsComposeKey(symbol,event->keycode,status) ) { XimCompIsComposeKey(symbol,event->keycode,status) ) {
XimCompRtrn rtrn; XimCompRtrn rtrn;
switch (XimCompProcessSym(status,symbol,&rtrn)) { switch (XimCompProcessSym(status,symbol,&rtrn)) {
...@@ -976,7 +975,7 @@ _XFreeKeyBindings( ...@@ -976,7 +975,7 @@ _XFreeKeyBindings(
Xfree(p->string); Xfree(p->string);
Xfree((char *)p->modifiers); Xfree((char *)p->modifiers);
Xfree((char *)p); Xfree((char *)p);
} }
} }
int int
...@@ -998,7 +997,7 @@ XRebindKeysym ( ...@@ -998,7 +997,7 @@ XRebindKeysym (
nb = sizeof(KeySym) * nm; nb = sizeof(KeySym) * nm;
if ((! (p = (struct _XKeytrans *) Xmalloc( sizeof(struct _XKeytrans)))) || if ((! (p = (struct _XKeytrans *) Xmalloc( sizeof(struct _XKeytrans)))) ||
((! (p->string = (char *) Xmalloc( (unsigned) nbytes))) && ((! (p->string = (char *) Xmalloc( (unsigned) nbytes))) &&
(nbytes > 0)) || (nbytes > 0)) ||
((! (p->modifiers = (KeySym *) Xmalloc( (unsigned) nb))) && ((! (p->modifiers = (KeySym *) Xmalloc( (unsigned) nb))) &&
(nb > 0))) { (nb > 0))) {
...@@ -1036,7 +1035,7 @@ _XKeysymToModifiers( ...@@ -1036,7 +1035,7 @@ _XKeysymToModifiers(
if ((! dpy->keysyms) && (! _XKeyInitialize(dpy))) if ((! dpy->keysyms) && (! _XKeyInitialize(dpy)))
return 0; return 0;
kmax = dpy->keysyms + kmax = dpy->keysyms +
(dpy->max_keycode - dpy->min_keycode + 1) * dpy->keysyms_per_keycode; (dpy->max_keycode - dpy->min_keycode + 1) * dpy->keysyms_per_keycode;
k = dpy->keysyms; k = dpy->keysyms;
m = dpy->modifiermap; m = dpy->modifiermap;
...@@ -1056,7 +1055,7 @@ _XKeysymToModifiers( ...@@ -1056,7 +1055,7 @@ _XKeysymToModifiers(
} }
return mods; return mods;
} }
/* /*
* given a list of modifiers, computes the mask necessary for later matching. * given a list of modifiers, computes the mask necessary for later matching.
* This routine must lookup the key in the Keymap and then search to see * This routine must lookup the key in the Keymap and then search to see
......
...@@ -69,8 +69,7 @@ SameValue( ...@@ -69,8 +69,7 @@ SameValue(
return False; return False;
} }
char *XKeysymToString(ks) char *XKeysymToString(KeySym ks)
KeySym ks;
{ {
register int i, n; register int i, n;
int h; int h;
...@@ -146,7 +145,7 @@ char *XKeysymToString(ks) ...@@ -146,7 +145,7 @@ char *XKeysymToString(ks)
s[i] = 'A'+ val1 - 10; s[i] = 'A'+ val1 - 10;
} }
s[i] = 'U'; s[i] = 'U';
return s; return s;
} }
return ((char *) NULL); return ((char *) NULL);
} }
...@@ -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
XKillClient(dpy, resource) XKillClient(
register Display *dpy; register Display *dpy,
XID resource; XID resource)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
/* /*
Copyright 1986, 1998 The Open Group Copyright 1986, 1998 The Open Group
Copyright 2004 Sun Microsystems, Inc.
All rights reserved. All rights reserved.
...@@ -34,8 +33,32 @@ X Window System is a trademark of The Open Group. ...@@ -34,8 +33,32 @@ X Window System is a trademark of The Open Group.
*/ */
/*
* Copyright 2004 Sun Microsystems, Inc. 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.
*/
/* This can really be considered an os dependent routine */ /* This can really be considered an os dependent routine */
#define NEED_REPLIES
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
...@@ -49,7 +72,7 @@ XHostAddress *XListHosts ( ...@@ -49,7 +72,7 @@ XHostAddress *XListHosts (
int *nhosts, /* RETURN */ int *nhosts, /* RETURN */
Bool *enabled) /* RETURN */ Bool *enabled) /* RETURN */
{ {
register XHostAddress *outbuf = 0, *op; register XHostAddress *outbuf = NULL, *op;
xListHostsReply reply; xListHostsReply reply;
long nbytes; long nbytes;
unsigned char *buf, *bp; unsigned char *buf, *bp;
...@@ -69,31 +92,32 @@ XHostAddress *XListHosts ( ...@@ -69,31 +92,32 @@ XHostAddress *XListHosts (
if (reply.nHosts) { if (reply.nHosts) {
nbytes = reply.length << 2; /* compute number of bytes in reply */ nbytes = reply.length << 2; /* compute number of bytes in reply */
op = outbuf = (XHostAddress *) op = outbuf = (XHostAddress *)
Xmalloc((unsigned) (nbytes + Xmalloc((unsigned) (nbytes +
(reply.nHosts * sizeof(XHostAddress)) + (reply.nHosts * sizeof(XHostAddress)) +
(reply.nHosts * sizeof(XServerInterpretedAddress)))); (reply.nHosts * sizeof(XServerInterpretedAddress))));
if (! outbuf) { if (! outbuf) {
_XEatData(dpy, (unsigned long) nbytes); _XEatData(dpy, (unsigned long) nbytes);
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return (XHostAddress *) NULL; return (XHostAddress *) NULL;
} }
sip = (XServerInterpretedAddress *) sip = (XServerInterpretedAddress *)
(((unsigned char *) outbuf) + (reply.nHosts * sizeof(XHostAddress))); (((unsigned char *) outbuf) + (reply.nHosts * sizeof(XHostAddress)));
bp = buf = ((unsigned char *) sip) bp = buf = ((unsigned char *) sip)
+ (reply.nHosts * sizeof(XServerInterpretedAddress)); + (reply.nHosts * sizeof(XServerInterpretedAddress));
_XRead (dpy, (char *) buf, nbytes); _XRead (dpy, (char *) buf, nbytes);
for (i = 0; i < reply.nHosts; i++) { for (i = 0; i < reply.nHosts; i++) {
op->family = ((xHostEntry *) bp)->family; op->family = ((xHostEntry *) bp)->family;
op->length =((xHostEntry *) bp)->length; op->length =((xHostEntry *) bp)->length;
if (op->family == FamilyServerInterpreted) { if (op->family == FamilyServerInterpreted) {
char *tp = (char *) (bp + SIZEOF(xHostEntry)); char *tp = (char *) (bp + SIZEOF(xHostEntry));
char *vp = memchr(tp, 0, op->length); char *vp = memchr(tp, 0, op->length);
if (vp != NULL) { if (vp != NULL) {
sip->type = tp; sip->type = tp;
sip->typelength = vp - tp; sip->typelength = vp - tp;
...@@ -121,6 +145,5 @@ XHostAddress *XListHosts ( ...@@ -121,6 +145,5 @@ XHostAddress *XListHosts (
} }
...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Colormap *XListInstalledColormaps(dpy, win, n) Colormap *XListInstalledColormaps(
register Display *dpy; register Display *dpy,
Window win; Window win,
int *n; /* RETURN */ int *n) /* RETURN */
{ {
long nbytes; long nbytes;
Colormap *cmaps; Colormap *cmaps;
...@@ -62,7 +62,7 @@ int *n; /* RETURN */ ...@@ -62,7 +62,7 @@ int *n; /* RETURN */
_XRead32 (dpy, (long *) cmaps, nbytes); _XRead32 (dpy, (long *) cmaps, nbytes);
} }
else cmaps = (Colormap *) NULL; else cmaps = (Colormap *) NULL;
*n = rep.nColormaps; *n = rep.nColormaps;
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
......
...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,10 +29,10 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Atom *XListProperties(dpy, window, n_props) Atom *XListProperties(
register Display *dpy; register Display *dpy,
Window window; Window window,
int *n_props; /* RETURN */ int *n_props) /* RETURN */
{ {
long nbytes; long nbytes;
xListPropertiesReply rep; xListPropertiesReply rep;
......
...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,9 +29,9 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
char **XListExtensions(dpy, nextensions) char **XListExtensions(
register Display *dpy; register Display *dpy,
int *nextensions; /* RETURN */ int *nextensions) /* RETURN */
{ {
xListExtensionsReply rep; xListExtensionsReply rep;
char **list; char **list;
...@@ -87,8 +87,7 @@ int *nextensions; /* RETURN */ ...@@ -87,8 +87,7 @@ int *nextensions; /* RETURN */
} }
int int
XFreeExtensionList (list) XFreeExtensionList (char **list)
char **list;
{ {
if (list != NULL) { if (list != NULL) {
Xfree (list[0]-1); Xfree (list[0]-1);
......
/* /*
Copyright 1993, 1998 The Open Group Copyright 1993, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its Permission to use, copy, modify, distribute, and sell this software and its
...@@ -24,7 +24,6 @@ used in advertising or otherwise to promote the sale, use or other dealings ...@@ -24,7 +24,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$ */
/* /*
* Author: Stephen Gildea, MIT X Consortium * Author: Stephen Gildea, MIT X Consortium
......
...@@ -46,6 +46,7 @@ XLookupColor ( ...@@ -46,6 +46,7 @@ XLookupColor (
XcmsCCC ccc; XcmsCCC ccc;
XcmsColor cmsColor_exact; XcmsColor cmsColor_exact;
#ifdef XCMS
/* /*
* Let's Attempt to use Xcms and i18n approach to Parse Color * Let's Attempt to use Xcms and i18n approach to Parse Color
*/ */
...@@ -70,6 +71,7 @@ XLookupColor ( ...@@ -70,6 +71,7 @@ XLookupColor (
break; break;
} }
} }
#endif
/* /*
* Xcms and i18n methods failed, so lets pass it to the server * Xcms and i18n methods failed, so lets pass it to the server
......
...@@ -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
XLowerWindow(dpy, w) XLowerWindow(
Display *dpy; Display *dpy,
Window w; Window w)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
unsigned long val = Below; /* needed for macro */ unsigned long val = Below; /* needed for macro */
......
...@@ -37,151 +37,182 @@ in this Software without prior written authorization from The Open Group. ...@@ -37,151 +37,182 @@ in this Software without prior written authorization from The Open Group.
* need them. * need them.
*/ */
int XConnectionNumber(dpy) Display *dpy; { return (ConnectionNumber(dpy)); } int XConnectionNumber(Display *dpy) { return (ConnectionNumber(dpy)); }
Window XRootWindow (dpy, scr) Window XRootWindow (Display *dpy, int scr)
Display *dpy; int scr; {
{ return (RootWindow(dpy,scr)); } return (RootWindow(dpy,scr));
}
int XDefaultScreen(dpy) Display *dpy; { return (DefaultScreen(dpy)); } int XDefaultScreen(Display *dpy) { return (DefaultScreen(dpy)); }
Window XDefaultRootWindow (dpy) Window XDefaultRootWindow (Display *dpy)
Display *dpy; {
{ return (RootWindow(dpy,DefaultScreen(dpy))); } return (RootWindow(dpy,DefaultScreen(dpy)));
}
Visual *XDefaultVisual(dpy, scr) Visual *XDefaultVisual(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DefaultVisual(dpy, scr)); } return (DefaultVisual(dpy, scr));
}
GC XDefaultGC(dpy, scr) GC XDefaultGC(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DefaultGC(dpy,scr)); } return (DefaultGC(dpy,scr));
}
unsigned long XBlackPixel(dpy, scr) unsigned long XBlackPixel(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (BlackPixel(dpy, scr)); } return (BlackPixel(dpy, scr));
}
unsigned long XWhitePixel(dpy, scr) unsigned long XWhitePixel(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (WhitePixel(dpy,scr)); } return (WhitePixel(dpy,scr));
}
unsigned long XAllPlanes() { return AllPlanes; } unsigned long XAllPlanes(void) { return AllPlanes; }
int XQLength(dpy) Display *dpy; { return (QLength(dpy)); } int XQLength(Display *dpy) { return (QLength(dpy)); }
int XDisplayWidth(dpy, scr) int XDisplayWidth(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayWidth(dpy,scr)); } return (DisplayWidth(dpy,scr));
}
int XDisplayHeight(dpy, scr) int XDisplayHeight(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayHeight(dpy, scr)); } return (DisplayHeight(dpy, scr));
}
int XDisplayWidthMM(dpy, scr) int XDisplayWidthMM(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayWidthMM(dpy, scr)); } return (DisplayWidthMM(dpy, scr));
}
int XDisplayHeightMM(dpy, scr) int XDisplayHeightMM(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayHeightMM(dpy, scr)); } return (DisplayHeightMM(dpy, scr));
}
int XDisplayPlanes(dpy, scr) int XDisplayPlanes(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayPlanes(dpy, scr)); } return (DisplayPlanes(dpy, scr));
}
int XDisplayCells(dpy, scr) int XDisplayCells(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DisplayCells (dpy, scr)); } return (DisplayCells (dpy, scr));
}
int XScreenCount(dpy) Display *dpy; { return (ScreenCount(dpy)); } int XScreenCount(Display *dpy) { return (ScreenCount(dpy)); }
char *XServerVendor(dpy) Display *dpy; { return (ServerVendor(dpy)); } char *XServerVendor(Display *dpy) { return (ServerVendor(dpy)); }
int XProtocolVersion(dpy) Display *dpy; { return (ProtocolVersion(dpy)); } int XProtocolVersion(Display *dpy) { return (ProtocolVersion(dpy)); }
int XProtocolRevision(dpy) Display *dpy; { return (ProtocolRevision(dpy));} int XProtocolRevision(Display *dpy) { return (ProtocolRevision(dpy));}
int XVendorRelease(dpy) Display *dpy; { return (VendorRelease(dpy)); } int XVendorRelease(Display *dpy) { return (VendorRelease(dpy)); }
char *XDisplayString(dpy) Display *dpy; { return (DisplayString(dpy)); } char *XDisplayString(Display *dpy) { return (DisplayString(dpy)); }
int XDefaultDepth(dpy, scr) int XDefaultDepth(Display *dpy, int scr)
Display *dpy; int scr; {
{ return(DefaultDepth(dpy, scr)); } return(DefaultDepth(dpy, scr));
}
Colormap XDefaultColormap(dpy, scr) Colormap XDefaultColormap(Display *dpy, int scr)
Display *dpy; int scr; {
{ return (DefaultColormap(dpy, scr)); } return (DefaultColormap(dpy, scr));
}
int XBitmapUnit(dpy) Display *dpy; { return (BitmapUnit(dpy)); } int XBitmapUnit(Display *dpy) { return (BitmapUnit(dpy)); }
int XBitmapBitOrder(dpy) Display *dpy; { return (BitmapBitOrder(dpy)); } int XBitmapBitOrder(Display *dpy) { return (BitmapBitOrder(dpy)); }
int XBitmapPad(dpy) Display *dpy; { return (BitmapPad(dpy)); } int XBitmapPad(Display *dpy) { return (BitmapPad(dpy)); }
int XImageByteOrder(dpy) Display *dpy; { return (ImageByteOrder(dpy)); } int XImageByteOrder(Display *dpy) { return (ImageByteOrder(dpy)); }
unsigned long XNextRequest(dpy) unsigned long XNextRequest(Display *dpy)
Display *dpy; {
{ return (NextRequest(dpy));
return (NextRequest(dpy)); }
}
unsigned long XLastKnownRequestProcessed(dpy) unsigned long XLastKnownRequestProcessed(Display *dpy)
Display *dpy; {
{ return (LastKnownRequestProcessed(dpy)); } return (LastKnownRequestProcessed(dpy));
}
/* screen oriented macros (toolkit) */ /* screen oriented macros (toolkit) */
Screen *XScreenOfDisplay(dpy, scr) Display *dpy; int scr; Screen *XScreenOfDisplay(Display *dpy, int scr)
{ return (ScreenOfDisplay(dpy, scr)); } {
return (ScreenOfDisplay(dpy, scr));
}
Screen *XDefaultScreenOfDisplay(dpy) Display *dpy; Screen *XDefaultScreenOfDisplay(Display *dpy)
{ return (DefaultScreenOfDisplay(dpy)); } {
return (DefaultScreenOfDisplay(dpy));
}
Display *XDisplayOfScreen(s) Screen *s; { return (DisplayOfScreen(s)); } Display *XDisplayOfScreen(Screen *s) { return (DisplayOfScreen(s)); }
Window XRootWindowOfScreen(s) Screen *s; { return (RootWindowOfScreen(s)); } Window XRootWindowOfScreen(Screen *s) { return (RootWindowOfScreen(s)); }
unsigned long XBlackPixelOfScreen(s) Screen *s; unsigned long XBlackPixelOfScreen(Screen *s)
{ return (BlackPixelOfScreen(s)); } {
return (BlackPixelOfScreen(s));
}
unsigned long XWhitePixelOfScreen(s) Screen *s; unsigned long XWhitePixelOfScreen(Screen *s)
{ return (WhitePixelOfScreen(s)); } {
return (WhitePixelOfScreen(s));
}
Colormap XDefaultColormapOfScreen(s) Screen *s; Colormap XDefaultColormapOfScreen(Screen *s)
{ return (DefaultColormapOfScreen(s)); } {
return (DefaultColormapOfScreen(s));
}
int XDefaultDepthOfScreen(s) Screen *s; { return (DefaultDepthOfScreen(s)); } int XDefaultDepthOfScreen(Screen *s)
{
return (DefaultDepthOfScreen(s));
}
GC XDefaultGCOfScreen(s) Screen *s; { return (DefaultGCOfScreen(s)); } GC XDefaultGCOfScreen(Screen *s)
{
return (DefaultGCOfScreen(s));
}
Visual *XDefaultVisualOfScreen(s) Screen *s; Visual *XDefaultVisualOfScreen(Screen *s)
{ return (DefaultVisualOfScreen(s)); } {
return (DefaultVisualOfScreen(s));
}
int XWidthOfScreen(s) Screen *s; { return (WidthOfScreen(s)); } int XWidthOfScreen(Screen *s) { return (WidthOfScreen(s)); }
int XHeightOfScreen(s) Screen *s; { return (HeightOfScreen(s)); } int XHeightOfScreen(Screen *s) { return (HeightOfScreen(s)); }
int XWidthMMOfScreen(s) Screen *s; { return (WidthMMOfScreen(s)); } int XWidthMMOfScreen(Screen *s) { return (WidthMMOfScreen(s)); }
int XHeightMMOfScreen(s) Screen *s; { return (HeightMMOfScreen(s)); } int XHeightMMOfScreen(Screen *s) { return (HeightMMOfScreen(s)); }
int XPlanesOfScreen(s) Screen *s; { return (PlanesOfScreen(s)); } int XPlanesOfScreen(Screen *s) { return (PlanesOfScreen(s)); }
int XCellsOfScreen(s) Screen *s; { return (CellsOfScreen(s)); } int XCellsOfScreen(Screen *s) { return (CellsOfScreen(s)); }
int XMinCmapsOfScreen(s) Screen *s; { return (MinCmapsOfScreen(s)); } int XMinCmapsOfScreen(Screen *s) { return (MinCmapsOfScreen(s)); }
int XMaxCmapsOfScreen(s) Screen *s; { return (MaxCmapsOfScreen(s)); } int XMaxCmapsOfScreen(Screen *s) { return (MaxCmapsOfScreen(s)); }
Bool XDoesSaveUnders(s) Screen *s; { return (DoesSaveUnders(s)); } Bool XDoesSaveUnders(Screen *s) { return (DoesSaveUnders(s)); }
int XDoesBackingStore(s) Screen *s; { return (DoesBackingStore(s)); } int XDoesBackingStore(Screen *s) { return (DoesBackingStore(s)); }
long XEventMaskOfScreen(s) Screen *s; { return (EventMaskOfScreen(s)); } long XEventMaskOfScreen(Screen *s) { return (EventMaskOfScreen(s)); }
int XScreenNumberOfScreen (scr) int XScreenNumberOfScreen (register Screen *scr)
register Screen *scr;
{ {
register Display *dpy = scr->display; register Display *dpy = scr->display;
register Screen *dpyscr = dpy->screens; register Screen *dpyscr = dpy->screens;
...@@ -238,8 +269,7 @@ int XAddPixel( ...@@ -238,8 +269,7 @@ int XAddPixel(
int int
XNoOp (dpy) XNoOp (register Display *dpy)
register Display *dpy;
{ {
register xReq *req; register xReq *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
XMapRaised (dpy, w) XMapRaised (
Window w; register Display *dpy,
register Display *dpy; Window w)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
register xResourceReq *req2; register xResourceReq *req2;
......
...@@ -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
XMapSubwindows(dpy, win) XMapSubwindows(
register Display *dpy; register Display *dpy,
Window win; Window win)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -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
XMapWindow (dpy, w) XMapWindow (
Window w; register Display *dpy,
register Display *dpy; Window w)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay (dpy); LockDisplay (dpy);
......
...@@ -29,42 +29,38 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,42 +29,38 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
long XMaxRequestSize(dpy) long XMaxRequestSize(Display *dpy)
Display *dpy;
{ {
return dpy->max_request_size; return dpy->max_request_size;
} }
char *XResourceManagerString(dpy) char *XResourceManagerString(Display *dpy)
Display *dpy;
{ {
return dpy->xdefaults; return dpy->xdefaults;
} }
unsigned long XDisplayMotionBufferSize(dpy) unsigned long XDisplayMotionBufferSize(Display *dpy)
Display *dpy;
{ {
return dpy->motion_buffer; return dpy->motion_buffer;
} }
int int
XDisplayKeycodes(dpy, min_keycode_return, max_keycode_return) XDisplayKeycodes(
Display *dpy; Display *dpy,
int *min_keycode_return, *max_keycode_return; int *min_keycode_return,
int *max_keycode_return)
{ {
*min_keycode_return = dpy->min_keycode; *min_keycode_return = dpy->min_keycode;
*max_keycode_return = dpy->max_keycode; *max_keycode_return = dpy->max_keycode;
return 1; return 1;
} }
VisualID XVisualIDFromVisual(visual) VisualID XVisualIDFromVisual(Visual *visual)
Visual *visual;
{ {
return visual->visualid; return visual->visualid;
} }
long XExtendedMaxRequestSize(dpy) long XExtendedMaxRequestSize(Display *dpy)
Display *dpy;
{ {
return dpy->bigreq_size; return dpy->bigreq_size;
} }
...@@ -30,9 +30,8 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,8 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
XModifierKeymap * XModifierKeymap *
XGetModifierMapping(dpy) XGetModifierMapping(register Display *dpy)
register Display *dpy; {
{
xGetModifierMappingReply rep; xGetModifierMappingReply rep;
register xReq *req; register xReq *req;
unsigned long nbytes; unsigned long nbytes;
...@@ -66,9 +65,9 @@ XGetModifierMapping(dpy) ...@@ -66,9 +65,9 @@ XGetModifierMapping(dpy)
* 2 Failed - one or more new modifiers unacceptable * 2 Failed - one or more new modifiers unacceptable
*/ */
int int
XSetModifierMapping(dpy, modifier_map) XSetModifierMapping(
register Display *dpy; register Display *dpy,
register XModifierKeymap *modifier_map; register XModifierKeymap *modifier_map)
{ {
register xSetModifierMappingReq *req; register xSetModifierMappingReq *req;
xSetModifierMappingReply rep; xSetModifierMappingReply rep;
...@@ -91,8 +90,7 @@ XSetModifierMapping(dpy, modifier_map) ...@@ -91,8 +90,7 @@ XSetModifierMapping(dpy, modifier_map)
} }
XModifierKeymap * XModifierKeymap *
XNewModifiermap(keyspermodifier) XNewModifiermap(int keyspermodifier)
int keyspermodifier;
{ {
XModifierKeymap *res = (XModifierKeymap *) Xmalloc((sizeof (XModifierKeymap))); XModifierKeymap *res = (XModifierKeymap *) Xmalloc((sizeof (XModifierKeymap)));
if (res) { if (res) {
...@@ -110,8 +108,7 @@ XNewModifiermap(keyspermodifier) ...@@ -110,8 +108,7 @@ XNewModifiermap(keyspermodifier)
int int
XFreeModifiermap(map) XFreeModifiermap(XModifierKeymap *map)
XModifierKeymap *map;
{ {
if (map) { if (map) {
if (map->modifiermap) if (map->modifiermap)
...@@ -143,7 +140,7 @@ XInsertModifiermapEntry(XModifierKeymap *map, ...@@ -143,7 +140,7 @@ XInsertModifiermapEntry(XModifierKeymap *map,
map->modifiermap[ row+i ] = keycode; map->modifiermap[ row+i ] = keycode;
return(map); /* we added it without stretching the map */ return(map); /* we added it without stretching the map */
} }
} }
/* stretch the map */ /* stretch the map */
if ((newmap = XNewModifiermap(map->max_keypermod+1)) == NULL) if ((newmap = XNewModifiermap(map->max_keypermod+1)) == NULL)
......
...@@ -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
XMoveWindow (dpy, w, x, y) XMoveWindow (
register Display *dpy; register Display *dpy,
Window w; Window w,
int x, y; int x,
int y)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
......
...@@ -61,8 +61,7 @@ XCreateOC(XOM om, ...) ...@@ -61,8 +61,7 @@ XCreateOC(XOM om, ...)
} }
void void
XDestroyOC(oc) XDestroyOC(XOC oc)
XOC oc;
{ {
XOC prev, oc_list; XOC prev, oc_list;
...@@ -83,8 +82,7 @@ XDestroyOC(oc) ...@@ -83,8 +82,7 @@ XDestroyOC(oc)
} }
XOM XOM
XOMOfOC(oc) XOMOfOC(XOC oc)
XOC oc;
{ {
return oc->core.om; return oc->core.om;
} }
......
...@@ -45,8 +45,7 @@ XOpenOM(Display *dpy, XrmDatabase rdb, _Xconst char *res_name, ...@@ -45,8 +45,7 @@ XOpenOM(Display *dpy, XrmDatabase rdb, _Xconst char *res_name,
} }
Status Status
XCloseOM(om) XCloseOM(XOM om)
XOM om;
{ {
XOC oc, next; XOC oc, next;
XLCd lcd = om->core.lcd; XLCd lcd = om->core.lcd;
...@@ -109,7 +108,7 @@ XGetOMValues(XOM om, ...) ...@@ -109,7 +108,7 @@ XGetOMValues(XOM om, ...)
if (args == (XlcArgList) NULL) if (args == (XlcArgList) NULL)
return (char *) NULL; return (char *) NULL;
ret = (*om->methods->get_values)(om, args, num_args); ret = (*om->methods->get_values)(om, args, num_args);
Xfree(args); Xfree(args);
...@@ -118,15 +117,13 @@ XGetOMValues(XOM om, ...) ...@@ -118,15 +117,13 @@ XGetOMValues(XOM om, ...)
} }
Display * Display *
XDisplayOfOM(om) XDisplayOfOM(XOM om)
XOM om;
{ {
return om->core.display; return om->core.display;
} }
char * char *
XLocaleOfOM(om) XLocaleOfOM(XOM om)
XOM om;
{ {
return om->core.lcd->core->name; return om->core.lcd->core->name;
} }
...@@ -28,13 +28,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,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
...@@ -63,7 +63,7 @@ SOFTWARE. ...@@ -63,7 +63,7 @@ SOFTWARE.
#include <stdio.h> #include <stdio.h>
static void _XReportParseError(XrmOptionDescRec *arg, char *msg) static void _XReportParseError(XrmOptionDescRec *arg, const char *msg)
{ {
(void) fprintf(stderr, "Error parsing argument \"%s\" (%s); %s\n", (void) fprintf(stderr, "Error parsing argument \"%s\" (%s); %s\n",
arg->option, arg->specifier, msg); arg->option, arg->specifier, msg);
...@@ -98,7 +98,7 @@ XrmParseCommand( ...@@ -98,7 +98,7 @@ XrmParseCommand(
XrmQPutStringResource(pdb, bindings, quarks, value_str); \ XrmQPutStringResource(pdb, bindings, quarks, value_str); \
} /* PutCommandResource */ } /* PutCommandResource */
myargc = (*argc); myargc = (*argc);
argend = argv + myargc; argend = argv + myargc;
argsave = ++argv; argsave = ++argv;
...@@ -157,7 +157,7 @@ XrmParseCommand( ...@@ -157,7 +157,7 @@ XrmParseCommand(
--(*argc); --(*argc);
PutCommandResource(options[i].value); PutCommandResource(options[i].value);
break; break;
case XrmoptionIsArg: case XrmoptionIsArg:
--(*argc); --(*argc);
PutCommandResource(*argv); PutCommandResource(*argv);
...@@ -175,7 +175,7 @@ XrmParseCommand( ...@@ -175,7 +175,7 @@ XrmParseCommand(
} else } else
(*argsave++) = (*argv); (*argsave++) = (*argv);
break; break;
case XrmoptionResArg: case XrmoptionResArg:
if (myargc > 1) { if (myargc > 1) {
++argv; --myargc; --(*argc); --(*argc); ++argv; --myargc; --(*argc); --(*argc);
...@@ -183,13 +183,13 @@ XrmParseCommand( ...@@ -183,13 +183,13 @@ XrmParseCommand(
} else } else
(*argsave++) = (*argv); (*argsave++) = (*argv);
break; break;
case XrmoptionSkipArg: case XrmoptionSkipArg:
if (myargc > 1) { if (myargc > 1) {
--myargc; --myargc;
(*argsave++) = (*argv++); (*argsave++) = (*argv++);
} }
(*argsave++) = (*argv); (*argsave++) = (*argv);
break; break;
case XrmoptionSkipLine: case XrmoptionSkipLine:
...@@ -217,7 +217,7 @@ XrmParseCommand( ...@@ -217,7 +217,7 @@ XrmParseCommand(
} }
} }
else else
(*argsave++) = (*argv); /*compress arglist*/ (*argsave++) = (*argv); /*compress arglist*/
} }
if (argsave < argend) if (argsave < argend)
......
...@@ -83,6 +83,7 @@ XParseColor ( ...@@ -83,6 +83,7 @@ XParseColor (
} }
#ifdef XCMS
/* /*
* Let's Attempt to use Xcms and i18n approach to Parse Color * Let's Attempt to use Xcms and i18n approach to Parse Color
*/ */
...@@ -106,6 +107,7 @@ XParseColor ( ...@@ -106,6 +107,7 @@ XParseColor (
break; break;
} }
} }
#endif
/* /*
* Xcms and i18n methods failed, so lets pass it to the server * Xcms and i18n methods failed, so lets pass it to the server
......
...@@ -33,24 +33,6 @@ from The Open Group. ...@@ -33,24 +33,6 @@ from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
#include "Xutil.h" #include "Xutil.h"
#ifdef notdef
/*
*Returns pointer to first char ins search which is also in what, else NULL.
*/
static char *strscan (search, what)
char *search, *what;
{
int i, len = strlen (what);
char c;
while ((c = *(search++)) != NULL)
for (i = 0; i < len; i++)
if (c == what [i])
return (--search);
return (NULL);
}
#endif
/* /*
* XParseGeometry parses strings of the form * XParseGeometry parses strings of the form
* "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
...@@ -60,7 +42,7 @@ char *search, *what; ...@@ -60,7 +42,7 @@ char *search, *what;
* It returns a bitmask that indicates which of the four values * It returns a bitmask that indicates which of the four values
* were actually found in the string. For each value found, * were actually found in the string. For each value found,
* the corresponding argument is updated; for each value * the corresponding argument is updated; for each value
* not found, the corresponding argument is left unchanged. * not found, the corresponding argument is left unchanged.
*/ */
static int static int
...@@ -68,7 +50,7 @@ ReadInteger(char *string, char **NextString) ...@@ -68,7 +50,7 @@ ReadInteger(char *string, char **NextString)
{ {
register int Result = 0; register int Result = 0;
int Sign = 1; int Sign = 1;
if (*string == '+') if (*string == '+')
string++; string++;
else if (*string == '-') else if (*string == '-')
...@@ -108,13 +90,13 @@ unsigned int *height) /* RETURN */ ...@@ -108,13 +90,13 @@ unsigned int *height) /* RETURN */
strind = (char *)string; strind = (char *)string;
if (*strind != '+' && *strind != '-' && *strind != 'x') { if (*strind != '+' && *strind != '-' && *strind != 'x') {
tempWidth = ReadInteger(strind, &nextCharacter); tempWidth = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter) if (strind == nextCharacter)
return (0); return (0);
strind = nextCharacter; strind = nextCharacter;
mask |= WidthValue; mask |= WidthValue;
} }
if (*strind == 'x' || *strind == 'X') { if (*strind == 'x' || *strind == 'X') {
strind++; strind++;
tempHeight = ReadInteger(strind, &nextCharacter); tempHeight = ReadInteger(strind, &nextCharacter);
if (strind == nextCharacter) if (strind == nextCharacter)
...@@ -162,7 +144,7 @@ unsigned int *height) /* RETURN */ ...@@ -162,7 +144,7 @@ unsigned int *height) /* RETURN */
mask |= YValue; mask |= YValue;
} }
} }
/* If strind isn't at the end of the string the it's an invalid /* If strind isn't at the end of the string the it's an invalid
geometry specification. */ geometry specification. */
......
...@@ -34,9 +34,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,9 +34,9 @@ in this Software without prior written authorization from The Open Group.
* XListPixmapFormats - return info from connection setup * XListPixmapFormats - return info from connection setup
*/ */
XPixmapFormatValues *XListPixmapFormats (dpy, count) XPixmapFormatValues *XListPixmapFormats (
Display *dpy; Display *dpy,
int *count; /* RETURN */ int *count) /* RETURN */
{ {
XPixmapFormatValues *formats = (XPixmapFormatValues *) XPixmapFormatValues *formats = (XPixmapFormatValues *)
Xmalloc((unsigned) (dpy->nformats * sizeof (XPixmapFormatValues))); Xmalloc((unsigned) (dpy->nformats * sizeof (XPixmapFormatValues)));
......
...@@ -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
XSetWindowBackgroundPixmap(dpy, w, pixmap) XSetWindowBackgroundPixmap(
register Display *dpy; register Display *dpy,
Window w; Window w,
Pixmap pixmap; Pixmap pixmap)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
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
XSetWindowBorderPixmap(dpy, w, pixmap) XSetWindowBorderPixmap(
register Display *dpy; register Display *dpy,
Window w; Window w,
Pixmap pixmap; Pixmap pixmap)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -27,13 +27,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -27,13 +27,13 @@ Copyright 1987 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
...@@ -82,7 +82,7 @@ InsertEdgeInET( ...@@ -82,7 +82,7 @@ InsertEdgeInET(
*/ */
pPrevSLL = &ET->scanlines; pPrevSLL = &ET->scanlines;
pSLL = pPrevSLL->next; pSLL = pPrevSLL->next;
while (pSLL && (pSLL->scanline < scanline)) while (pSLL && (pSLL->scanline < scanline))
{ {
pPrevSLL = pSLL; pPrevSLL = pSLL;
pSLL = pSLL->next; pSLL = pSLL->next;
...@@ -91,11 +91,11 @@ InsertEdgeInET( ...@@ -91,11 +91,11 @@ InsertEdgeInET(
/* /*
* reassign pSLL (pointer to ScanLineList) if necessary * reassign pSLL (pointer to ScanLineList) if necessary
*/ */
if ((!pSLL) || (pSLL->scanline > scanline)) if ((!pSLL) || (pSLL->scanline > scanline))
{ {
if (*iSLLBlock > SLLSPERBLOCK-1) if (*iSLLBlock > SLLSPERBLOCK-1)
{ {
tmpSLLBlock = tmpSLLBlock =
(ScanLineListBlock *)Xmalloc(sizeof(ScanLineListBlock)); (ScanLineListBlock *)Xmalloc(sizeof(ScanLineListBlock));
(*SLLBlock)->next = tmpSLLBlock; (*SLLBlock)->next = tmpSLLBlock;
tmpSLLBlock->next = (ScanLineListBlock *)NULL; tmpSLLBlock->next = (ScanLineListBlock *)NULL;
...@@ -115,7 +115,7 @@ InsertEdgeInET( ...@@ -115,7 +115,7 @@ InsertEdgeInET(
*/ */
prev = (EdgeTableEntry *)NULL; prev = (EdgeTableEntry *)NULL;
start = pSLL->edgelist; start = pSLL->edgelist;
while (start && (start->bres.minor_axis < ETE->bres.minor_axis)) while (start && (start->bres.minor_axis < ETE->bres.minor_axis))
{ {
prev = start; prev = start;
start = start->next; start = start->next;
...@@ -132,7 +132,7 @@ InsertEdgeInET( ...@@ -132,7 +132,7 @@ InsertEdgeInET(
* CreateEdgeTable * CreateEdgeTable
* *
* This routine creates the edge table for * This routine creates the edge table for
* scan converting polygons. * scan converting polygons.
* The Edge Table (ET) looks like: * The Edge Table (ET) looks like:
* *
* EdgeTable * EdgeTable
...@@ -192,19 +192,19 @@ CreateETandAET( ...@@ -192,19 +192,19 @@ CreateETandAET(
* In this loop we are dealing with two vertices at * In this loop we are dealing with two vertices at
* a time -- these make up one edge of the polygon. * a time -- these make up one edge of the polygon.
*/ */
while (count--) while (count--)
{ {
CurrPt = pts++; CurrPt = pts++;
/* /*
* find out which point is above and which is below. * find out which point is above and which is below.
*/ */
if (PrevPt->y > CurrPt->y) if (PrevPt->y > CurrPt->y)
{ {
bottom = PrevPt, top = CurrPt; bottom = PrevPt, top = CurrPt;
pETEs->ClockWise = 0; pETEs->ClockWise = 0;
} }
else else
{ {
bottom = CurrPt, top = PrevPt; bottom = CurrPt, top = PrevPt;
pETEs->ClockWise = 1; pETEs->ClockWise = 1;
...@@ -213,7 +213,7 @@ CreateETandAET( ...@@ -213,7 +213,7 @@ CreateETandAET(
/* /*
* don't add horizontal edges to the Edge table. * don't add horizontal edges to the Edge table.
*/ */
if (bottom->y != top->y) if (bottom->y != top->y)
{ {
pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */ pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */
...@@ -255,9 +255,9 @@ loadAET( ...@@ -255,9 +255,9 @@ loadAET(
pPrevAET = AET; pPrevAET = AET;
AET = AET->next; AET = AET->next;
while (ETEs) while (ETEs)
{ {
while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis)) while (AET && (AET->bres.minor_axis < ETEs->bres.minor_axis))
{ {
pPrevAET = AET; pPrevAET = AET;
AET = AET->next; AET = AET->next;
...@@ -279,13 +279,13 @@ loadAET( ...@@ -279,13 +279,13 @@ loadAET(
* *
* This routine links the AET by the * This routine links the AET by the
* nextWETE (winding EdgeTableEntry) link for * nextWETE (winding EdgeTableEntry) link for
* use by the winding number rule. The final * use by the winding number rule. The final
* Active Edge Table (AET) might look something * Active Edge Table (AET) might look something
* like: * like:
* *
* AET * AET
* ---------- --------- --------- * ---------- --------- ---------
* |ymax | |ymax | |ymax | * |ymax | |ymax | |ymax |
* | ... | |... | |... | * | ... | |... | |... |
* |next |->|next |->|next |->... * |next |->|next |->|next |->...
* |nextWETE| |nextWETE| |nextWETE| * |nextWETE| |nextWETE| |nextWETE|
...@@ -305,7 +305,7 @@ computeWAET( ...@@ -305,7 +305,7 @@ computeWAET(
AET->nextWETE = (EdgeTableEntry *)NULL; AET->nextWETE = (EdgeTableEntry *)NULL;
pWETE = AET; pWETE = AET;
AET = AET->next; AET = AET->next;
while (AET) while (AET)
{ {
if (AET->ClockWise) if (AET->ClockWise)
isInside++; isInside++;
...@@ -313,7 +313,7 @@ computeWAET( ...@@ -313,7 +313,7 @@ computeWAET(
isInside--; isInside--;
if ((!inside && !isInside) || if ((!inside && !isInside) ||
( inside && isInside)) ( inside && isInside))
{ {
pWETE->nextWETE = AET; pWETE->nextWETE = AET;
pWETE = AET; pWETE = AET;
...@@ -343,7 +343,7 @@ InsertionSort( ...@@ -343,7 +343,7 @@ InsertionSort(
register int changed = 0; register int changed = 0;
AET = AET->next; AET = AET->next;
while (AET) while (AET)
{ {
pETEinsert = AET; pETEinsert = AET;
pETEchase = AET; pETEchase = AET;
...@@ -351,7 +351,7 @@ InsertionSort( ...@@ -351,7 +351,7 @@ InsertionSort(
pETEchase = pETEchase->back; pETEchase = pETEchase->back;
AET = AET->next; AET = AET->next;
if (pETEchase != pETEinsert) if (pETEchase != pETEinsert)
{ {
pETEchaseBackTMP = pETEchase->back; pETEchaseBackTMP = pETEchase->back;
pETEinsert->back->next = AET; pETEinsert->back->next = AET;
...@@ -376,7 +376,7 @@ FreeStorage( ...@@ -376,7 +376,7 @@ FreeStorage(
{ {
register ScanLineListBlock *tmpSLLBlock; register ScanLineListBlock *tmpSLLBlock;
while (pSLLBlock) while (pSLLBlock)
{ {
tmpSLLBlock = pSLLBlock->next; tmpSLLBlock = pSLLBlock->next;
Xfree((char *)pSLLBlock); Xfree((char *)pSLLBlock);
...@@ -407,21 +407,21 @@ static int PtsToRegion( ...@@ -407,21 +407,21 @@ static int PtsToRegion(
BOX *prevRects = reg->rects; BOX *prevRects = reg->rects;
extents = &reg->extents; extents = &reg->extents;
numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1; numRects = ((numFullPtBlocks * NUMPTSTOBUFFER) + iCurPtBlock) >> 1;
if (!(reg->rects = (BOX *)Xrealloc((char *)reg->rects, if (!(reg->rects = (BOX *)Xrealloc((char *)reg->rects,
(unsigned) (sizeof(BOX) * numRects)))) { (unsigned) (sizeof(BOX) * numRects)))) {
Xfree(prevRects); Xfree(prevRects);
return(0); return(0);
} }
reg->size = numRects; reg->size = numRects;
CurPtBlock = FirstPtBlock; CurPtBlock = FirstPtBlock;
rects = reg->rects - 1; rects = reg->rects - 1;
numRects = 0; numRects = 0;
extents->x1 = MAXSHORT, extents->x2 = MINSHORT; extents->x1 = MAXSHORT, extents->x2 = MINSHORT;
for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) { for ( ; numFullPtBlocks >= 0; numFullPtBlocks--) {
/* the loop uses 2 points per iteration */ /* the loop uses 2 points per iteration */
i = NUMPTSTOBUFFER >> 1; i = NUMPTSTOBUFFER >> 1;
...@@ -459,7 +459,7 @@ static int PtsToRegion( ...@@ -459,7 +459,7 @@ static int PtsToRegion(
extents->y2 = 0; extents->y2 = 0;
} }
reg->numRects = numRects; reg->numRects = numRects;
return(TRUE); return(TRUE);
} }
...@@ -470,11 +470,11 @@ static int PtsToRegion( ...@@ -470,11 +470,11 @@ static int PtsToRegion(
* encoding of the resultant bitmap -- the run-length * encoding of the resultant bitmap -- the run-length
* encoding is in the form of an array of rectangles. * encoding is in the form of an array of rectangles.
*/ */
Region Region
XPolygonRegion(Pts, Count, rule) XPolygonRegion(
int Count; /* number of pts */ XPoint *Pts, /* the pts */
XPoint *Pts; /* the pts */ int Count, /* number of pts */
int rule; /* winding rule */ int rule) /* winding rule */
{ {
Region region; Region region;
register EdgeTableEntry *pAET; /* Active Edge Table */ register EdgeTableEntry *pAET; /* Active Edge Table */
...@@ -492,7 +492,7 @@ XPolygonRegion(Pts, Count, rule) ...@@ -492,7 +492,7 @@ XPolygonRegion(Pts, Count, rule)
POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */ POINTBLOCK FirstPtBlock, *curPtBlock; /* PtBlock buffers */
POINTBLOCK *tmpPtBlock; POINTBLOCK *tmpPtBlock;
int numFullPtBlocks = 0; int numFullPtBlocks = 0;
if (! (region = XCreateRegion())) return (Region) NULL; if (! (region = XCreateRegion())) return (Region) NULL;
/* special case a rectangle */ /* special case a rectangle */
...@@ -518,18 +518,20 @@ XPolygonRegion(Pts, Count, rule) ...@@ -518,18 +518,20 @@ XPolygonRegion(Pts, Count, rule)
} }
return(region); return(region);
} }
if (Count < 2) return region; if (Count < 2) return region;
if (! (pETEs = (EdgeTableEntry *) if (! (pETEs = (EdgeTableEntry *)
Xmalloc((unsigned) (sizeof(EdgeTableEntry) * Count)))) Xmalloc((unsigned) (sizeof(EdgeTableEntry) * Count)))) {
XDestroyRegion(region);
return (Region) NULL; return (Region) NULL;
}
pts = FirstPtBlock.pts; pts = FirstPtBlock.pts;
CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock); CreateETandAET(Count, Pts, &ET, &AET, pETEs, &SLLBlock);
pSLL = ET.scanlines.next; pSLL = ET.scanlines.next;
curPtBlock = &FirstPtBlock; curPtBlock = &FirstPtBlock;
if (rule == EvenOddRule) { if (rule == EvenOddRule) {
/* /*
* for each scanline * for each scanline
...@@ -545,14 +547,14 @@ XPolygonRegion(Pts, Count, rule) ...@@ -545,14 +547,14 @@ XPolygonRegion(Pts, Count, rule)
} }
pPrevAET = &AET; pPrevAET = &AET;
pAET = AET.next; pAET = AET.next;
/* /*
* for each active edge * for each active edge
*/ */
while (pAET) { while (pAET) {
pts->x = pAET->bres.minor_axis, pts->y = y; pts->x = pAET->bres.minor_axis, pts->y = y;
pts++, iPts++; pts++, iPts++;
/* /*
* send out the buffer * send out the buffer
*/ */
...@@ -586,7 +588,7 @@ XPolygonRegion(Pts, Count, rule) ...@@ -586,7 +588,7 @@ XPolygonRegion(Pts, Count, rule)
pPrevAET = &AET; pPrevAET = &AET;
pAET = AET.next; pAET = AET.next;
pWETE = pAET; pWETE = pAET;
/* /*
* for each active edge * for each active edge
*/ */
...@@ -598,7 +600,7 @@ XPolygonRegion(Pts, Count, rule) ...@@ -598,7 +600,7 @@ XPolygonRegion(Pts, Count, rule)
if (pWETE == pAET) { if (pWETE == pAET) {
pts->x = pAET->bres.minor_axis, pts->y = y; pts->x = pAET->bres.minor_axis, pts->y = y;
pts++, iPts++; pts++, iPts++;
/* /*
* send out the buffer * send out the buffer
*/ */
...@@ -613,7 +615,7 @@ XPolygonRegion(Pts, Count, rule) ...@@ -613,7 +615,7 @@ XPolygonRegion(Pts, Count, rule)
} }
EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET);
} }
/* /*
* recompute the winding active edge table if * recompute the winding active edge table if
* we just resorted or have exited an edge. * we just resorted or have exited an edge.
...@@ -624,7 +626,7 @@ XPolygonRegion(Pts, Count, rule) ...@@ -624,7 +626,7 @@ XPolygonRegion(Pts, Count, rule)
} }
} }
} }
FreeStorage(SLLBlock.next); FreeStorage(SLLBlock.next);
(void) PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region); (void) PtsToRegion(numFullPtBlocks, iPts, &FirstPtBlock, region);
for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) { for (curPtBlock = FirstPtBlock.next; --numFullPtBlocks >= 0;) {
tmpPtBlock = curPtBlock->next; tmpPtBlock = curPtBlock->next;
......
...@@ -30,14 +30,15 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,14 +30,15 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawText(dpy, d, gc, x, y, items, nitems) XDrawText(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; int x,
XTextItem *items; int y,
int nitems; XTextItem *items,
{ int nitems)
{
register int i; register int i;
register XTextItem *item; register XTextItem *item;
int length = 0; int length = 0;
...@@ -78,11 +79,11 @@ XDrawText(dpy, d, gc, x, y, items, nitems) ...@@ -78,11 +79,11 @@ XDrawText(dpy, d, gc, x, y, items, nitems)
req->length += (length + 3)>>2; /* convert to number of 32-bit words */ req->length += (length + 3)>>2; /* convert to number of 32-bit words */
/* /*
* If the entire request does not fit into the remaining space in the * If the entire request does not fit into the remaining space in the
* buffer, flush the buffer first. If the request does fit into the * buffer, flush the buffer first. If the request does fit into the
* empty buffer, then we won't have to flush it at the end to keep * empty buffer, then we won't have to flush it at the end to keep
* the buffer 32-bit aligned. * the buffer 32-bit aligned.
*/ */
if (dpy->bufptr + length > dpy->bufmax) if (dpy->bufptr + length > dpy->bufmax)
...@@ -120,9 +121,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems) ...@@ -120,9 +121,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems)
{ {
int nb = SIZEOF(xTextElt); int nb = SIZEOF(xTextElt);
BufAlloc (char *, tbuf, nb); BufAlloc (char *, tbuf, nb);
*tbuf = 0; /* elt->len */ *tbuf = 0; /* elt->len */
if (PartialDelta > 0 ) if (PartialDelta > 0 )
{ {
*(tbuf+1) = 127; /* elt->delta */ *(tbuf+1) = 127; /* elt->delta */
PartialDelta = PartialDelta - 127; PartialDelta = PartialDelta - 127;
...@@ -136,7 +137,7 @@ XDrawText(dpy, d, gc, x, y, items, nitems) ...@@ -136,7 +137,7 @@ XDrawText(dpy, d, gc, x, y, items, nitems)
} }
if (PartialDelta) if (PartialDelta)
{ {
BufAlloc (char *, tbuf , nbytes); BufAlloc (char *, tbuf , nbytes);
*tbuf = 0; /* elt->len */ *tbuf = 0; /* elt->len */
*(tbuf+1) = PartialDelta; /* elt->delta */ *(tbuf+1) = PartialDelta; /* elt->delta */
} }
...@@ -147,9 +148,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems) ...@@ -147,9 +148,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems)
{ {
FirstTimeThrough = False; FirstTimeThrough = False;
if (!item->delta) if (!item->delta)
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (char *, tbuf, nbytes); BufAlloc (char *, tbuf, nbytes);
*(tbuf+1) = 0; /* elt->delta */ *(tbuf+1) = 0; /* elt->delta */
} }
else else
...@@ -178,9 +179,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems) ...@@ -178,9 +179,9 @@ XDrawText(dpy, d, gc, x, y, items, nitems)
{ {
FirstTimeThrough = False; FirstTimeThrough = False;
if (!item->delta) if (!item->delta)
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (char *, tbuf, nbytes); BufAlloc (char *, tbuf, nbytes);
*(tbuf+1) = 0; /* elt->delta */ *(tbuf+1) = 0; /* elt->delta */
} }
else else
...@@ -192,7 +193,7 @@ XDrawText(dpy, d, gc, x, y, items, nitems) ...@@ -192,7 +193,7 @@ XDrawText(dpy, d, gc, x, y, items, nitems)
else else
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (char *, tbuf, nbytes); BufAlloc (char *, tbuf, nbytes);
*(tbuf+1) = 0; /* elt->delta */ *(tbuf+1) = 0; /* elt->delta */
} }
*tbuf = PartialNChars; /* elt->len */ *tbuf = PartialNChars; /* elt->len */
...@@ -206,23 +207,23 @@ XDrawText(dpy, d, gc, x, y, items, nitems) ...@@ -206,23 +207,23 @@ XDrawText(dpy, d, gc, x, y, items, nitems)
if (length &= 3) { if (length &= 3) {
char *pad; char *pad;
/* /*
* BufAlloc is a macro that uses its last argument more than * BufAlloc is a macro that uses its last argument more than
* once, otherwise I'd write "BufAlloc (char *, pad, 4-length)" * once, otherwise I'd write "BufAlloc (char *, pad, 4-length)"
*/ */
length = 4 - length; length = 4 - length;
BufAlloc (char *, pad, length); BufAlloc (char *, pad, length);
/* /*
* if there are 3 bytes of padding, the first byte MUST be 0 * if there are 3 bytes of padding, the first byte MUST be 0
* so the pad bytes aren't mistaken for a final xTextElt * so the pad bytes aren't mistaken for a final xTextElt
*/ */
*pad = 0; *pad = 0;
} }
/* /*
* If the buffer pointer is not now pointing to a 32-bit boundary, * If the buffer pointer is not now pointing to a 32-bit boundary,
* we must flush the buffer so that it does point to a 32-bit boundary * we must flush the buffer so that it does point to a 32-bit boundary
* at the end of this routine. * at the end of this routine.
*/ */
if ((dpy->bufptr - dpy->buffer) & 3) if ((dpy->bufptr - dpy->buffer) & 3)
......
...@@ -30,14 +30,15 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,14 +30,15 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XDrawText16(dpy, d, gc, x, y, items, nitems) XDrawText16(
register Display *dpy; register Display *dpy,
Drawable d; Drawable d,
GC gc; GC gc,
int x, y; int x,
XTextItem16 *items; int y,
int nitems; XTextItem16 *items,
{ int nitems)
{
register int i; register int i;
register XTextItem16 *item; register XTextItem16 *item;
int length = 0; int length = 0;
...@@ -82,7 +83,7 @@ XDrawText16(dpy, d, gc, x, y, items, nitems) ...@@ -82,7 +83,7 @@ XDrawText16(dpy, d, gc, x, y, items, nitems)
* If the entire request does not fit into the remaining space in the * If the entire request does not fit into the remaining space in the
* buffer, flush the buffer first. If the request does fit into the * buffer, flush the buffer first. If the request does fit into the
* empty buffer, then we won't have to flush it at the end to keep * empty buffer, then we won't have to flush it at the end to keep
* the buffer 32-bit aligned. * the buffer 32-bit aligned.
*/ */
if (dpy->bufptr + length > dpy->bufmax) if (dpy->bufptr + length > dpy->bufmax)
...@@ -119,9 +120,9 @@ XDrawText16(dpy, d, gc, x, y, items, nitems) ...@@ -119,9 +120,9 @@ XDrawText16(dpy, d, gc, x, y, items, nitems)
{ {
int nb = SIZEOF(xTextElt); int nb = SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nb); BufAlloc (xTextElt *, elt, nb);
elt->len = 0; elt->len = 0;
if (PartialDelta > 0 ) if (PartialDelta > 0 )
{ {
elt->delta = 127; elt->delta = 127;
PartialDelta = PartialDelta - 127; PartialDelta = PartialDelta - 127;
...@@ -134,7 +135,7 @@ XDrawText16(dpy, d, gc, x, y, items, nitems) ...@@ -134,7 +135,7 @@ XDrawText16(dpy, d, gc, x, y, items, nitems)
} }
if (PartialDelta) if (PartialDelta)
{ {
BufAlloc (xTextElt *, elt, nbytes); BufAlloc (xTextElt *, elt, nbytes);
elt->len = 0; elt->len = 0;
elt->delta = PartialDelta; elt->delta = PartialDelta;
} }
...@@ -145,9 +146,9 @@ XDrawText16(dpy, d, gc, x, y, items, nitems) ...@@ -145,9 +146,9 @@ XDrawText16(dpy, d, gc, x, y, items, nitems)
{ {
FirstTimeThrough = False; FirstTimeThrough = False;
if (!item->delta) if (!item->delta)
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nbytes); BufAlloc (xTextElt *, elt, nbytes);
elt->delta = 0; elt->delta = 0;
} }
else else
...@@ -179,9 +180,9 @@ XDrawText16(dpy, d, gc, x, y, items, nitems) ...@@ -179,9 +180,9 @@ XDrawText16(dpy, d, gc, x, y, items, nitems)
{ {
FirstTimeThrough = False; FirstTimeThrough = False;
if (!item->delta) if (!item->delta)
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nbytes); BufAlloc (xTextElt *, elt, nbytes);
elt->delta = 0; elt->delta = 0;
} }
else else
...@@ -196,7 +197,7 @@ XDrawText16(dpy, d, gc, x, y, items, nitems) ...@@ -196,7 +197,7 @@ XDrawText16(dpy, d, gc, x, y, items, nitems)
else else
{ {
nbytes += SIZEOF(xTextElt); nbytes += SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nbytes); BufAlloc (xTextElt *, elt, nbytes);
elt->delta = 0; elt->delta = 0;
} }
elt->len = PartialNChars; elt->len = PartialNChars;
...@@ -214,21 +215,21 @@ XDrawText16(dpy, d, gc, x, y, items, nitems) ...@@ -214,21 +215,21 @@ XDrawText16(dpy, d, gc, x, y, items, nitems)
char *pad; char *pad;
/* /*
* BufAlloc is a macro that uses its last argument more than * BufAlloc is a macro that uses its last argument more than
* once, otherwise I'd write "BufAlloc (char *, pad, 4-length)" * once, otherwise I'd write "BufAlloc (char *, pad, 4-length)"
*/ */
length = 4 - length; length = 4 - length;
BufAlloc (char *, pad, length); BufAlloc (char *, pad, length);
/* /*
* if there are 3 bytes of padding, the first byte MUST be 0 * if there are 3 bytes of padding, the first byte MUST be 0
* so the pad bytes aren't mistaken for a final xTextElt * so the pad bytes aren't mistaken for a final xTextElt
*/ */
*pad = 0; *pad = 0;
} }
/* /*
* If the buffer pointer is not now pointing to a 32-bit boundary, * If the buffer pointer is not now pointing to a 32-bit boundary,
* we must flush the buffer so that it does point to a 32-bit boundary * we must flush the buffer so that it does point to a 32-bit boundary
* at the end of this routine. * at the end of this routine.
*/ */
if ((dpy->bufptr - dpy->buffer) & 3) if ((dpy->bufptr - dpy->buffer) & 3)
......
...@@ -33,30 +33,30 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,30 +33,30 @@ in this Software without prior written authorization from The Open Group.
/* /*
* Routines for allocating space for structures that are expected to get * Routines for allocating space for structures that are expected to get
* longer at some point. * longer at some point.
*/ */
XSizeHints *XAllocSizeHints () XSizeHints *XAllocSizeHints (void)
{ {
return ((XSizeHints *) Xcalloc (1, (unsigned) sizeof (XSizeHints))); return ((XSizeHints *) Xcalloc (1, (unsigned) sizeof (XSizeHints)));
} }
XStandardColormap *XAllocStandardColormap () XStandardColormap *XAllocStandardColormap (void)
{ {
return ((XStandardColormap *) return ((XStandardColormap *)
Xcalloc (1, (unsigned) sizeof (XStandardColormap))); Xcalloc (1, (unsigned) sizeof (XStandardColormap)));
} }
XWMHints *XAllocWMHints () XWMHints *XAllocWMHints (void)
{ {
return ((XWMHints *) Xcalloc (1, (unsigned) sizeof (XWMHints))); return ((XWMHints *) Xcalloc (1, (unsigned) sizeof (XWMHints)));
} }
XClassHint *XAllocClassHint () XClassHint *XAllocClassHint (void)
{ {
register XClassHint *h; register XClassHint *h;
...@@ -67,7 +67,7 @@ XClassHint *XAllocClassHint () ...@@ -67,7 +67,7 @@ XClassHint *XAllocClassHint ()
} }
XIconSize *XAllocIconSize () XIconSize *XAllocIconSize (void)
{ {
return ((XIconSize *) Xcalloc (1, (unsigned) sizeof (XIconSize))); return ((XIconSize *) Xcalloc (1, (unsigned) sizeof (XIconSize)));
} }
......
...@@ -34,10 +34,11 @@ from The Open Group. ...@@ -34,10 +34,11 @@ from The Open Group.
int int
_XPutBackEvent ( _XPutBackEvent (
register Display *dpy, register Display *dpy,
register XEvent *event) register XEvent *event)
{ {
register _XQEvent *qelt; register _XQEvent *qelt;
XEvent store = *event;
if (!dpy->qfree) { if (!dpy->qfree) {
if ((dpy->qfree = (_XQEvent *) Xmalloc (sizeof (_XQEvent))) == NULL) { if ((dpy->qfree = (_XQEvent *) Xmalloc (sizeof (_XQEvent))) == NULL) {
...@@ -45,11 +46,26 @@ _XPutBackEvent ( ...@@ -45,11 +46,26 @@ _XPutBackEvent (
} }
dpy->qfree->next = NULL; dpy->qfree->next = NULL;
} }
/* unclaimed cookie? */
if (_XIsEventCookie(dpy, event))
{
XEvent copy = {0};
/* if not claimed, then just fetch and store again */
if (!event->xcookie.data) {
_XFetchEventCookie(dpy, &event->xcookie);
store = *event;
} else { /* if claimed, copy, client must free */
_XCopyEventCookie(dpy, &event->xcookie, &copy.xcookie);
store = copy;
}
}
qelt = dpy->qfree; qelt = dpy->qfree;
dpy->qfree = qelt->next; dpy->qfree = qelt->next;
qelt->qserial_num = dpy->next_event_serial_num++; qelt->qserial_num = dpy->next_event_serial_num++;
qelt->next = dpy->head; qelt->next = dpy->head;
qelt->event = *event; qelt->event = store;
dpy->head = qelt; dpy->head = qelt;
if (dpy->tail == NULL) if (dpy->tail == NULL)
dpy->tail = qelt; dpy->tail = qelt;
...@@ -59,7 +75,7 @@ _XPutBackEvent ( ...@@ -59,7 +75,7 @@ _XPutBackEvent (
int int
XPutBackEvent ( XPutBackEvent (
register Display * dpy, register Display * dpy,
register XEvent *event) register XEvent *event)
{ {
int ret; int ret;
......
...@@ -682,7 +682,7 @@ SendXYImage( ...@@ -682,7 +682,7 @@ SendXYImage(
if ((dpy->bufptr + length) > dpy->bufmax) { if ((dpy->bufptr + length) > dpy->bufmax) {
if ((buf = _XAllocScratch(dpy, (unsigned long) (length))) == NULL) { if ((buf = _XAllocScratch(dpy, (unsigned long) (length))) == NULL) {
UnGetReq(PutImage); UnGetReq(PutImage);
return; return;
} }
} }
else else
...@@ -870,7 +870,7 @@ PutImageRequest( ...@@ -870,7 +870,7 @@ PutImageRequest(
SendZImage(dpy, req, image, req_xoffset, req_yoffset, SendZImage(dpy, req, image, req_xoffset, req_yoffset,
dest_bits_per_pixel, dest_scanline_pad); dest_bits_per_pixel, dest_scanline_pad);
} }
static void static void
PutSubImage ( PutSubImage (
register Display *dpy, register Display *dpy,
...@@ -889,7 +889,7 @@ PutSubImage ( ...@@ -889,7 +889,7 @@ PutSubImage (
if ((req_width == 0) || (req_height == 0)) if ((req_width == 0) || (req_height == 0))
return; return;
Available = ((65536 < dpy->max_request_size) ? (65536 << 2) Available = ((65536 < dpy->max_request_size) ? (65536 << 2)
: (dpy->max_request_size << 2)) : (dpy->max_request_size << 2))
- SIZEOF(xPutImageReq); - SIZEOF(xPutImageReq);
...@@ -905,7 +905,7 @@ PutSubImage ( ...@@ -905,7 +905,7 @@ PutSubImage (
} }
if ((BytesPerRow * req_height) <= Available) { if ((BytesPerRow * req_height) <= Available) {
PutImageRequest(dpy, d, gc, image, req_xoffset, req_yoffset, x, y, PutImageRequest(dpy, d, gc, image, req_xoffset, req_yoffset, x, y,
req_width, req_height, req_width, req_height,
dest_bits_per_pixel, dest_scanline_pad); dest_bits_per_pixel, dest_scanline_pad);
} else if (req_height > 1) { } else if (req_height > 1) {
...@@ -914,11 +914,11 @@ PutSubImage ( ...@@ -914,11 +914,11 @@ PutSubImage (
if (SubImageHeight == 0) if (SubImageHeight == 0)
SubImageHeight = 1; SubImageHeight = 1;
PutSubImage(dpy, d, gc, image, req_xoffset, req_yoffset, x, y, PutSubImage(dpy, d, gc, image, req_xoffset, req_yoffset, x, y,
req_width, (unsigned int) SubImageHeight, req_width, (unsigned int) SubImageHeight,
dest_bits_per_pixel, dest_scanline_pad); dest_bits_per_pixel, dest_scanline_pad);
PutSubImage(dpy, d, gc, image, req_xoffset, PutSubImage(dpy, d, gc, image, req_xoffset,
req_yoffset + SubImageHeight, x, y + SubImageHeight, req_yoffset + SubImageHeight, x, y + SubImageHeight,
req_width, req_height - SubImageHeight, req_width, req_height - SubImageHeight,
dest_bits_per_pixel, dest_scanline_pad); dest_bits_per_pixel, dest_scanline_pad);
...@@ -926,11 +926,11 @@ PutSubImage ( ...@@ -926,11 +926,11 @@ PutSubImage (
int SubImageWidth = (((Available << 3) / dest_scanline_pad) int SubImageWidth = (((Available << 3) / dest_scanline_pad)
* dest_scanline_pad) - left_pad; * dest_scanline_pad) - left_pad;
PutSubImage(dpy, d, gc, image, req_xoffset, req_yoffset, x, y, PutSubImage(dpy, d, gc, image, req_xoffset, req_yoffset, x, y,
(unsigned int) SubImageWidth, 1, (unsigned int) SubImageWidth, 1,
dest_bits_per_pixel, dest_scanline_pad); dest_bits_per_pixel, dest_scanline_pad);
PutSubImage(dpy, d, gc, image, req_xoffset + SubImageWidth, PutSubImage(dpy, d, gc, image, req_xoffset + SubImageWidth,
req_yoffset, x + SubImageWidth, y, req_yoffset, x + SubImageWidth, y,
req_width - SubImageWidth, 1, req_width - SubImageWidth, 1,
dest_bits_per_pixel, dest_scanline_pad); dest_bits_per_pixel, dest_scanline_pad);
...@@ -939,15 +939,17 @@ PutSubImage ( ...@@ -939,15 +939,17 @@ PutSubImage (
int int
XPutImage (dpy, d, gc, image, req_xoffset, req_yoffset, x, y, req_width, XPutImage (
req_height) register Display *dpy,
register Display *dpy; Drawable d,
Drawable d; GC gc,
GC gc; register XImage *image,
register XImage *image; int req_xoffset,
int x, y; int req_yoffset,
unsigned int req_width, req_height; int x,
int req_xoffset, req_yoffset; int y,
unsigned int req_width,
unsigned int req_height)
{ {
long width = req_width; long width = req_width;
......
...@@ -29,13 +29,15 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,13 +29,15 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryBestSize(dpy, class, drawable, width, height, ret_width, ret_height) Status XQueryBestSize(
register Display *dpy; register Display *dpy,
int class; int class,
Drawable drawable; Drawable drawable,
unsigned int width, height; unsigned int width,
unsigned int *ret_width, *ret_height; unsigned int height,
{ unsigned int *ret_width,
unsigned int *ret_height)
{
xQueryBestSizeReply rep; xQueryBestSizeReply rep;
register xQueryBestSizeReq *req; register xQueryBestSizeReq *req;
......
...@@ -24,16 +24,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -24,16 +24,17 @@ in this Software without prior written authorization from The Open Group.
*/ */
#define NEED_REPLIES
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
int int
XQueryColor(dpy, cmap, def) XQueryColor(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *def; /* RETURN */ XColor *def) /* RETURN */
{ {
xrgb color; xrgb color;
xQueryColorsReply rep; xQueryColorsReply rep;
......
...@@ -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
XQueryColors(dpy, cmap, defs, ncolors) XQueryColors(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *defs; /* RETURN */ XColor *defs, /* RETURN */
int ncolors; int ncolors)
{ {
register int i; register int i;
xrgb *color; xrgb *color;
......
...@@ -29,12 +29,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,14 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryBestCursor(dpy, drawable, width, height, ret_width, ret_height) Status XQueryBestCursor(
register Display *dpy; register Display *dpy,
Drawable drawable; Drawable drawable,
unsigned int width, height; unsigned int width,
unsigned int *ret_width, *ret_height; unsigned int height,
{ unsigned int *ret_width,
unsigned int *ret_height)
{
xQueryBestSizeReply rep; xQueryBestSizeReply rep;
register xQueryBestSizeReq *req; register xQueryBestSizeReq *req;
......
...@@ -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>
...@@ -37,7 +36,7 @@ XQueryExtension( ...@@ -37,7 +36,7 @@ XQueryExtension(
int *major_opcode, /* RETURN */ int *major_opcode, /* RETURN */
int *first_event, /* RETURN */ int *first_event, /* RETURN */
int *first_error) /* RETURN */ int *first_error) /* RETURN */
{ {
xQueryExtensionReply rep; xQueryExtensionReply rep;
register xQueryExtensionReq *req; register xQueryExtensionReq *req;
......
...@@ -34,17 +34,16 @@ struct kmap { ...@@ -34,17 +34,16 @@ struct kmap {
}; };
int int
XQueryKeymap(dpy, keys) XQueryKeymap(
register Display *dpy; register Display *dpy,
char keys[32]; char keys[32])
{
{
xQueryKeymapReply rep; xQueryKeymapReply rep;
register xReq *req; register xReq *req;
LockDisplay(dpy); LockDisplay(dpy);
GetEmptyReq(QueryKeymap, req); GetEmptyReq(QueryKeymap, req);
(void) _XReply(dpy, (xReply *)&rep, (void) _XReply(dpy, (xReply *)&rep,
(SIZEOF(xQueryKeymapReply) - SIZEOF(xReply)) >> 2, xTrue); (SIZEOF(xQueryKeymapReply) - SIZEOF(xReply)) >> 2, xTrue);
*(struct kmap *) keys = *(struct kmap *)rep.map; /* faster than memcpy */ *(struct kmap *) keys = *(struct kmap *)rep.map; /* faster than memcpy */
UnlockDisplay(dpy); UnlockDisplay(dpy);
......
...@@ -29,13 +29,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,13 +29,17 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Bool XQueryPointer(dpy, w, root, child, root_x, root_y, win_x, win_y, mask) Bool XQueryPointer(
register Display *dpy; register Display *dpy,
Window w, *root, *child; Window w,
int *root_x, *root_y, *win_x, *win_y; Window *root,
unsigned int *mask; Window *child,
int *root_x,
{ int *root_y,
int *win_x,
int *win_y,
unsigned int *mask)
{
xQueryPointerReply rep; xQueryPointerReply rep;
xResourceReq *req; xResourceReq *req;
......
...@@ -29,12 +29,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,14 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryBestStipple(dpy, drawable, width, height, ret_width, ret_height) Status XQueryBestStipple(
register Display *dpy; register Display *dpy,
Drawable drawable; Drawable drawable,
unsigned int width, height; unsigned int width,
unsigned int *ret_width, *ret_height; unsigned int height,
{ unsigned int *ret_width,
unsigned int *ret_height)
{
xQueryBestSizeReply rep; xQueryBestSizeReply rep;
register xQueryBestSizeReq *req; register xQueryBestSizeReq *req;
......
...@@ -29,12 +29,14 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,12 +29,14 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryBestTile(dpy, drawable, width, height, ret_width, ret_height) Status XQueryBestTile(
register Display *dpy; register Display *dpy,
Drawable drawable; Drawable drawable,
unsigned int width, height; unsigned int width,
unsigned int *ret_width, *ret_height; unsigned int height,
{ unsigned int *ret_width,
unsigned int *ret_height)
{
xQueryBestSizeReply rep; xQueryBestSizeReply rep;
register xQueryBestSizeReq *req; register xQueryBestSizeReq *req;
......
...@@ -29,13 +29,13 @@ in this Software without prior written authorization from The Open Group. ...@@ -29,13 +29,13 @@ in this Software without prior written authorization from The Open Group.
#endif #endif
#include "Xlibint.h" #include "Xlibint.h"
Status XQueryTree (dpy, w, root, parent, children, nchildren) Status XQueryTree (
register Display *dpy; register Display *dpy,
Window w; Window w,
Window *root; /* RETURN */ Window *root, /* RETURN */
Window *parent; /* RETURN */ Window *parent, /* RETURN */
Window **children; /* RETURN */ Window **children, /* RETURN */
unsigned int *nchildren; /* RETURN */ unsigned int *nchildren) /* RETURN */
{ {
long nbytes; long nbytes;
xQueryTreeReply rep; xQueryTreeReply rep;
...@@ -49,7 +49,7 @@ Status XQueryTree (dpy, w, root, parent, children, nchildren) ...@@ -49,7 +49,7 @@ Status XQueryTree (dpy, w, root, parent, children, nchildren)
return (0); return (0);
} }
*children = (Window *) NULL; *children = (Window *) NULL;
if (rep.nChildren != 0) { if (rep.nChildren != 0) {
nbytes = rep.nChildren * sizeof(Window); nbytes = rep.nChildren * sizeof(Window);
*children = (Window *) Xmalloc((unsigned) nbytes); *children = (Window *) Xmalloc((unsigned) nbytes);
......
...@@ -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
...@@ -353,7 +353,7 @@ XrmStringToQuark( ...@@ -353,7 +353,7 @@ XrmStringToQuark(
if (!name) if (!name)
return (NULLQUARK); return (NULLQUARK);
for (tname = (char *)name; (c = *tname++); ) for (tname = (char *)name; (c = *tname++); )
sig = (sig << 1) + c; sig = (sig << 1) + c;
...@@ -376,7 +376,7 @@ XrmPermStringToQuark( ...@@ -376,7 +376,7 @@ XrmPermStringToQuark(
return _XrmInternalStringToQuark(name, tname-(char *)name-1, sig, True); return _XrmInternalStringToQuark(name, tname-(char *)name-1, sig, True);
} }
XrmQuark XrmUniqueQuark() XrmQuark XrmUniqueQuark(void)
{ {
XrmQuark q; XrmQuark q;
...@@ -389,8 +389,7 @@ XrmQuark XrmUniqueQuark() ...@@ -389,8 +389,7 @@ XrmQuark XrmUniqueQuark()
return q; return q;
} }
XrmString XrmQuarkToString(quark) XrmString XrmQuarkToString(register XrmQuark quark)
register XrmQuark quark;
{ {
XrmString s; XrmString s;
......
...@@ -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
XRaiseWindow (dpy, w) XRaiseWindow (
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xConfigureWindowReq *req; register xConfigureWindowReq *req;
unsigned long val = Above; /* needed for macro below */ unsigned long val = Above; /* needed for macro below */
......
...@@ -27,17 +27,17 @@ from The Open Group. ...@@ -27,17 +27,17 @@ from The Open Group.
*/ */
/* /*
* Code to read bitmaps from disk files. Interprets * Code to read bitmaps from disk files. Interprets
* data from X10 and X11 bitmap files and creates * data from X10 and X11 bitmap files and creates
* Pixmap representations of files. Returns Pixmap * Pixmap representations of files. Returns Pixmap
* ID and specifics about image. * ID and specifics about image.
* *
* Modified for speedup by Jim Becker, changed image * Modified for speedup by Jim Becker, changed image
* data parsing logic (removed some fscanf()s). * data parsing logic (removed some fscanf()s).
* Aug 5, 1988 * Aug 5, 1988
* *
* Note that this file and ../Xmu/RdBitF.c look very similar.... Keep them * Note that this file and ../Xmu/RdBitF.c look very similar.... Keep them
* that way (but don't use common source code so that people can have one * that way (but don't use common source code so that people can have one
* without the other). * without the other).
*/ */
...@@ -54,43 +54,23 @@ from The Open Group. ...@@ -54,43 +54,23 @@ from The Open Group.
#define MAX_SIZE 255 #define MAX_SIZE 255
/* shared data for the image read/parse logic */ /* shared data for the image read/parse logic */
static short hexTable[256]; /* conversion value */ static const short hexTable[256] = {
static Bool initialized = False; /* easier to fill in at run time */ ['0'] = 0, ['1'] = 1,
['2'] = 2, ['3'] = 3,
['4'] = 4, ['5'] = 5,
/* ['6'] = 6, ['7'] = 7,
* Table index for the hex values. Initialized once, first time. ['8'] = 8, ['9'] = 9,
* Used for translation value or delimiter significance lookup. ['A'] = 10, ['B'] = 11,
*/ ['C'] = 12, ['D'] = 13,
static void initHexTable(void) ['E'] = 14, ['F'] = 15,
{ ['a'] = 10, ['b'] = 11,
/* ['c'] = 12, ['d'] = 13,
* We build the table at run time for several reasons: ['e'] = 14, ['f'] = 15,
*
* 1. portable to non-ASCII machines. [' '] = -1, [','] = -1,
* 2. still reentrant since we set the init flag after setting table. ['}'] = -1, ['\n'] = -1,
* 3. easier to extend. ['\t'] = -1
* 4. less prone to bugs. };
*/
hexTable['0'] = 0; hexTable['1'] = 1;
hexTable['2'] = 2; hexTable['3'] = 3;
hexTable['4'] = 4; hexTable['5'] = 5;
hexTable['6'] = 6; hexTable['7'] = 7;
hexTable['8'] = 8; hexTable['9'] = 9;
hexTable['A'] = 10; hexTable['B'] = 11;
hexTable['C'] = 12; hexTable['D'] = 13;
hexTable['E'] = 14; hexTable['F'] = 15;
hexTable['a'] = 10; hexTable['b'] = 11;
hexTable['c'] = 12; hexTable['d'] = 13;
hexTable['e'] = 14; hexTable['f'] = 15;
/* delimiters of significance are flagged w/ negative value */
hexTable[' '] = -1; hexTable[','] = -1;
hexTable['}'] = -1; hexTable['\n'] = -1;
hexTable['\t'] = -1;
initialized = True;
}
/* /*
* read next hex value in the input stream, return -1 if EOF * read next hex value in the input stream, return -1 if EOF
...@@ -103,7 +83,7 @@ NextInt ( ...@@ -103,7 +83,7 @@ NextInt (
int value = 0; int value = 0;
int gotone = 0; int gotone = 0;
int done = 0; int done = 0;
/* loop, accumulate hex value until find delimiter */ /* loop, accumulate hex value until find delimiter */
/* skip any initial delimiters found in read stream */ /* skip any initial delimiters found in read stream */
...@@ -149,9 +129,6 @@ XReadBitmapFileData ( ...@@ -149,9 +129,6 @@ XReadBitmapFileData (
int hx = -1; /* x hotspot */ int hx = -1; /* x hotspot */
int hy = -1; /* y hotspot */ int hy = -1; /* y hotspot */
/* first time initialization */
if (initialized == False) initHexTable();
#ifdef __UNIXOS2__ #ifdef __UNIXOS2__
filename = __XOS2RedirRoot(filename); filename = __XOS2RedirRoot(filename);
#endif #endif
...@@ -185,7 +162,7 @@ XReadBitmapFileData ( ...@@ -185,7 +162,7 @@ XReadBitmapFileData (
} }
continue; continue;
} }
if (sscanf(line, "static short %s = {", name_and_type) == 1) if (sscanf(line, "static short %s = {", name_and_type) == 1)
version10p = 1; version10p = 1;
else if (sscanf(line,"static unsigned char %s = {",name_and_type) == 1) else if (sscanf(line,"static unsigned char %s = {",name_and_type) == 1)
...@@ -202,7 +179,7 @@ XReadBitmapFileData ( ...@@ -202,7 +179,7 @@ XReadBitmapFileData (
if (strcmp("bits[]", type)) if (strcmp("bits[]", type))
continue; continue;
if (!ww || !hh) if (!ww || !hh)
RETURN (BitmapFileInvalid); RETURN (BitmapFileInvalid);
...@@ -215,7 +192,7 @@ XReadBitmapFileData ( ...@@ -215,7 +192,7 @@ XReadBitmapFileData (
size = bytes_per_line * hh; size = bytes_per_line * hh;
bits = (unsigned char *) Xmalloc ((unsigned int) size); bits = (unsigned char *) Xmalloc ((unsigned int) size);
if (!bits) if (!bits)
RETURN (BitmapNoMemory); RETURN (BitmapNoMemory);
if (version10p) { if (version10p) {
...@@ -234,7 +211,7 @@ XReadBitmapFileData ( ...@@ -234,7 +211,7 @@ XReadBitmapFileData (
int bytes; int bytes;
for (bytes=0, ptr=bits; bytes<size; bytes++, ptr++) { for (bytes=0, ptr=bits; bytes<size; bytes++, ptr++) {
if ((value = NextInt(fstream)) < 0) if ((value = NextInt(fstream)) < 0)
RETURN (BitmapFileInvalid); RETURN (BitmapFileInvalid);
*ptr=value; *ptr=value;
} }
......
...@@ -30,11 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,11 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XRecolorCursor(dpy, cursor, foreground, background) XRecolorCursor(
register Display *dpy; register Display *dpy,
Cursor cursor; Cursor cursor,
XColor *foreground, *background; XColor *foreground,
{ XColor *background)
{
register xRecolorCursorReq *req; register xRecolorCursorReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -34,12 +34,12 @@ from The Open Group. ...@@ -34,12 +34,12 @@ from The Open Group.
#define AllMaskBits (CWX|CWY|CWWidth|CWHeight|\ #define AllMaskBits (CWX|CWY|CWWidth|CWHeight|\
CWBorderWidth|CWSibling|CWStackMode) CWBorderWidth|CWSibling|CWStackMode)
Status XReconfigureWMWindow (dpy, w, screen, mask, changes) Status XReconfigureWMWindow (
register Display *dpy; register Display *dpy,
Window w; Window w,
int screen; int screen,
unsigned int mask; unsigned int mask,
XWindowChanges *changes; XWindowChanges *changes)
{ {
XConfigureRequestEvent ev; XConfigureRequestEvent ev;
Window root = RootWindow (dpy, screen); Window root = RootWindow (dpy, screen);
......
...@@ -33,12 +33,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -33,12 +33,12 @@ in this Software without prior written authorization from The Open Group.
CWBorderWidth|CWSibling|CWStackMode) CWBorderWidth|CWSibling|CWStackMode)
int int
XConfigureWindow(dpy, w, mask, changes) XConfigureWindow(
register Display *dpy; register Display *dpy,
Window w; Window w,
unsigned int mask; unsigned int mask,
XWindowChanges *changes; XWindowChanges *changes)
{ {
unsigned long values[7]; unsigned long values[7];
register unsigned long *value = values; register unsigned long *value = values;
long nvalues; long nvalues;
...@@ -52,7 +52,7 @@ XConfigureWindow(dpy, w, mask, changes) ...@@ -52,7 +52,7 @@ XConfigureWindow(dpy, w, mask, changes)
if (mask & CWX) if (mask & CWX)
*value++ = changes->x; *value++ = changes->x;
if (mask & CWY) if (mask & CWY)
*value++ = changes->y; *value++ = changes->y;
......
...@@ -27,13 +27,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -27,13 +27,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
...@@ -322,9 +322,9 @@ XOffsetRegion( ...@@ -322,9 +322,9 @@ XOffsetRegion(
return 1; return 1;
} }
/* /*
Utility procedure Compress: Utility procedure Compress:
Replace r by the region r', where Replace r by the region r', where
p in r' iff (Quantifer m <= dx) (p + m in r), and p in r' iff (Quantifer m <= dx) (p + m in r), and
Quantifier is Exists if grow is TRUE, For all if grow is FALSE, and Quantifier is Exists if grow is TRUE, For all if grow is FALSE, and
(x,y) + m = (x+m,y) if xdir is TRUE; (x,y+m) if xdir is FALSE. (x,y) + m = (x+m,y) if xdir is TRUE; (x,y+m) if xdir is FALSE.
...@@ -395,23 +395,6 @@ XShrinkRegion( ...@@ -395,23 +395,6 @@ XShrinkRegion(
return 0; return 0;
} }
#ifdef notdef
/***********************************************************
* Bop down the array of rects until we have passed
* scanline y. numRects is the size of the array.
***********************************************************/
static BOX
*IndexRects(
register BOX *rects,
register int numRects,
register int y)
{
while ((numRects--) && (rects->y2 <= y))
rects++;
return(rects);
}
#endif
/*====================================================================== /*======================================================================
* Region Intersection * Region Intersection
...@@ -505,9 +488,9 @@ XIntersectRegion( ...@@ -505,9 +488,9 @@ XIntersectRegion(
(!EXTENTCHECK(&reg1->extents, &reg2->extents))) (!EXTENTCHECK(&reg1->extents, &reg2->extents)))
newReg->numRects = 0; newReg->numRects = 0;
else else
miRegionOp (newReg, reg1, reg2, miRegionOp (newReg, reg1, reg2,
miIntersectO, NULL, NULL); miIntersectO, NULL, NULL);
/* /*
* Can't alter newReg's extents before we call miRegionOp because * Can't alter newReg's extents before we call miRegionOp because
* it might be one of the source regions and miRegionOp depends * it might be one of the source regions and miRegionOp depends
...@@ -526,13 +509,13 @@ miRegionCopy( ...@@ -526,13 +509,13 @@ miRegionCopy(
{ {
if (dstrgn != rgn) /* don't want to copy to itself */ if (dstrgn != rgn) /* don't want to copy to itself */
{ {
if (dstrgn->size < rgn->numRects) if (dstrgn->size < rgn->numRects)
{ {
if (dstrgn->rects) if (dstrgn->rects)
{ {
BOX *prevRects = dstrgn->rects; BOX *prevRects = dstrgn->rects;
if (! (dstrgn->rects = (BOX *) if (! (dstrgn->rects = (BOX *)
Xrealloc((char *) dstrgn->rects, Xrealloc((char *) dstrgn->rects,
(unsigned) rgn->numRects * (sizeof(BOX))))) { (unsigned) rgn->numRects * (sizeof(BOX))))) {
...@@ -553,135 +536,6 @@ miRegionCopy( ...@@ -553,135 +536,6 @@ miRegionCopy(
} }
} }
#ifdef notdef
/*
* combinRegs(newReg, reg1, reg2)
* if one region is above or below the other.
*/
static void
combineRegs(
register Region newReg,
Region reg1,
Region reg2)
{
register Region tempReg;
register BOX *rects;
register BOX *rects1;
register BOX *rects2;
register int total;
rects1 = reg1->rects;
rects2 = reg2->rects;
total = reg1->numRects + reg2->numRects;
if (! (tempReg = XCreateRegion()))
return;
tempReg->size = total;
/* region 1 is below region 2 */
if (reg1->extents.y1 > reg2->extents.y1)
{
miRegionCopy(tempReg, reg2);
rects = &tempReg->rects[tempReg->numRects];
total -= tempReg->numRects;
while (total--)
*rects++ = *rects1++;
}
else
{
miRegionCopy(tempReg, reg1);
rects = &tempReg->rects[tempReg->numRects];
total -= tempReg->numRects;
while (total--)
*rects++ = *rects2++;
}
tempReg->extents = reg1->extents;
tempReg->numRects = reg1->numRects + reg2->numRects;
EXTENTS(&reg2->extents, tempReg);
miRegionCopy(newReg, tempReg);
Xfree((char *)tempReg);
}
/*
* QuickCheck checks to see if it does not have to go through all the
* the ugly code for the region call. It returns 1 if it did all
* the work for Union, otherwise 0 - still work to be done.
*/
static int
QuickCheck(Region newReg, Region reg1, Region reg2)
{
/* if unioning with itself or no rects to union with */
if ( (reg1 == reg2) || (!(reg1->numRects)) )
{
miRegionCopy(newReg, reg2);
return TRUE;
}
/* if nothing to union */
if (!(reg2->numRects))
{
miRegionCopy(newReg, reg1);
return TRUE;
}
/* could put an extent check to see if add above or below */
if ((reg1->extents.y1 >= reg2->extents.y2) ||
(reg2->extents.y1 >= reg1->extents.y2) )
{
combineRegs(newReg, reg1, reg2);
return TRUE;
}
return FALSE;
}
/* TopRects(rects, reg1, reg2)
* N.B. We now assume that reg1 and reg2 intersect. Therefore we are
* NOT checking in the two while loops for stepping off the end of the
* region.
*/
static int
TopRects(
register Region newReg,
register BOX *rects,
register Region reg1,
register Region reg2,
BOX *FirstRect)
{
register BOX *tempRects;
/* need to add some rects from region 1 */
if (reg1->extents.y1 < reg2->extents.y1)
{
tempRects = reg1->rects;
while(tempRects->y1 < reg2->extents.y1)
{
MEMCHECK(newReg, rects, FirstRect);
ADDRECTNOX(newReg,rects, tempRects->x1, tempRects->y1,
tempRects->x2, MIN(tempRects->y2, reg2->extents.y1));
tempRects++;
}
}
/* need to add some rects from region 2 */
if (reg2->extents.y1 < reg1->extents.y1)
{
tempRects = reg2->rects;
while (tempRects->y1 < reg1->extents.y1)
{
MEMCHECK(newReg, rects, FirstRect);
ADDRECTNOX(newReg, rects, tempRects->x1,tempRects->y1,
tempRects->x2, MIN(tempRects->y2, reg1->extents.y1));
tempRects++;
}
}
return 1;
}
#endif
/*====================================================================== /*======================================================================
* Generic Region Operator * Generic Region Operator
*====================================================================*/ *====================================================================*/
...@@ -737,7 +591,7 @@ miCoalesce( ...@@ -737,7 +591,7 @@ miCoalesce(
{ {
pCurBox++; pCurBox++;
} }
if (pCurBox != pRegEnd) if (pCurBox != pRegEnd)
{ {
/* /*
...@@ -754,7 +608,7 @@ miCoalesce( ...@@ -754,7 +608,7 @@ miCoalesce(
curStart = pRegEnd - pReg->rects; curStart = pRegEnd - pReg->rects;
pRegEnd = pReg->rects + pReg->numRects; pRegEnd = pReg->rects + pReg->numRects;
} }
if ((curNumRects == prevNumRects) && (curNumRects != 0)) { if ((curNumRects == prevNumRects) && (curNumRects != 0)) {
pCurBox -= curNumRects; pCurBox -= curNumRects;
/* /*
...@@ -822,7 +676,7 @@ miCoalesce( ...@@ -822,7 +676,7 @@ miCoalesce(
*pPrevBox++ = *pCurBox++; *pPrevBox++ = *pCurBox++;
} while (pCurBox != pRegEnd); } while (pCurBox != pRegEnd);
} }
} }
} }
return (curStart); return (curStart);
...@@ -903,7 +757,7 @@ miRegionOp( ...@@ -903,7 +757,7 @@ miRegionOp(
* band */ * band */
short bot; /* Bottom of non-overlapping short bot; /* Bottom of non-overlapping
* band */ * band */
/* /*
* Initialization: * Initialization:
* set r1, r2, r1End and r2End appropriately, preserve the important * set r1, r2, r1End and r2End appropriately, preserve the important
...@@ -915,9 +769,9 @@ miRegionOp( ...@@ -915,9 +769,9 @@ miRegionOp(
r2 = reg2->rects; r2 = reg2->rects;
r1End = r1 + reg1->numRects; r1End = r1 + reg1->numRects;
r2End = r2 + reg2->numRects; r2End = r2 + reg2->numRects;
oldRects = newReg->rects; oldRects = newReg->rects;
EMPTY_REGION(newReg); EMPTY_REGION(newReg);
/* /*
...@@ -934,7 +788,7 @@ miRegionOp( ...@@ -934,7 +788,7 @@ miRegionOp(
newReg->size = 0; newReg->size = 0;
return; return;
} }
/* /*
* Initialize ybot and ytop. * Initialize ybot and ytop.
* In the upcoming loop, ybot and ytop serve different functions depending * In the upcoming loop, ybot and ytop serve different functions depending
...@@ -952,7 +806,7 @@ miRegionOp( ...@@ -952,7 +806,7 @@ miRegionOp(
ybot = reg1->extents.y1; ybot = reg1->extents.y1;
else else
ybot = reg2->extents.y1; ybot = reg2->extents.y1;
/* /*
* prevBand serves to mark the start of the previous band so rectangles * prevBand serves to mark the start of the previous band so rectangles
* can be coalesced into larger rectangles. qv. miCoalesce, above. * can be coalesced into larger rectangles. qv. miCoalesce, above.
...@@ -963,7 +817,7 @@ miRegionOp( ...@@ -963,7 +817,7 @@ miRegionOp(
* array of rectangles. * array of rectangles.
*/ */
prevBand = 0; prevBand = 0;
do do
{ {
curBand = newReg->numRects; curBand = newReg->numRects;
...@@ -980,13 +834,13 @@ miRegionOp( ...@@ -980,13 +834,13 @@ miRegionOp(
{ {
r1BandEnd++; r1BandEnd++;
} }
r2BandEnd = r2; r2BandEnd = r2;
while ((r2BandEnd != r2End) && (r2BandEnd->y1 == r2->y1)) while ((r2BandEnd != r2End) && (r2BandEnd->y1 == r2->y1))
{ {
r2BandEnd++; r2BandEnd++;
} }
/* /*
* First handle the band that doesn't intersect, if any. * First handle the band that doesn't intersect, if any.
* *
...@@ -1046,7 +900,7 @@ miRegionOp( ...@@ -1046,7 +900,7 @@ miRegionOp(
(* overlapFunc) (newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot); (* overlapFunc) (newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot);
} }
if (newReg->numRects != curBand) if (newReg->numRects != curBand)
{ {
prevBand = miCoalesce (newReg, prevBand, curBand); prevBand = miCoalesce (newReg, prevBand, curBand);
...@@ -1223,7 +1077,7 @@ miUnionO ( ...@@ -1223,7 +1077,7 @@ miUnionO (
register short y2) register short y2)
{ {
register BoxPtr pNextRect; register BoxPtr pNextRect;
pNextRect = &pReg->rects[pReg->numRects]; pNextRect = &pReg->rects[pReg->numRects];
#define MERGERECT(r) \ #define MERGERECT(r) \
...@@ -1250,7 +1104,7 @@ miUnionO ( ...@@ -1250,7 +1104,7 @@ miUnionO (
} \ } \
assert(pReg->numRects<=pReg->size);\ assert(pReg->numRects<=pReg->size);\
r++; r++;
assert (y1<y2); assert (y1<y2);
while ((r1 != r1End) && (r2 != r2End)) while ((r1 != r1End) && (r2 != r2End))
{ {
...@@ -1263,7 +1117,7 @@ miUnionO ( ...@@ -1263,7 +1117,7 @@ miUnionO (
MERGERECT(r2); MERGERECT(r2);
} }
} }
if (r1 != r1End) if (r1 != r1End)
{ {
do do
...@@ -1309,7 +1163,7 @@ XUnionRegion( ...@@ -1309,7 +1163,7 @@ XUnionRegion(
/* /*
* Region 1 completely subsumes region 2 * Region 1 completely subsumes region 2
*/ */
if ((reg1->numRects == 1) && if ((reg1->numRects == 1) &&
(reg1->extents.x1 <= reg2->extents.x1) && (reg1->extents.x1 <= reg2->extents.x1) &&
(reg1->extents.y1 <= reg2->extents.y1) && (reg1->extents.y1 <= reg2->extents.y1) &&
(reg1->extents.x2 >= reg2->extents.x2) && (reg1->extents.x2 >= reg2->extents.x2) &&
...@@ -1323,7 +1177,7 @@ XUnionRegion( ...@@ -1323,7 +1177,7 @@ XUnionRegion(
/* /*
* Region 2 completely subsumes region 1 * Region 2 completely subsumes region 1
*/ */
if ((reg2->numRects == 1) && if ((reg2->numRects == 1) &&
(reg2->extents.x1 <= reg1->extents.x1) && (reg2->extents.x1 <= reg1->extents.x1) &&
(reg2->extents.y1 <= reg1->extents.y1) && (reg2->extents.y1 <= reg1->extents.y1) &&
(reg2->extents.x2 >= reg1->extents.x2) && (reg2->extents.x2 >= reg1->extents.x2) &&
...@@ -1334,7 +1188,7 @@ XUnionRegion( ...@@ -1334,7 +1188,7 @@ XUnionRegion(
return 1; return 1;
} }
miRegionOp (newReg, reg1, reg2, miUnionO, miRegionOp (newReg, reg1, reg2, miUnionO,
miUnionNonO, miUnionNonO); miUnionNonO, miUnionNonO);
newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1); newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1);
...@@ -1374,9 +1228,9 @@ miSubtractNonO1 ( ...@@ -1374,9 +1228,9 @@ miSubtractNonO1 (
register short y2) register short y2)
{ {
register BoxPtr pNextRect; register BoxPtr pNextRect;
pNextRect = &pReg->rects[pReg->numRects]; pNextRect = &pReg->rects[pReg->numRects];
assert(y1<y2); assert(y1<y2);
while (r != rEnd) while (r != rEnd)
...@@ -1424,9 +1278,9 @@ miSubtractO ( ...@@ -1424,9 +1278,9 @@ miSubtractO (
{ {
register BoxPtr pNextRect; register BoxPtr pNextRect;
register int x1; register int x1;
x1 = r1->x1; x1 = r1->x1;
assert(y1<y2); assert(y1<y2);
pNextRect = &pReg->rects[pReg->numRects]; pNextRect = &pReg->rects[pReg->numRects];
...@@ -1545,7 +1399,7 @@ miSubtractO ( ...@@ -1545,7 +1399,7 @@ miSubtractO (
} }
return 0; /* lint */ return 0; /* lint */
} }
/*- /*-
*----------------------------------------------------------------------- *-----------------------------------------------------------------------
* miSubtract -- * miSubtract --
...@@ -1564,7 +1418,7 @@ miSubtractO ( ...@@ -1564,7 +1418,7 @@ miSubtractO (
int int
XSubtractRegion( XSubtractRegion(
Region regM, Region regM,
Region regS, Region regS,
register Region regD) register Region regD)
{ {
/* check for trivial reject */ /* check for trivial reject */
...@@ -1574,8 +1428,8 @@ XSubtractRegion( ...@@ -1574,8 +1428,8 @@ XSubtractRegion(
miRegionCopy(regD, regM); miRegionCopy(regD, regM);
return 1; return 1;
} }
miRegionOp (regD, regM, regS, miSubtractO, miRegionOp (regD, regM, regS, miSubtractO,
miSubtractNonO1, NULL); miSubtractNonO1, NULL);
/* /*
...@@ -1605,10 +1459,10 @@ XXorRegion(Region sra, Region srb, Region dr) ...@@ -1605,10 +1459,10 @@ XXorRegion(Region sra, Region srb, Region dr)
} }
/* /*
* Check to see if the region is empty. Assumes a region is passed * Check to see if the region is empty. Assumes a region is passed
* as a parameter * as a parameter
*/ */
int int
XEmptyRegion( XEmptyRegion(
Region r) Region r)
{ {
...@@ -1617,9 +1471,9 @@ XEmptyRegion( ...@@ -1617,9 +1471,9 @@ XEmptyRegion(
} }
/* /*
* Check to see if two regions are equal * Check to see if two regions are equal
*/ */
int int
XEqualRegion(Region r1, Region r2) XEqualRegion(Region r1, Region r2)
{ {
int i; int i;
...@@ -1639,7 +1493,7 @@ XEqualRegion(Region r1, Region r2) ...@@ -1639,7 +1493,7 @@ XEqualRegion(Region r1, Region r2)
return TRUE; return TRUE;
} }
int int
XPointInRegion( XPointInRegion(
Region pRegion, Region pRegion,
int x, int y) int x, int y)
...@@ -1658,7 +1512,7 @@ XPointInRegion( ...@@ -1658,7 +1512,7 @@ XPointInRegion(
return FALSE; return FALSE;
} }
int int
XRectInRegion( XRectInRegion(
register Region region, register Region region,
int rx, int ry, int rx, int ry,
...@@ -1674,7 +1528,7 @@ XRectInRegion( ...@@ -1674,7 +1528,7 @@ XRectInRegion(
prect->y1 = ry; prect->y1 = ry;
prect->x2 = rwidth + rx; prect->x2 = rwidth + rx;
prect->y2 = rheight + ry; prect->y2 = rheight + ry;
/* this is (just) a useful optimization */ /* this is (just) a useful optimization */
if ((region->numRects == 0) || !EXTENTCHECK(&region->extents, prect)) if ((region->numRects == 0) || !EXTENTCHECK(&region->extents, prect))
return(RectangleOut); return(RectangleOut);
...@@ -1736,6 +1590,6 @@ XRectInRegion( ...@@ -1736,6 +1590,6 @@ XRectInRegion(
} }
return(partIn ? ((ry < prect->y2) ? RectanglePart : RectangleIn) : return(partIn ? ((ry < prect->y2) ? RectanglePart : RectangleIn) :
RectangleOut); RectangleOut);
} }
...@@ -30,10 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,10 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XReparentWindow(dpy, w, p, x, y) XReparentWindow(
register Display *dpy; register Display *dpy,
Window w, p; Window w,
int x, y; Window p,
int x,
int y)
{ {
register xReparentWindowReq *req; register xReparentWindowReq *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
XRestackWindows (dpy, windows, n) XRestackWindows (
register Display *dpy; register Display *dpy,
register Window *windows; register Window *windows,
int n; int n)
{ {
int i = 0; int i = 0;
LockDisplay(dpy); LockDisplay(dpy);
...@@ -50,12 +50,10 @@ XRestackWindows (dpy, windows, n) ...@@ -50,12 +50,10 @@ XRestackWindows (dpy, windows, n)
*values++ = *(windows-1); *values++ = *(windows-1);
*values = Below; *values = Below;
} }
} }
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -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
XRotateWindowProperties(dpy, w, properties, nprops, npositions) XRotateWindowProperties(
register Display *dpy; register Display *dpy,
Window w; Window w,
Atom *properties; Atom *properties,
register int nprops; register int nprops,
int npositions; int npositions)
{ {
register long nbytes; register long nbytes;
register xRotatePropertiesReq *req; register xRotatePropertiesReq *req;
...@@ -45,7 +45,7 @@ XRotateWindowProperties(dpy, w, properties, nprops, npositions) ...@@ -45,7 +45,7 @@ XRotateWindowProperties(dpy, w, properties, nprops, npositions)
req->window = w; req->window = w;
req->nAtoms = nprops; req->nAtoms = nprops;
req->nPositions = npositions; req->nPositions = npositions;
req->length += nprops; req->length += nprops;
nbytes = nprops << 2; nbytes = nprops << 2;
/* XXX Cray needs packing here.... */ /* XXX Cray needs packing here.... */
......
...@@ -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"
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
char *XScreenResourceString(screen) char *XScreenResourceString(Screen *screen)
Screen *screen;
{ {
Atom prop_name; Atom prop_name;
Atom actual_type; Atom actual_type;
......
...@@ -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
XSelectInput (dpy, w, mask) XSelectInput (
register Display *dpy; register Display *dpy,
Window w; Window w,
long mask; long mask)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
......
...@@ -34,12 +34,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -34,12 +34,12 @@ in this Software without prior written authorization from The Open Group.
* event converter here if it has never been installed. * event converter here if it has never been installed.
*/ */
Status Status
XSendEvent(dpy, w, propagate, event_mask, event) XSendEvent(
register Display *dpy; register Display *dpy,
Window w; Window w,
Bool propagate; Bool propagate,
long event_mask; long event_mask,
XEvent *event; XEvent *event)
{ {
register xSendEventReq *req; register xSendEventReq *req;
xEvent ev; xEvent ev;
...@@ -49,6 +49,11 @@ XSendEvent(dpy, w, propagate, event_mask, event) ...@@ -49,6 +49,11 @@ XSendEvent(dpy, w, propagate, event_mask, event)
xEvent * /* event */); xEvent * /* event */);
Status status; Status status;
/* initialize all of the event's fields first, before setting
* the meaningful ones later.
*/
memset (&ev, 0, sizeof (ev));
LockDisplay (dpy); LockDisplay (dpy);
/* call through display to find proper conversion routine */ /* call through display to find proper conversion routine */
......
...@@ -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
XSetBackground (dpy, gc, background) XSetBackground (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned long background; /* CARD32 */ unsigned long background) /* CARD32 */
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.background != background) { if (gc->values.background != background) {
......
...@@ -62,14 +62,14 @@ void _XSetClipRectangles ( ...@@ -62,14 +62,14 @@ void _XSetClipRectangles (
} }
int int
XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n, XSetClipRectangles (
ordering) register Display *dpy,
register Display *dpy; GC gc,
GC gc; int clip_x_origin,
int clip_x_origin, clip_y_origin; int clip_y_origin,
XRectangle *rectangles; XRectangle *rectangles,
int n; int n,
int ordering; int ordering)
{ {
LockDisplay(dpy); LockDisplay(dpy);
_XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n, _XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n,
...@@ -78,4 +78,3 @@ XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n, ...@@ -78,4 +78,3 @@ XSetClipRectangles (dpy, gc, clip_x_origin, clip_y_origin, rectangles, n,
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -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
XSetClipMask (dpy, gc, mask) XSetClipMask (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
Pixmap mask; Pixmap mask)
{ {
LockDisplay(dpy); LockDisplay(dpy);
/* always update, since client may have changed pixmap contents */ /* always update, since client may have changed pixmap contents */
......
...@@ -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
XSetClipOrigin (dpy, gc, xorig, yorig) XSetClipOrigin (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
int xorig, yorig; int xorig,
int yorig)
{ {
XGCValues *gv = &gc->values; XGCValues *gv = &gc->values;
......
...@@ -32,10 +32,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,10 +32,10 @@ in this Software without prior written authorization from The Open Group.
#define safestrlen(s) ((s) ? strlen(s) : 0) #define safestrlen(s) ((s) ? strlen(s) : 0)
int int
XSetFontPath (dpy, directories, ndirs) XSetFontPath (
register Display *dpy; register Display *dpy,
char **directories; char **directories,
int ndirs; int ndirs)
{ {
register int n = 0; register int n = 0;
register int i; register int i;
......
...@@ -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
XSetFont (dpy, gc, font) XSetFont (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
Font font; Font font)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.font != font) { if (gc->values.font != font) {
......
...@@ -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
XSetForeground (dpy, gc, foreground) XSetForeground (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned long foreground; /* CARD32 */ unsigned long foreground) /* CARD32 */
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.foreground != foreground) { if (gc->values.foreground != foreground) {
......
...@@ -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
XSetFunction (dpy, gc, function) XSetFunction (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
int function; int function)
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.function != function) { if (gc->values.function != function) {
......
...@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,13 @@ Copyright 1987 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
...@@ -58,86 +58,108 @@ SOFTWARE. ...@@ -58,86 +58,108 @@ SOFTWARE.
#define safestrlen(s) ((s) ? strlen(s) : 0) #define safestrlen(s) ((s) ? strlen(s) : 0)
int int
XSetSizeHints(dpy, w, hints, property) /* old routine */ XSetSizeHints( /* old routine */
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
Atom property; Atom property)
{ {
xPropSizeHints prop; xPropSizeHints prop;
memset(&prop, 0, sizeof(prop));
prop.flags = (hints->flags & (USPosition|USSize|PAllHints)); prop.flags = (hints->flags & (USPosition|USSize|PAllHints));
prop.x = hints->x; if (hints->flags & (USPosition|PPosition)) {
prop.y = hints->y; prop.x = hints->x;
prop.width = hints->width; prop.y = hints->y;
prop.height = hints->height; }
prop.minWidth = hints->min_width; if (hints->flags & (USSize|PSize)) {
prop.minHeight = hints->min_height; prop.width = hints->width;
prop.maxWidth = hints->max_width; prop.height = hints->height;
prop.maxHeight = hints->max_height; }
prop.widthInc = hints->width_inc; if (hints->flags & PMinSize) {
prop.heightInc = hints->height_inc; prop.minWidth = hints->min_width;
prop.minAspectX = hints->min_aspect.x; prop.minHeight = hints->min_height;
prop.minAspectY = hints->min_aspect.y; }
prop.maxAspectX = hints->max_aspect.x; if (hints->flags & PMaxSize) {
prop.maxAspectY = hints->max_aspect.y; prop.maxWidth = hints->max_width;
prop.maxHeight = hints->max_height;
}
if (hints->flags & PResizeInc) {
prop.widthInc = hints->width_inc;
prop.heightInc = hints->height_inc;
}
if (hints->flags & PAspect) {
prop.minAspectX = hints->min_aspect.x;
prop.minAspectY = hints->min_aspect.y;
prop.maxAspectX = hints->max_aspect.x;
prop.maxAspectY = hints->max_aspect.y;
}
return XChangeProperty (dpy, w, property, XA_WM_SIZE_HINTS, 32, return XChangeProperty (dpy, w, property, XA_WM_SIZE_HINTS, 32,
PropModeReplace, (unsigned char *) &prop, PropModeReplace, (unsigned char *) &prop,
OldNumPropSizeElements); OldNumPropSizeElements);
} }
/* /*
* XSetWMHints sets the property * XSetWMHints sets the property
* WM_HINTS type: WM_HINTS format:32 * WM_HINTS type: WM_HINTS format:32
*/ */
int int
XSetWMHints (dpy, w, wmhints) XSetWMHints (
Display *dpy; Display *dpy,
Window w; Window w,
XWMHints *wmhints; XWMHints *wmhints)
{ {
xPropWMHints prop; xPropWMHints prop;
memset(&prop, 0, sizeof(prop));
prop.flags = wmhints->flags; prop.flags = wmhints->flags;
prop.input = (wmhints->input == True ? 1 : 0); if (wmhints->flags & InputHint)
prop.initialState = wmhints->initial_state; prop.input = (wmhints->input == True ? 1 : 0);
prop.iconPixmap = wmhints->icon_pixmap; if (wmhints->flags & StateHint)
prop.iconWindow = wmhints->icon_window; prop.initialState = wmhints->initial_state;
prop.iconX = wmhints->icon_x; if (wmhints->flags & IconPixmapHint)
prop.iconY = wmhints->icon_y; prop.iconPixmap = wmhints->icon_pixmap;
prop.iconMask = wmhints->icon_mask; if (wmhints->flags & IconWindowHint)
prop.windowGroup = wmhints->window_group; prop.iconWindow = wmhints->icon_window;
if (wmhints->flags & IconPositionHint) {
prop.iconX = wmhints->icon_x;
prop.iconY = wmhints->icon_y;
}
if (wmhints->flags & IconMaskHint)
prop.iconMask = wmhints->icon_mask;
if (wmhints->flags & WindowGroupHint)
prop.windowGroup = wmhints->window_group;
return XChangeProperty (dpy, w, XA_WM_HINTS, XA_WM_HINTS, 32, return XChangeProperty (dpy, w, XA_WM_HINTS, XA_WM_HINTS, 32,
PropModeReplace, (unsigned char *) &prop, PropModeReplace, (unsigned char *) &prop,
NumPropWMHintsElements); NumPropWMHintsElements);
} }
/* /*
* XSetZoomHints sets the property * XSetZoomHints sets the property
* WM_ZOOM_HINTS type: WM_SIZE_HINTS format: 32 * WM_ZOOM_HINTS type: WM_SIZE_HINTS format: 32
*/ */
int int
XSetZoomHints (dpy, w, zhints) XSetZoomHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *zhints; XSizeHints *zhints)
{ {
return XSetSizeHints (dpy, w, zhints, XA_WM_ZOOM_HINTS); return XSetSizeHints (dpy, w, zhints, XA_WM_ZOOM_HINTS);
} }
/* /*
* XSetNormalHints sets the property * XSetNormalHints sets the property
* WM_NORMAL_HINTS type: WM_SIZE_HINTS format: 32 * WM_NORMAL_HINTS type: WM_SIZE_HINTS format: 32
*/ */
int int
XSetNormalHints (dpy, w, hints) /* old routine */ XSetNormalHints ( /* old routine */
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints)
{ {
return XSetSizeHints (dpy, w, hints, XA_WM_NORMAL_HINTS); return XSetSizeHints (dpy, w, hints, XA_WM_NORMAL_HINTS);
} }
...@@ -151,11 +173,11 @@ XSetNormalHints (dpy, w, hints) /* old routine */ ...@@ -151,11 +173,11 @@ XSetNormalHints (dpy, w, hints) /* old routine */
*/ */
int int
XSetIconSizes (dpy, w, list, count) XSetIconSizes (
Display *dpy; Display *dpy,
Window w; /* typically, root */ Window w, /* typically, root */
XIconSize *list; XIconSize *list,
int count; /* number of items on the list */ int count) /* number of items on the list */
{ {
register int i; register int i;
xPropIconSize *pp, *prop; xPropIconSize *pp, *prop;
...@@ -173,8 +195,8 @@ XSetIconSizes (dpy, w, list, count) ...@@ -173,8 +195,8 @@ XSetIconSizes (dpy, w, list, count)
pp += 1; pp += 1;
list += 1; list += 1;
} }
XChangeProperty (dpy, w, XA_WM_ICON_SIZE, XA_WM_ICON_SIZE, 32, XChangeProperty (dpy, w, XA_WM_ICON_SIZE, XA_WM_ICON_SIZE, 32,
PropModeReplace, (unsigned char *) prop, PropModeReplace, (unsigned char *) prop,
count * NumPropIconSizeElements); count * NumPropIconSizeElements);
Xfree ((char *)prop); Xfree ((char *)prop);
} }
...@@ -182,11 +204,11 @@ XSetIconSizes (dpy, w, list, count) ...@@ -182,11 +204,11 @@ XSetIconSizes (dpy, w, list, count)
} }
int int
XSetCommand (dpy, w, argv, argc) XSetCommand (
Display *dpy; Display *dpy,
Window w; Window w,
char **argv; char **argv,
int argc; int argc)
{ {
register int i; register int i;
register int nbytes; register int nbytes;
...@@ -194,10 +216,10 @@ XSetCommand (dpy, w, argv, argc) ...@@ -194,10 +216,10 @@ XSetCommand (dpy, w, argv, argc)
for (i = 0, nbytes = 0; i < argc; i++) { for (i = 0, nbytes = 0; i < argc; i++) {
nbytes += safestrlen(argv[i]) + 1; nbytes += safestrlen(argv[i]) + 1;
} }
if ((bp = buf = Xmalloc((unsigned) nbytes))) { if ((bp = buf = Xmalloc((unsigned) nbytes))) {
/* copy arguments into single buffer */ /* copy arguments into single buffer */
for (i = 0; i < argc; i++) { for (i = 0; i < argc; i++) {
if (argv[i]) { if (argv[i]) {
(void) strcpy(bp, argv[i]); (void) strcpy(bp, argv[i]);
bp += strlen(argv[i]) + 1; bp += strlen(argv[i]) + 1;
} }
...@@ -206,11 +228,11 @@ XSetCommand (dpy, w, argv, argc) ...@@ -206,11 +228,11 @@ XSetCommand (dpy, w, argv, argc)
} }
XChangeProperty (dpy, w, XA_WM_COMMAND, XA_STRING, 8, XChangeProperty (dpy, w, XA_WM_COMMAND, XA_STRING, 8,
PropModeReplace, (unsigned char *)buf, nbytes); PropModeReplace, (unsigned char *)buf, nbytes);
Xfree(buf); Xfree(buf);
} }
return 1; return 1;
} }
/* /*
* XSetStandardProperties sets the following properties: * XSetStandardProperties sets the following properties:
* WM_NAME type: STRING format: 8 * WM_NAME type: STRING format: 8
* WM_ICON_NAME type: STRING format: 8 * WM_ICON_NAME type: STRING format: 8
...@@ -245,7 +267,7 @@ XSetStandardProperties ( ...@@ -245,7 +267,7 @@ XSetStandardProperties (
phints.flags |= IconPixmapHint; phints.flags |= IconPixmapHint;
} }
if (argv != NULL) XSetCommand(dpy, w, argv, argc); if (argv != NULL) XSetCommand(dpy, w, argv, argc);
if (hints != NULL) XSetNormalHints(dpy, w, hints); if (hints != NULL) XSetNormalHints(dpy, w, hints);
if (phints.flags != 0) XSetWMHints(dpy, w, &phints); if (phints.flags != 0) XSetWMHints(dpy, w, &phints);
...@@ -254,20 +276,20 @@ XSetStandardProperties ( ...@@ -254,20 +276,20 @@ XSetStandardProperties (
} }
int int
XSetTransientForHint(dpy, w, propWindow) XSetTransientForHint(
Display *dpy; Display *dpy,
Window w; Window w,
Window propWindow; Window propWindow)
{ {
return XChangeProperty(dpy, w, XA_WM_TRANSIENT_FOR, XA_WINDOW, 32, return XChangeProperty(dpy, w, XA_WM_TRANSIENT_FOR, XA_WINDOW, 32,
PropModeReplace, (unsigned char *) &propWindow, 1); PropModeReplace, (unsigned char *) &propWindow, 1);
} }
int int
XSetClassHint(dpy, w, classhint) XSetClassHint(
Display *dpy; Display *dpy,
Window w; Window w,
XClassHint *classhint; XClassHint *classhint)
{ {
char *class_string; char *class_string;
char *s; char *s;
...@@ -275,7 +297,7 @@ XSetClassHint(dpy, w, classhint) ...@@ -275,7 +297,7 @@ XSetClassHint(dpy, w, classhint)
len_nm = safestrlen(classhint->res_name); len_nm = safestrlen(classhint->res_name);
len_cl = safestrlen(classhint->res_class); len_cl = safestrlen(classhint->res_class);
if ((class_string = s = Xmalloc((unsigned) (len_nm + len_cl + 2)))) { if ((class_string = s = Xmalloc((unsigned) (len_nm + len_cl + 2)))) {
if (len_nm) { if (len_nm) {
strcpy(s, classhint->res_name); strcpy(s, classhint->res_name);
s += len_nm + 1; s += len_nm + 1;
...@@ -287,7 +309,7 @@ XSetClassHint(dpy, w, classhint) ...@@ -287,7 +309,7 @@ XSetClassHint(dpy, w, classhint)
else else
*s = '\0'; *s = '\0';
XChangeProperty(dpy, w, XA_WM_CLASS, XA_STRING, 8, XChangeProperty(dpy, w, XA_WM_CLASS, XA_STRING, 8,
PropModeReplace, (unsigned char *) class_string, PropModeReplace, (unsigned char *) class_string,
len_nm+len_cl+2); len_nm+len_cl+2);
Xfree(class_string); Xfree(class_string);
} }
......
...@@ -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
XSetInputFocus(dpy, focus, revert_to, time) XSetInputFocus(
register Display *dpy; register Display *dpy,
Window focus; Window focus,
int revert_to; int revert_to,
Time time; Time time)
{ {
register xSetInputFocusReq *req; register xSetInputFocusReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -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
XSetLineAttributes(dpy, gc, linewidth, linestyle, capstyle, joinstyle) XSetLineAttributes(
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned int linewidth; /* CARD16 */ unsigned int linewidth, /* CARD16 */
int linestyle; int linestyle,
int capstyle; int capstyle,
int joinstyle; int joinstyle)
{ {
XGCValues *gv = &gc->values; XGCValues *gv = &gc->values;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* OMRON, NTT SOFTWARE, AND NTT, DISCLAIM ALL WARRANTIES WITH REGARD * OMRON, NTT SOFTWARE, AND NTT, DISCLAIM ALL WARRANTIES WITH REGARD
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL OMRON, NTT SOFTWARE, OR NTT, BE * AND FITNESS, IN NO EVENT SHALL OMRON, NTT SOFTWARE, OR NTT, 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.
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
* Authors: Li Yuhong OMRON Corporation * Authors: Li Yuhong OMRON Corporation
* Tetsuya Kato NTT Software Corporation * Tetsuya Kato NTT Software Corporation
* Hiroshi Kuribayashi OMRON Corporation * Hiroshi Kuribayashi OMRON Corporation
* *
*/ */
/* /*
...@@ -118,7 +118,7 @@ _Xsetlocale( ...@@ -118,7 +118,7 @@ _Xsetlocale(
#else /* X_LOCALE */ #else /* X_LOCALE */
#ifdef __DARWIN__ #if defined(__APPLE__) || defined(__CYGWIN__)
char * char *
_Xsetlocale( _Xsetlocale(
int category, int category,
...@@ -127,7 +127,7 @@ _Xsetlocale( ...@@ -127,7 +127,7 @@ _Xsetlocale(
{ {
return setlocale(category, name); return setlocale(category, name);
} }
#endif /* __DARWIN__ */ #endif /* __APPLE__ || __CYGWIN__ */
/* /*
* _XlcMapOSLocaleName is an implementation dependent routine that derives * _XlcMapOSLocaleName is an implementation dependent routine that derives
...@@ -135,12 +135,12 @@ _Xsetlocale( ...@@ -135,12 +135,12 @@ _Xsetlocale(
* returned by setlocale. * returned by setlocale.
* *
* Should match the code in Xt ExtractLocaleName. * Should match the code in Xt ExtractLocaleName.
* *
* This function name is a bit of a misnomer. Even the siname parameter * This function name is a bit of a misnomer. Even the siname parameter
* name is a misnomer. On most modern operating systems this function is * name is a misnomer. On most modern operating systems this function is
* a no-op, simply returning the osname; but on older operating systems * a no-op, simply returning the osname; but on older operating systems
* like Ultrix, or HPUX 9.x and earlier, when you set LANG=german.88591 * like Ultrix, or HPUX 9.x and earlier, when you set LANG=german.88591
* then the string returned by setlocale(LC_ALL, "") will look something * then the string returned by setlocale(LC_ALL, "") will look something
* like: "german.88591 german.88591 ... german.88591". Then this function * like: "german.88591 german.88591 ... german.88591". Then this function
* will pick out the LC_CTYPE component and return a pointer to that. * will pick out the LC_CTYPE component and return a pointer to that.
*/ */
...@@ -208,7 +208,7 @@ _XlcMapOSLocaleName( ...@@ -208,7 +208,7 @@ _XlcMapOSLocaleName(
start = osname; start = osname;
# endif # endif
# ifdef STARTCHAR # ifdef STARTCHAR
if (start && (start = strchr (start, STARTCHAR))) if (start && (start = strchr (start, STARTCHAR)))
# elif defined (STARTSTR) # elif defined (STARTSTR)
if (start && (start = strstr (start,STARTSTR))) if (start && (start = strstr (start,STARTSTR)))
# endif # endif
......
...@@ -59,15 +59,16 @@ from The Open Group. ...@@ -59,15 +59,16 @@ from The Open Group.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
void XSetWMSizeHints (dpy, w, hints, prop) void XSetWMSizeHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints,
Atom prop; Atom prop)
{ {
xPropSizeHints data; xPropSizeHints data;
data.flags = (hints->flags & memset(&data, 0, sizeof(data));
data.flags = (hints->flags &
(USPosition|USSize|PPosition|PSize|PMinSize|PMaxSize| (USPosition|USSize|PPosition|PSize|PMinSize|PMaxSize|
PResizeInc|PAspect|PBaseSize|PWinGravity)); PResizeInc|PAspect|PBaseSize|PWinGravity));
...@@ -75,35 +76,51 @@ void XSetWMSizeHints (dpy, w, hints, prop) ...@@ -75,35 +76,51 @@ void XSetWMSizeHints (dpy, w, hints, prop)
* The x, y, width, and height fields are obsolete; but, applications * The x, y, width, and height fields are obsolete; but, applications
* that want to work with old window managers might set them. * that want to work with old window managers might set them.
*/ */
data.x = hints->x; if (hints->flags & (USPosition|PPosition)) {
data.y = hints->y; data.x = hints->x;
data.width = hints->width; data.y = hints->y;
data.height = hints->height; }
if (hints->flags & (USSize|PSize)) {
data.minWidth = hints->min_width; data.width = hints->width;
data.minHeight = hints->min_height; data.height = hints->height;
data.maxWidth = hints->max_width; }
data.maxHeight = hints->max_height;
data.widthInc = hints->width_inc; if (hints->flags & PMinSize) {
data.heightInc = hints->height_inc; data.minWidth = hints->min_width;
data.minAspectX = hints->min_aspect.x; data.minHeight = hints->min_height;
data.minAspectY = hints->min_aspect.y; }
data.maxAspectX = hints->max_aspect.x; if (hints->flags & PMaxSize) {
data.maxAspectY = hints->max_aspect.y; data.maxWidth = hints->max_width;
data.baseWidth = hints->base_width; data.maxHeight = hints->max_height;
data.baseHeight = hints->base_height; }
data.winGravity = hints->win_gravity; if (hints->flags & PResizeInc) {
data.widthInc = hints->width_inc;
data.heightInc = hints->height_inc;
}
if (hints->flags & PAspect) {
data.minAspectX = hints->min_aspect.x;
data.minAspectY = hints->min_aspect.y;
data.maxAspectX = hints->max_aspect.x;
data.maxAspectY = hints->max_aspect.y;
}
if (hints->flags & PBaseSize) {
data.baseWidth = hints->base_width;
data.baseHeight = hints->base_height;
}
if (hints->flags & PWinGravity) {
data.winGravity = hints->win_gravity;
}
XChangeProperty (dpy, w, prop, XA_WM_SIZE_HINTS, 32, XChangeProperty (dpy, w, prop, XA_WM_SIZE_HINTS, 32,
PropModeReplace, (unsigned char *) &data, PropModeReplace, (unsigned char *) &data,
NumPropSizeElements); NumPropSizeElements);
} }
void XSetWMNormalHints (dpy, w, hints) void XSetWMNormalHints (
Display *dpy; Display *dpy,
Window w; Window w,
XSizeHints *hints; XSizeHints *hints)
{ {
XSetWMSizeHints (dpy, w, hints, XA_WM_NORMAL_HINTS); XSetWMSizeHints (dpy, w, hints, XA_WM_NORMAL_HINTS);
} }
......
...@@ -30,17 +30,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,17 +30,17 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetPlaneMask (dpy, gc, planemask) XSetPlaneMask (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
unsigned long planemask; /* CARD32 */ unsigned long planemask) /* CARD32 */
{ {
LockDisplay(dpy); LockDisplay(dpy);
if (gc->values.plane_mask != planemask) { if (gc->values.plane_mask != planemask) {
gc->values.plane_mask = planemask; gc->values.plane_mask = planemask;
gc->dirty |= GCPlaneMask; gc->dirty |= GCPlaneMask;
} }
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
return 1; return 1;
} }
...@@ -44,7 +44,7 @@ XSetPointerMapping ( ...@@ -44,7 +44,7 @@ XSetPointerMapping (
req->nElts = nmaps; req->nElts = nmaps;
req->length += (nmaps + 3)>>2; req->length += (nmaps + 3)>>2;
Data (dpy, (char *)map, (long) nmaps); Data (dpy, (char *)map, (long) nmaps);
if (_XReply (dpy, (xReply *)&rep, 0, xFalse) == 0) if (_XReply (dpy, (xReply *)&rep, 0, xFalse) == 0)
rep.success = MappingSuccess; rep.success = MappingSuccess;
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
...@@ -52,14 +52,13 @@ XSetPointerMapping ( ...@@ -52,14 +52,13 @@ XSetPointerMapping (
} }
int int
XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode, XChangeKeyboardMapping (
keysyms, nkeycodes) register Display *dpy,
register Display *dpy; int first_keycode,
int first_keycode; int keysyms_per_keycode,
int keysyms_per_keycode; KeySym *keysyms,
KeySym *keysyms; int nkeycodes)
int nkeycodes; {
{
register long nbytes; register long nbytes;
register xChangeKeyboardMappingReq *req; register xChangeKeyboardMappingReq *req;
...@@ -68,7 +67,6 @@ XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode, ...@@ -68,7 +67,6 @@ XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode,
req->firstKeyCode = first_keycode; req->firstKeyCode = first_keycode;
req->keyCodes = nkeycodes; req->keyCodes = nkeycodes;
req->keySymsPerKeyCode = keysyms_per_keycode; req->keySymsPerKeyCode = keysyms_per_keycode;
req->firstKeyCode = first_keycode;
req->length += nkeycodes * keysyms_per_keycode; req->length += nkeycodes * keysyms_per_keycode;
nbytes = keysyms_per_keycode * nkeycodes * 4; nbytes = keysyms_per_keycode * nkeycodes * 4;
Data32 (dpy, (long *)keysyms, nbytes); Data32 (dpy, (long *)keysyms, nbytes);
...@@ -76,4 +74,3 @@ XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode, ...@@ -76,4 +74,3 @@ XChangeKeyboardMapping (dpy, first_keycode, keysyms_per_keycode,
SyncHandle(); SyncHandle();
return 0; return 0;
} }
...@@ -35,12 +35,12 @@ from The Open Group. ...@@ -35,12 +35,12 @@ from The Open Group.
#include "Xatomtype.h" #include "Xatomtype.h"
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
void XSetRGBColormaps (dpy, w, cmaps, count, property) void XSetRGBColormaps (
Display *dpy; Display *dpy,
Window w; Window w,
XStandardColormap *cmaps; XStandardColormap *cmaps,
int count; int count,
Atom property; /* XA_RGB_BEST_MAP, etc. */ Atom property) /* XA_RGB_BEST_MAP, etc. */
{ {
register int i; /* iterator variable */ register int i; /* iterator variable */
register xPropStandardColormap *map; /* tmp variable, data in prop */ register xPropStandardColormap *map; /* tmp variable, data in prop */
...@@ -48,7 +48,7 @@ void XSetRGBColormaps (dpy, w, cmaps, count, property) ...@@ -48,7 +48,7 @@ void XSetRGBColormaps (dpy, w, cmaps, count, property)
xPropStandardColormap *data, tmpdata; /* scratch data */ xPropStandardColormap *data, tmpdata; /* scratch data */
int mode = PropModeReplace; /* for partial writes */ int mode = PropModeReplace; /* for partial writes */
Bool alloced_scratch_space; /* do we need to free? */ Bool alloced_scratch_space; /* do we need to free? */
if (count < 1) return; if (count < 1) return;
......
...@@ -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
XSetSelectionOwner(dpy, selection, owner, time) XSetSelectionOwner(
register Display *dpy; register Display *dpy,
Atom selection; Atom selection,
Window owner; Window owner,
Time time; Time time)
{ {
register xSetSelectionOwnerReq *req; register xSetSelectionOwnerReq *req;
......
...@@ -30,9 +30,12 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,9 +30,12 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XSetScreenSaver(dpy, timeout, interval, prefer_blank, allow_exp) XSetScreenSaver(
register Display *dpy; register Display *dpy,
int timeout, interval, prefer_blank, allow_exp; int timeout,
int interval,
int prefer_blank,
int allow_exp)
{ {
register xSetScreenSaverReq *req; register xSetScreenSaverReq *req;
......
...@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,13 @@ Copyright 1987 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
...@@ -56,16 +56,16 @@ SOFTWARE. ...@@ -56,16 +56,16 @@ SOFTWARE.
/* /*
* WARNING * WARNING
* *
* This is a pre-ICCCM routine. It must not reference any of the new fields * This is a pre-ICCCM routine. It must not reference any of the new fields
* in the XStandardColormap structure. * in the XStandardColormap structure.
*/ */
void XSetStandardColormap(dpy, w, cmap, property) void XSetStandardColormap(
Display *dpy; Display *dpy,
Window w; Window w,
XStandardColormap *cmap; XStandardColormap *cmap,
Atom property; /* XA_RGB_BEST_MAP, etc. */ Atom property) /* XA_RGB_BEST_MAP, etc. */
{ {
Screen *sp; Screen *sp;
XStandardColormap stdcmap; XStandardColormap stdcmap;
...@@ -87,6 +87,9 @@ void XSetStandardColormap(dpy, w, cmap, property) ...@@ -87,6 +87,9 @@ void XSetStandardColormap(dpy, w, cmap, property)
stdcmap.visualid = sp->root_visual->visualid; stdcmap.visualid = sp->root_visual->visualid;
stdcmap.killid = None; /* don't know how to kill this one */ stdcmap.killid = None; /* don't know how to kill this one */
#ifdef XCMS
XSetRGBColormaps (dpy, w, &stdcmap, 1, property); XSetRGBColormaps (dpy, w, &stdcmap, 1, property);
#endif
return; return;
} }
...@@ -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
XSetState(dpy, gc, foreground, background, function, planemask) XSetState(
register Display *dpy; register Display *dpy,
GC gc; GC gc,
int function; unsigned long foreground,
unsigned long planemask; unsigned long background,
unsigned long foreground, background; int function,
unsigned long planemask)
{ {
XGCValues *gv = &gc->values; XGCValues *gv = &gc->values;
......
...@@ -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
XSetStipple (dpy, gc, stipple) XSetStipple (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
Pixmap stipple; Pixmap stipple)
{ {
LockDisplay(dpy); LockDisplay(dpy);
/* always update, since client may have changed pixmap contents */ /* always update, since client may have changed pixmap contents */
......
...@@ -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
XSetTSOrigin (dpy, gc, x, y) XSetTSOrigin (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
int x, y; int x,
int y)
{ {
XGCValues *gv = &gc->values; XGCValues *gv = &gc->values;
......
...@@ -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
XSetTile (dpy, gc, tile) XSetTile (
register Display *dpy; register Display *dpy,
GC gc; GC gc,
Pixmap tile; Pixmap tile)
{ {
LockDisplay(dpy); LockDisplay(dpy);
/* always update, since client may have changed pixmap contents */ /* always update, since client may have changed pixmap contents */
......
...@@ -3,13 +3,13 @@ Copyright 1988 by Wyse Technology, Inc., San Jose, Ca. ...@@ -3,13 +3,13 @@ Copyright 1988 by Wyse Technology, Inc., San Jose, Ca.
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 Wyse not be supporting documentation, and that the name of Wyse 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.
WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WYSE 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
...@@ -57,36 +57,36 @@ from The Open Group. ...@@ -57,36 +57,36 @@ from The Open Group.
#include <nx-X11/Xos.h> #include <nx-X11/Xos.h>
#include <stdio.h> #include <stdio.h>
void XSetTextProperty (dpy, w, tp, property) void XSetTextProperty (
Display *dpy; Display *dpy,
Window w; Window w,
Atom property; XTextProperty *tp,
XTextProperty *tp; Atom property)
{ {
XChangeProperty (dpy, w, property, tp->encoding, tp->format, XChangeProperty (dpy, w, property, tp->encoding, tp->format,
PropModeReplace, tp->value, tp->nitems); PropModeReplace, tp->value, tp->nitems);
} }
void XSetWMName (dpy, w, tp) void XSetWMName (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
XSetTextProperty (dpy, w, tp, XA_WM_NAME); XSetTextProperty (dpy, w, tp, XA_WM_NAME);
} }
void XSetWMIconName (dpy, w, tp) void XSetWMIconName (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
XSetTextProperty (dpy, w, tp, XA_WM_ICON_NAME); XSetTextProperty (dpy, w, tp, XA_WM_ICON_NAME);
} }
void XSetWMClientMachine (dpy, w, tp) void XSetWMClientMachine (
Display *dpy; Display *dpy,
Window w; Window w,
XTextProperty *tp; XTextProperty *tp)
{ {
XSetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE); XSetTextProperty (dpy, w, tp, XA_WM_CLIENT_MACHINE);
} }
......
...@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,13 @@ Copyright 1987 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
...@@ -52,16 +52,16 @@ SOFTWARE. ...@@ -52,16 +52,16 @@ SOFTWARE.
#include "Xlibint.h" #include "Xlibint.h"
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
/* /*
* XSetWMProtocols sets the property * XSetWMProtocols sets the property
* WM_COLORMAP_WINDOWS type: WINDOW format:32 * WM_COLORMAP_WINDOWS type: WINDOW format:32
*/ */
Status XSetWMColormapWindows (dpy, w, windows, count) Status XSetWMColormapWindows (
Display *dpy; Display *dpy,
Window w; Window w,
Window *windows; Window *windows,
int count; int count)
{ {
Atom prop; Atom prop;
......
...@@ -28,13 +28,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. ...@@ -28,13 +28,13 @@ Copyright 1987 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
...@@ -52,16 +52,16 @@ SOFTWARE. ...@@ -52,16 +52,16 @@ SOFTWARE.
#include "Xlibint.h" #include "Xlibint.h"
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
/* /*
* XSetWMProtocols sets the property * XSetWMProtocols sets the property
* WM_PROTOCOLS type: ATOM format: 32 * WM_PROTOCOLS type: ATOM format: 32
*/ */
Status XSetWMProtocols (dpy, w, protocols, count) Status XSetWMProtocols (
Display *dpy; Display *dpy,
Window w; Window w,
Atom *protocols; Atom *protocols,
int count; int count)
{ {
Atom prop; Atom prop;
......
...@@ -31,7 +31,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -31,7 +31,7 @@ in this Software without prior written authorization from The Open Group.
#include <nx-X11/Xatom.h> #include <nx-X11/Xatom.h>
/* insulate predefined atom numbers from cut routines */ /* insulate predefined atom numbers from cut routines */
static Atom n_to_atom[8] = { static const Atom n_to_atom[8] = {
XA_CUT_BUFFER0, XA_CUT_BUFFER0,
XA_CUT_BUFFER1, XA_CUT_BUFFER1,
XA_CUT_BUFFER2, XA_CUT_BUFFER2,
...@@ -42,17 +42,20 @@ static Atom n_to_atom[8] = { ...@@ -42,17 +42,20 @@ static Atom n_to_atom[8] = {
XA_CUT_BUFFER7}; XA_CUT_BUFFER7};
int int
XRotateBuffers (dpy, rotate) XRotateBuffers (
register Display *dpy; register Display *dpy,
int rotate; int rotate)
{ {
return XRotateWindowProperties(dpy, RootWindow(dpy, 0), n_to_atom, 8, rotate); /* XRotateWindowProperties wants a non-const Atom*, but it doesn't
* modify it, so this is safe.
*/
return XRotateWindowProperties(dpy, RootWindow(dpy, 0), (Atom *)n_to_atom, 8, rotate);
} }
char *XFetchBuffer (dpy, nbytes, buffer) char *XFetchBuffer (
register Display *dpy; register Display *dpy,
int *nbytes; int *nbytes,
register int buffer; register int buffer)
{ {
Atom actual_type; Atom actual_type;
int actual_format; int actual_format;
...@@ -62,8 +65,8 @@ char *XFetchBuffer (dpy, nbytes, buffer) ...@@ -62,8 +65,8 @@ char *XFetchBuffer (dpy, nbytes, buffer)
*nbytes = 0; *nbytes = 0;
if ((buffer < 0) || (buffer > 7)) return (NULL); if ((buffer < 0) || (buffer > 7)) return (NULL);
/* XXX should be (sizeof (maxint) - 1)/4 */ /* XXX should be (sizeof (maxint) - 1)/4 */
if (XGetWindowProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer], if (XGetWindowProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer],
0L, 10000000L, False, XA_STRING, 0L, 10000000L, False, XA_STRING,
&actual_type, &actual_format, &nitems, &leftover, &data) != Success) { &actual_type, &actual_format, &nitems, &leftover, &data) != Success) {
return (NULL); return (NULL);
} }
...@@ -75,9 +78,9 @@ char *XFetchBuffer (dpy, nbytes, buffer) ...@@ -75,9 +78,9 @@ char *XFetchBuffer (dpy, nbytes, buffer)
return(NULL); return(NULL);
} }
char *XFetchBytes (dpy, nbytes) char *XFetchBytes (
register Display *dpy; register Display *dpy,
int *nbytes; int *nbytes)
{ {
return (XFetchBuffer (dpy, nbytes, 0)); return (XFetchBuffer (dpy, nbytes, 0));
} }
...@@ -90,7 +93,7 @@ XStoreBuffer ( ...@@ -90,7 +93,7 @@ XStoreBuffer (
register int buffer) register int buffer)
{ {
if ((buffer < 0) || (buffer > 7)) return 0; if ((buffer < 0) || (buffer > 7)) return 0;
return XChangeProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer], return XChangeProperty(dpy, RootWindow(dpy, 0), n_to_atom[buffer],
XA_STRING, 8, PropModeReplace, (unsigned char *) bytes, nbytes); XA_STRING, 8, PropModeReplace, (unsigned char *) bytes, nbytes);
} }
......
...@@ -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
XStoreColor(dpy, cmap, def) XStoreColor(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *def; XColor *def)
{ {
xColorItem *citem; xColorItem *citem;
register xStoreColorsReq *req; register xStoreColorsReq *req;
......
...@@ -30,17 +30,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,17 +30,17 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XStoreColors(dpy, cmap, defs, ncolors) XStoreColors(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap,
XColor *defs; XColor *defs,
int ncolors; int ncolors)
{ {
register int i; register int i;
xColorItem citem; xColorItem citem;
register xStoreColorsReq *req; register xStoreColorsReq *req;
LockDisplay(dpy); LockDisplay(dpy);
GetReq(StoreColors, req); GetReq(StoreColors, req);
req->cmap = cmap; req->cmap = cmap;
...@@ -56,7 +56,7 @@ int ncolors; ...@@ -56,7 +56,7 @@ int ncolors;
/* note that xColorItem doesn't contain all 16-bit quantities, so /* note that xColorItem doesn't contain all 16-bit quantities, so
we can't use Data16 */ we can't use Data16 */
Data(dpy, (char *)&citem, (long) SIZEOF(xColorItem)); Data(dpy, (char *)&citem, (long) SIZEOF(xColorItem));
/* assume size is 4*n */ /* assume size is 4*n */
} }
UnlockDisplay(dpy); UnlockDisplay(dpy);
......
...@@ -46,6 +46,7 @@ int flags) /* DoRed, DoGreen, DoBlue */ ...@@ -46,6 +46,7 @@ int flags) /* DoRed, DoGreen, DoBlue */
XcmsColor cmsColor_exact; XcmsColor cmsColor_exact;
XColor scr_def; XColor scr_def;
#ifdef XCMS
/* /*
* Let's Attempt to use Xcms approach to Parse Color * Let's Attempt to use Xcms approach to Parse Color
*/ */
...@@ -62,6 +63,7 @@ int flags) /* DoRed, DoGreen, DoBlue */ ...@@ -62,6 +63,7 @@ int flags) /* DoRed, DoGreen, DoBlue */
* name. Thus pass name to the X Server. * name. Thus pass name to the X Server.
*/ */
} }
#endif
/* /*
* The Xcms and i18n methods failed, so lets pass it to the server * The Xcms and i18n methods failed, so lets pass it to the server
......
...@@ -36,7 +36,7 @@ XStoreName ( ...@@ -36,7 +36,7 @@ XStoreName (
Window w, Window w,
_Xconst char *name) _Xconst char *name)
{ {
return XChangeProperty(dpy, w, XA_WM_NAME, XA_STRING, return XChangeProperty(dpy, w, XA_WM_NAME, XA_STRING,
8, PropModeReplace, (unsigned char *)name, 8, PropModeReplace, (unsigned char *)name,
name ? strlen(name) : 0); name ? strlen(name) : 0);
} }
...@@ -47,7 +47,7 @@ XSetIconName ( ...@@ -47,7 +47,7 @@ XSetIconName (
Window w, Window w,
_Xconst char *icon_name) _Xconst char *icon_name)
{ {
return XChangeProperty(dpy, w, XA_WM_ICON_NAME, XA_STRING, return XChangeProperty(dpy, w, XA_WM_ICON_NAME, XA_STRING,
8, PropModeReplace, (unsigned char *)icon_name, 8, PropModeReplace, (unsigned char *)icon_name,
icon_name ? strlen(icon_name) : 0); icon_name ? strlen(icon_name) : 0);
} }
...@@ -53,7 +53,7 @@ _XInitKeysymDB(void) ...@@ -53,7 +53,7 @@ _XInitKeysymDB(void)
{ {
if (!initialized) if (!initialized)
{ {
char *dbname; const char *dbname;
XrmInitialize(); XrmInitialize();
/* use and name of this env var is not part of the standard */ /* use and name of this env var is not part of the standard */
......
...@@ -32,16 +32,16 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,16 +32,16 @@ in this Software without prior written authorization from The Open Group.
#include <nx-X11/Xutil.h> #include <nx-X11/Xutil.h>
/* /*
* XStringListToTextProperty - fill in TextProperty structure with * XStringListToTextProperty - fill in TextProperty structure with
* concatenated list of null-separated strings. Return True if successful * concatenated list of null-separated strings. Return True if successful
* else False. Allocate room on end for trailing NULL, but don't include in * else False. Allocate room on end for trailing NULL, but don't include in
* count. * count.
*/ */
Status XStringListToTextProperty (argv, argc, textprop) Status XStringListToTextProperty (
char **argv; char **argv,
int argc; int argc,
XTextProperty *textprop; XTextProperty *textprop)
{ {
register int i; register int i;
register unsigned int nbytes; register unsigned int nbytes;
......
...@@ -32,9 +32,9 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,9 +32,9 @@ in this Software without prior written authorization from The Open Group.
/* Synchronize with errors and events, optionally discarding pending events */ /* Synchronize with errors and events, optionally discarding pending events */
int int
XSync (dpy, discard) XSync (
register Display *dpy; register Display *dpy,
Bool discard; Bool discard)
{ {
xGetInputFocusReply rep; xGetInputFocusReply rep;
register xReq *req; register xReq *req;
......
...@@ -38,7 +38,7 @@ XDrawString16( ...@@ -38,7 +38,7 @@ XDrawString16(
int y, int y,
_Xconst XChar2b *string, _Xconst XChar2b *string,
int length) int length)
{ {
int Datalength = 0; int Datalength = 0;
register xPolyText16Req *req; register xPolyText16Req *req;
...@@ -60,11 +60,11 @@ XDrawString16( ...@@ -60,11 +60,11 @@ XDrawString16(
req->length += (Datalength + 3)>>2; /* convert to number of 32-bit words */ req->length += (Datalength + 3)>>2; /* convert to number of 32-bit words */
/* /*
* If the entire request does not fit into the remaining space in the * If the entire request does not fit into the remaining space in the
* buffer, flush the buffer first. If the request does fit into the * buffer, flush the buffer first. If the request does fit into the
* empty buffer, then we won't have to flush it at the end to keep * empty buffer, then we won't have to flush it at the end to keep
* the buffer 32-bit aligned. * the buffer 32-bit aligned.
*/ */
if (dpy->bufptr + Datalength > dpy->bufmax) if (dpy->bufptr + Datalength > dpy->bufmax)
...@@ -86,11 +86,11 @@ XDrawString16( ...@@ -86,11 +86,11 @@ XDrawString16(
PartialNChars = PartialNChars - 254; PartialNChars = PartialNChars - 254;
CharacterOffset += 254; CharacterOffset += 254;
} }
if (PartialNChars) if (PartialNChars)
{ {
nbytes = PartialNChars * 2 + SIZEOF(xTextElt); nbytes = PartialNChars * 2 + SIZEOF(xTextElt);
BufAlloc (xTextElt *, elt, nbytes); BufAlloc (xTextElt *, elt, nbytes);
elt->delta = 0; elt->delta = 0;
elt->len = PartialNChars; elt->len = PartialNChars;
memcpy(((char *)elt) + 2, (char *)CharacterOffset, PartialNChars * 2); memcpy(((char *)elt) + 2, (char *)CharacterOffset, PartialNChars * 2);
...@@ -101,23 +101,23 @@ XDrawString16( ...@@ -101,23 +101,23 @@ XDrawString16(
if (Datalength &= 3) { if (Datalength &= 3) {
char *pad; char *pad;
/* /*
* BufAlloc is a macro that uses its last argument more than * BufAlloc is a macro that uses its last argument more than
* once, otherwise I'd write "BufAlloc (char *, pad, 4-length)" * once, otherwise I'd write "BufAlloc (char *, pad, 4-length)"
*/ */
length = 4 - Datalength; length = 4 - Datalength;
BufAlloc (char *, pad, length); BufAlloc (char *, pad, length);
/* /*
* if there are 3 bytes of padding, the first byte MUST be 0 * if there are 3 bytes of padding, the first byte MUST be 0
* so the pad bytes aren't mistaken for a final xTextElt * so the pad bytes aren't mistaken for a final xTextElt
*/ */
*pad = 0; *pad = 0;
} }
/* /*
* If the buffer pointer is not now pointing to a 32-bit boundary, * If the buffer pointer is not now pointing to a 32-bit boundary,
* we must flush the buffer so that it does point to a 32-bit boundary * we must flush the buffer so that it does point to a 32-bit boundary
* at the end of this routine. * at the end of this routine.
*/ */
if ((dpy->bufptr - dpy->buffer) & 3) if ((dpy->bufptr - dpy->buffer) & 3)
......
...@@ -38,10 +38,10 @@ in this Software without prior written authorization from The Open Group. ...@@ -38,10 +38,10 @@ in this Software without prior written authorization from The Open Group.
* null-separated STRING property. * null-separated STRING property.
*/ */
Status XTextPropertyToStringList (tp, list_return, count_return) Status XTextPropertyToStringList (
XTextProperty *tp; XTextProperty *tp,
char ***list_return; char ***list_return,
int *count_return; int *count_return)
{ {
char **list; /* return value */ char **list; /* return value */
int nelements; /* return value */ int nelements; /* return value */
...@@ -74,7 +74,7 @@ Status XTextPropertyToStringList (tp, list_return, count_return) ...@@ -74,7 +74,7 @@ Status XTextPropertyToStringList (tp, list_return, count_return)
*/ */
list = (char **) Xmalloc (nelements * sizeof (char *)); list = (char **) Xmalloc (nelements * sizeof (char *));
if (!list) return False; if (!list) return False;
start = (char *) Xmalloc ((datalen + 1) * sizeof (char)); /* for <NUL> */ start = (char *) Xmalloc ((datalen + 1) * sizeof (char)); /* for <NUL> */
if (!start) { if (!start) {
Xfree ((char *) list); Xfree ((char *) list);
...@@ -107,8 +107,7 @@ Status XTextPropertyToStringList (tp, list_return, count_return) ...@@ -107,8 +107,7 @@ Status XTextPropertyToStringList (tp, list_return, count_return)
} }
void XFreeStringList (list) void XFreeStringList (char **list)
char **list;
{ {
if (list) { if (list) {
if (list[0]) Xfree (list[0]); if (list[0]) Xfree (list[0]);
......
...@@ -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"
Bool XTranslateCoordinates(dpy, src_win, dest_win, src_x, src_y, Bool XTranslateCoordinates(
dst_x, dst_y, child) register Display *dpy,
register Display *dpy; Window src_win,
Window src_win, dest_win; Window dest_win,
int src_x, src_y; int src_x,
int *dst_x, *dst_y; int src_y,
Window *child; int *dst_x,
{ int *dst_y,
Window *child)
{
register xTranslateCoordsReq *req; register xTranslateCoordsReq *req;
xTranslateCoordsReply rep; xTranslateCoordsReply rep;
...@@ -51,7 +53,7 @@ Bool XTranslateCoordinates(dpy, src_win, dest_win, src_x, src_y, ...@@ -51,7 +53,7 @@ Bool XTranslateCoordinates(dpy, src_win, dest_win, src_x, src_y,
SyncHandle(); SyncHandle();
return(False); return(False);
} }
*child = rep.child; *child = rep.child;
*dst_x = cvtINT16toInt (rep.dstX); *dst_x = cvtINT16toInt (rep.dstX);
*dst_y = cvtINT16toInt (rep.dstY); *dst_y = cvtINT16toInt (rep.dstY);
......
/* /*
* $XFree86: xc/lib/XThrStub/UIThrStubs.c,v 3.3 2001/11/18 21:13:26 herrb Exp $
* *
* Copyright (c) 1995 David E. Wexelblat. All rights reserved * Copyright (c) 1995 David E. Wexelblat. All rights reserved
* *
...@@ -10,10 +9,10 @@ ...@@ -10,10 +9,10 @@
* distribute, sublicense, and/or sell copies of the Software, and to * distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to * permit persons to whom the Software is furnished to do so, subject to
* the following conditions: * the following conditions:
* *
* The above copyright notice and this permission notice shall be included * The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software. * in all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
...@@ -21,16 +20,16 @@ ...@@ -21,16 +20,16 @@
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * 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 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE. * OTHER DEALINGS IN THE SOFTWARE.
* *
* Except as contained in this notice, the name of David E. Wexelblat shall * Except as contained in this notice, the name of David E. Wexelblat shall
* not be used in advertising or otherwise to promote the sale, use or * not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization * other dealings in this Software without prior written authorization
* from David E. Wexelblat. * from David E. Wexelblat.
* *
*/ */
/* /*
* Stubs for thread functions needed by the X library. Supports * Stubs for thread functions needed by the X library. Supports
* UnixWare 2.x threads; may support Solaris 2 threads as well, but not * UnixWare 2.x threads; may support Solaris 2 threads as well, but not
* tested. Defining things this way removes the dependency of the X * tested. Defining things this way removes the dependency of the X
* library on the threads library, but still supports threads if the user * library on the threads library, but still supports threads if the user
...@@ -145,7 +144,7 @@ _Xthr_equal_stub_() ...@@ -145,7 +144,7 @@ _Xthr_equal_stub_()
#endif /* SVR4 */ #endif /* SVR4 */
#endif /* CTHREADS */ #endif /* CTHREADS */
static xthread_t static xthread_t
_Xthr_self_stub_() _Xthr_self_stub_()
{ {
static xthread_t _X_no_thread_id; static xthread_t _X_no_thread_id;
...@@ -153,7 +152,7 @@ _Xthr_self_stub_() ...@@ -153,7 +152,7 @@ _Xthr_self_stub_()
return(_X_no_thread_id); /* defined by <X11/Xthreads.h> */ return(_X_no_thread_id); /* defined by <X11/Xthreads.h> */
} }
static int static int
_Xthr_zero_stub_() _Xthr_zero_stub_()
{ {
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
XUndefineCursor (dpy,w) XUndefineCursor (
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xChangeWindowAttributesReq *req; register xChangeWindowAttributesReq *req;
unsigned long defcurs = None; unsigned long defcurs = None;
......
...@@ -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
XUngrabButton(dpy, button, modifiers, grab_window) XUngrabButton(
register Display *dpy; register Display *dpy,
unsigned int button; /* CARD8 */ unsigned int button, /* CARD8 */
unsigned int modifiers; /* CARD16 */ unsigned int modifiers, /* CARD16 */
Window grab_window; Window grab_window)
{ {
register xUngrabButtonReq *req; register xUngrabButtonReq *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
XUngrabKeyboard (dpy, time) XUngrabKeyboard (
register Display *dpy; register Display *dpy,
Time time; Time time)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -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
XUngrabKey(dpy, key, modifiers, grab_window) XUngrabKey(
register Display *dpy; register Display *dpy,
int key; int key,
unsigned int modifiers; unsigned int modifiers,
Window grab_window; Window grab_window)
{ {
register xUngrabKeyReq *req; register xUngrabKeyReq *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
XUngrabPointer(dpy, time) XUngrabPointer(
register Display *dpy; register Display *dpy,
Time time; Time time)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,8 +30,8 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XUngrabServer (dpy) XUngrabServer (
register Display *dpy; register Display *dpy)
{ {
register xReq *req; register xReq *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
XUninstallColormap(dpy, cmap) XUninstallColormap(
register Display *dpy; register Display *dpy,
Colormap cmap; Colormap cmap)
{ {
register xResourceReq *req; register xResourceReq *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
XUnloadFont(dpy, font) XUnloadFont(
register Display *dpy; register Display *dpy,
Font font; Font font)
{ {
register xResourceReq *req; register xResourceReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -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
XUnmapSubwindows(dpy, win) XUnmapSubwindows(
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
XUnmapWindow (dpy, w) XUnmapWindow (
register Display *dpy; register Display *dpy,
Window w; Window w)
{ {
register xResourceReq *req; register xResourceReq *req;
......
...@@ -32,7 +32,7 @@ in this Software without prior written authorization from The Open Group. ...@@ -32,7 +32,7 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h> #include <stdio.h>
/* /*
* This procedure returns a list of visual information structures * This procedure returns a list of visual information structures
* that match the specified attributes given in the visual information * that match the specified attributes given in the visual information
* template. * template.
* *
* If no visuals exist that match the specified attributes, a NULL is * If no visuals exist that match the specified attributes, a NULL is
...@@ -53,12 +53,11 @@ in this Software without prior written authorization from The Open Group. ...@@ -53,12 +53,11 @@ in this Software without prior written authorization from The Open Group.
* VisualAllMask * VisualAllMask
*/ */
XVisualInfo *XGetVisualInfo( dpy, visual_info_mask, XVisualInfo *XGetVisualInfo(
visual_info_template, nitems) Display *dpy,
Display *dpy; register long visual_info_mask,
register long visual_info_mask; register XVisualInfo *visual_info_template,
register XVisualInfo *visual_info_template; int *nitems) /* RETURN */
int *nitems; /* RETURN */
{ {
register Visual *vp; register Visual *vp;
...@@ -76,7 +75,7 @@ int *nitems; /* RETURN */ ...@@ -76,7 +75,7 @@ int *nitems; /* RETURN */
count = 0; count = 0;
total = 10; total = 10;
if (! (vip_base = vip = (XVisualInfo *) if (! (vip_base = vip = (XVisualInfo *)
Xmalloc((unsigned) (sizeof(XVisualInfo) * total)))) { Xmalloc((unsigned) (sizeof(XVisualInfo) * total)))) {
UnlockDisplay(dpy); UnlockDisplay(dpy);
return (XVisualInfo *) NULL; return (XVisualInfo *) NULL;
...@@ -128,13 +127,13 @@ int *nitems; /* RETURN */ ...@@ -128,13 +127,13 @@ int *nitems; /* RETURN */
(vp->bits_per_rgb != visual_info_template->bits_per_rgb)) continue; (vp->bits_per_rgb != visual_info_template->bits_per_rgb)) continue;
/* YEA!!! WE FOUND A GOOD ONE */ /* YEA!!! WE FOUND A GOOD ONE */
if (count+1 > total) if (count+1 > total)
{ {
XVisualInfo *old_vip_base = vip_base; XVisualInfo *old_vip_base = vip_base;
total += 10; total += 10;
if (! (vip_base = (XVisualInfo *) if (! (vip_base = (XVisualInfo *)
Xrealloc((char *) vip_base, Xrealloc((char *) vip_base,
(unsigned) (sizeof(XVisualInfo) * total)))) { (unsigned) (sizeof(XVisualInfo) * total)))) {
Xfree((char *) old_vip_base); Xfree((char *) old_vip_base);
UnlockDisplay(dpy); UnlockDisplay(dpy);
...@@ -160,7 +159,7 @@ int *nitems; /* RETURN */ ...@@ -160,7 +159,7 @@ int *nitems; /* RETURN */
} /* END OF LOOP ON VISUALS */ } /* END OF LOOP ON VISUALS */
} /* END OF IF THERE ARE ANY VISUALS AT THIS DEPTH */ } /* END OF IF THERE ARE ANY VISUALS AT THIS DEPTH */
} /* END OF LOOP ON DEPTHS */ } /* END OF LOOP ON DEPTHS */
} /* END OF LOOP ON SCREENS */ } /* END OF LOOP ON SCREENS */
...@@ -180,21 +179,21 @@ int *nitems; /* RETURN */ ...@@ -180,21 +179,21 @@ int *nitems; /* RETURN */
/* /*
* This procedure will return the visual information for a visual * This procedure will return the visual information for a visual
* that matches the specified depth and class for a screen. Since * that matches the specified depth and class for a screen. Since
* multiple visuals may exist that match the specified depth and * multiple visuals may exist that match the specified depth and
* class, which visual chosen is undefined. * class, which visual chosen is undefined.
* *
* If a visual is found, True is returned as the function value, * If a visual is found, True is returned as the function value,
* otherwise False is returned. * otherwise False is returned.
*/ */
Status XMatchVisualInfo( dpy, screen, depth, class, visual_info) Status XMatchVisualInfo(
Display *dpy; Display *dpy,
int screen; int screen,
int depth; int depth,
int class; int class,
XVisualInfo *visual_info; /* RETURNED */ XVisualInfo *visual_info) /* RETURNED */
{ {
Visual *vp; Visual *vp;
...@@ -225,7 +224,7 @@ Status XMatchVisualInfo( dpy, screen, depth, class, visual_info) ...@@ -225,7 +224,7 @@ Status XMatchVisualInfo( dpy, screen, depth, class, visual_info)
/* if nvisuals == 0 then vp will be NULL */ /* if nvisuals == 0 then vp will be NULL */
for (jj=0; jj<dp->nvisuals; jj++) for (jj=0; jj<dp->nvisuals; jj++)
{ {
if (vp->class == class) if (vp->class == class)
{ {
visual_info->visual = _XVIDtoVisual(dpy, vp->visualid); visual_info->visual = _XVIDtoVisual(dpy, vp->visualid);
visual_info->visualid = vp->visualid; visual_info->visualid = vp->visualid;
......
...@@ -32,13 +32,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, ...@@ -32,13 +32,13 @@ Copyright 1987 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 Wyse not be supporting documentation, and that the name of Wyse 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.
WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WYSE 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
...@@ -60,7 +60,7 @@ SOFTWARE. ...@@ -60,7 +60,7 @@ SOFTWARE.
#include <nx-X11/Xlocale.h> #include <nx-X11/Xlocale.h>
/* /*
* XSetWMProperties sets the following properties: * XSetWMProperties sets the following properties:
* WM_NAME type: TEXT format: varies? * WM_NAME type: TEXT format: varies?
* WM_ICON_NAME type: TEXT format: varies? * WM_ICON_NAME type: TEXT format: varies?
...@@ -69,19 +69,19 @@ SOFTWARE. ...@@ -69,19 +69,19 @@ SOFTWARE.
* WM_CLIENT_MACHINE type: TEXT format: varies? * WM_CLIENT_MACHINE type: TEXT format: varies?
* WM_NORMAL_HINTS type: WM_SIZE_HINTS format: 32 * WM_NORMAL_HINTS type: WM_SIZE_HINTS format: 32
* WM_CLASS type: STRING/STRING format: 8 * WM_CLASS type: STRING/STRING format: 8
* WM_LOCALE_NAME type: STRING format: 8
*/ */
void XSetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints, void XSetWMProperties (
wmHints, classHints) Display *dpy,
Display *dpy; Window w, /* window to decorate */
Window w; /* window to decorate */ XTextProperty *windowName, /* name of application */
XTextProperty *windowName; /* name of application */ XTextProperty *iconName, /* name string for icon */
XTextProperty *iconName; /* name string for icon */ char **argv, /* command line */
char **argv; /* command line */ int argc, /* size of command line */
int argc; /* size of command line */ XSizeHints *sizeHints, /* size hints for window in its normal state */
XSizeHints *sizeHints; /* size hints for window in its normal state */ XWMHints *wmHints, /* miscelaneous window manager hints */
XWMHints *wmHints; /* miscelaneous window manager hints */ XClassHint *classHints) /* resource name and class */
XClassHint *classHints; /* resource name and class */
{ {
XTextProperty textprop; XTextProperty textprop;
char hostName[256]; char hostName[256];
...@@ -107,7 +107,7 @@ void XSetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints, ...@@ -107,7 +107,7 @@ void XSetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints,
textprop.format = 8; textprop.format = 8;
textprop.nitems = len; textprop.nitems = len;
XSetWMClientMachine (dpy, w, &textprop); XSetWMClientMachine (dpy, w, &textprop);
/* set hints about how geometry and window manager interaction */ /* set hints about how geometry and window manager interaction */
if (sizeHints) XSetWMNormalHints (dpy, w, sizeHints); if (sizeHints) XSetWMNormalHints (dpy, w, sizeHints);
if (wmHints) XSetWMHints (dpy, w, wmHints); if (wmHints) XSetWMHints (dpy, w, wmHints);
...@@ -137,7 +137,7 @@ void XSetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints, ...@@ -137,7 +137,7 @@ void XSetWMProperties (dpy, w, windowName, iconName, argv, argc, sizeHints,
} }
XSetClassHint (dpy, w, classHints); XSetClassHint (dpy, w, classHints);
} }
locale = setlocale(LC_CTYPE, (char *)NULL); locale = setlocale(LC_CTYPE, (char *)NULL);
if (locale) if (locale)
XChangeProperty (dpy, w, XInternAtom(dpy, "WM_LOCALE_NAME", False), XChangeProperty (dpy, w, XInternAtom(dpy, "WM_LOCALE_NAME", False),
......
...@@ -30,14 +30,17 @@ in this Software without prior written authorization from The Open Group. ...@@ -30,14 +30,17 @@ in this Software without prior written authorization from The Open Group.
#include "Xlibint.h" #include "Xlibint.h"
int int
XWarpPointer(dpy, src_win, dest_win, src_x, src_y, src_width, src_height, XWarpPointer(
dest_x, dest_y) register Display *dpy,
register Display *dpy; Window src_win,
Window src_win, dest_win; Window dest_win,
int src_x, src_y; int src_x,
unsigned int src_width, src_height; int src_y,
int dest_x, dest_y; unsigned int src_width,
{ unsigned int src_height,
int dest_x,
int dest_y)
{
register xWarpPointerReq *req; register xWarpPointerReq *req;
LockDisplay(dpy); LockDisplay(dpy);
......
...@@ -41,7 +41,7 @@ void _XProcessWindowAttributes ( ...@@ -41,7 +41,7 @@ void _XProcessWindowAttributes (
if (valuemask & CWBackPixmap) if (valuemask & CWBackPixmap)
*value++ = attributes->background_pixmap; *value++ = attributes->background_pixmap;
if (valuemask & CWBackPixel) if (valuemask & CWBackPixel)
*value++ = attributes->background_pixel; *value++ = attributes->background_pixel;
...@@ -59,7 +59,7 @@ void _XProcessWindowAttributes ( ...@@ -59,7 +59,7 @@ void _XProcessWindowAttributes (
if (valuemask & CWBackingStore) if (valuemask & CWBackingStore)
*value++ = attributes->backing_store; *value++ = attributes->backing_store;
if (valuemask & CWBackingPlanes) if (valuemask & CWBackingPlanes)
*value++ = attributes->backing_planes; *value++ = attributes->backing_planes;
...@@ -97,17 +97,19 @@ void _XProcessWindowAttributes ( ...@@ -97,17 +97,19 @@ void _XProcessWindowAttributes (
CWOverrideRedirect|CWSaveUnder|CWEventMask|\ CWOverrideRedirect|CWSaveUnder|CWEventMask|\
CWDontPropagate|CWColormap|CWCursor) CWDontPropagate|CWColormap|CWCursor)
Window XCreateWindow(dpy, parent, x, y, width, height, Window XCreateWindow(
borderWidth, depth, class, visual, valuemask, attributes) 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,
int depth; unsigned int height,
unsigned int class; unsigned int borderWidth,
Visual *visual; int depth,
unsigned long valuemask; unsigned int class,
XSetWindowAttributes *attributes; Visual *visual,
unsigned long valuemask,
XSetWindowAttributes *attributes)
{ {
Window wid; Window wid;
register xCreateWindowReq *req; register xCreateWindowReq *req;
...@@ -129,7 +131,7 @@ Window XCreateWindow(dpy, parent, x, y, width, height, ...@@ -129,7 +131,7 @@ Window XCreateWindow(dpy, parent, x, y, width, height,
wid = req->wid = XAllocID(dpy); wid = req->wid = XAllocID(dpy);
valuemask &= AllMaskBits; valuemask &= AllMaskBits;
if ((req->mask = valuemask)) if ((req->mask = valuemask))
_XProcessWindowAttributes (dpy, (xChangeWindowAttributesReq *)req, _XProcessWindowAttributes (dpy, (xChangeWindowAttributesReq *)req,
valuemask, attributes); valuemask, attributes);
UnlockDisplay(dpy); UnlockDisplay(dpy);
SyncHandle(); SyncHandle();
......
...@@ -4,13 +4,13 @@ Copyright 1988 by Wyse Technology, Inc., San Jose, Ca., ...@@ -4,13 +4,13 @@ Copyright 1988 by Wyse Technology, Inc., San Jose, Ca.,
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 Wyse not be supporting documentation, and that the name Wyse 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.
WYSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WYSE 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
...@@ -62,10 +62,10 @@ from The Open Group. ...@@ -62,10 +62,10 @@ from The Open Group.
* This function instructs the window manager to change this window from * This function instructs the window manager to change this window from
* NormalState or IconicState to Withdrawn. * NormalState or IconicState to Withdrawn.
*/ */
Status XWithdrawWindow (dpy, w, screen) Status XWithdrawWindow (
Display *dpy; Display *dpy,
Window w; Window w,
int screen; int screen)
{ {
XUnmapEvent ev; XUnmapEvent ev;
Window root = RootWindow (dpy, screen); Window root = RootWindow (dpy, screen);
......
...@@ -34,7 +34,7 @@ from The Open Group. ...@@ -34,7 +34,7 @@ from The Open Group.
#include "Xutil.h" #include "Xutil.h"
#include <stdio.h> #include <stdio.h>
#define ERR_RETURN 0 #define ERR_RETURN NULL
static char *Format_Image( static char *Format_Image(
XImage *image, XImage *image,
...@@ -80,7 +80,7 @@ static char *Format_Image( ...@@ -80,7 +80,7 @@ static char *Format_Image(
return(data); return(data);
} }
#define BYTES_PER_OUTPUT_LINE 12 #define BYTES_PER_OUTPUT_LINE 12
int int
......
/* $XFree86$ */
#ifndef _XINTATOM_H_ #ifndef _XINTATOM_H_
#define _XINTATOM_H_ 1 #define _XINTATOM_H_ 1
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
_XFUNCPROTOBEGIN _XFUNCPROTOBEGIN
#if !USE_XCB
/* ConnDis.c */ /* ConnDis.c */
int _XConnectDisplay ( int _XConnectDisplay (
...@@ -26,6 +27,7 @@ extern XtransConnInfo _X11TransConnectDisplay(char *display_name, ...@@ -26,6 +27,7 @@ extern XtransConnInfo _X11TransConnectDisplay(char *display_name,
int *screenp, char **auth_namep, int *screenp, char **auth_namep,
int *auth_namelenp, char **auth_datap, int *auth_namelenp, char **auth_datap,
int *auth_datalenp); int *auth_datalenp);
#endif /* !USE_XCB */
/* OpenDis.c */ /* OpenDis.c */
extern void _XFreeDisplayStructure(Display *dpy); extern void _XFreeDisplayStructure(Display *dpy);
......
/* $XFree86$ */
#ifndef _XRESINTERNAL_H_ #ifndef _XRESINTERNAL_H_
#define _XRESINTERNAL_H_ #define _XRESINTERNAL_H_
......
...@@ -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
...@@ -333,7 +333,6 @@ void XrmInitialize(void) ...@@ -333,7 +333,6 @@ void XrmInitialize(void)
XrmQANY = XrmPermStringToQuark("?"); XrmQANY = XrmPermStringToQuark("?");
} }
#ifndef _XP_PRINT_SERVER_
XrmDatabase XrmGetDatabase( XrmDatabase XrmGetDatabase(
Display *display) Display *display)
{ {
...@@ -357,7 +356,6 @@ void XrmSetDatabase( ...@@ -357,7 +356,6 @@ void XrmSetDatabase(
display->db = database; display->db = database;
UnlockDisplay(display); UnlockDisplay(display);
} }
#endif /* !_XP_PRINT_SERVER_ */
void void
XrmStringToQuarkList( XrmStringToQuarkList(
...@@ -501,11 +499,7 @@ static XrmDatabase NewDatabase(void) ...@@ -501,11 +499,7 @@ static XrmDatabase NewDatabase(void)
_XCreateMutex(&db->linfo); _XCreateMutex(&db->linfo);
db->table = (NTable)NULL; db->table = (NTable)NULL;
db->mbstate = (XPointer)NULL; db->mbstate = (XPointer)NULL;
#ifdef _XP_PRINT_SERVER_
db->methods = NULL;
#else
db->methods = _XrmInitParseInfo(&db->mbstate); db->methods = _XrmInitParseInfo(&db->mbstate);
#endif
if (!db->methods) if (!db->methods)
db->methods = &mb_methods; db->methods = &mb_methods;
} }
...@@ -806,6 +800,7 @@ void XrmCombineDatabase( ...@@ -806,6 +800,7 @@ void XrmCombineDatabase(
} }
} }
(from->methods->destroy)(from->mbstate); (from->methods->destroy)(from->mbstate);
_XUnlockMutex(&from->linfo);
_XFreeMutex(&from->linfo); _XFreeMutex(&from->linfo);
Xfree((char *)from); Xfree((char *)from);
_XUnlockMutex(&(*into)->linfo); _XUnlockMutex(&(*into)->linfo);
...@@ -1068,20 +1063,20 @@ XrmQPutStringResource( ...@@ -1068,20 +1063,20 @@ XrmQPutStringResource(
*/ */
/* /*
* This function is highly optimized to inline as much as possible. * This function is highly optimized to inline as much as possible.
* Be very careful with modifications, or simplifications, as they * Be very careful with modifications, or simplifications, as they
* may adversely affect the performance. * may adversely affect the performance.
* *
* Chris Peterson, MIT X Consortium 5/17/90. * Chris Peterson, MIT X Consortium 5/17/90.
*/ */
/* /*
* Xlib spec says max 100 quarks in a lookup, will stop and return if * Xlib spec says max 100 quarks in a lookup, will stop and return if
* return if any single production's lhs has more than 100 components. * return if any single production's lhs has more than 100 components.
*/ */
#define QLIST_SIZE 100 #define QLIST_SIZE 100
/* /*
* This should be big enough to handle things like the XKeysymDB or biggish * This should be big enough to handle things like the XKeysymDB or biggish
* ~/.Xdefaults or app-defaults files. Anything bigger will be allocated on * ~/.Xdefaults or app-defaults files. Anything bigger will be allocated on
* the heap. * the heap.
...@@ -1122,14 +1117,14 @@ static void GetDatabase( ...@@ -1122,14 +1117,14 @@ static void GetDatabase(
if (!db) if (!db)
return; return;
/* /*
* if strlen (str) < DEF_BUFF_SIZE allocate buffers on the stack for * if strlen (str) < DEF_BUFF_SIZE allocate buffers on the stack for
* speed otherwise malloc the buffer. From a buffer overflow standpoint * speed otherwise malloc the buffer. From a buffer overflow standpoint
* we can be sure that neither: a) a component on the lhs, or b) a * we can be sure that neither: a) a component on the lhs, or b) a
* value on the rhs, will be longer than the overall length of str, * value on the rhs, will be longer than the overall length of str,
* i.e. strlen(str). * i.e. strlen(str).
* *
* This should give good performance when parsing "*foo: bar" type * This should give good performance when parsing "*foo: bar" type
* databases as might be passed with -xrm command line options; but * databases as might be passed with -xrm command line options; but
* with larger databases, e.g. .Xdefaults, app-defaults, or KeysymDB * with larger databases, e.g. .Xdefaults, app-defaults, or KeysymDB
* files, the size of the buffers will be overly large. One way * files, the size of the buffers will be overly large. One way
...@@ -1140,7 +1135,7 @@ static void GetDatabase( ...@@ -1140,7 +1135,7 @@ static void GetDatabase(
str_len = strlen (str); str_len = strlen (str);
if (DEF_BUFF_SIZE > str_len) lhs = lhs_s; if (DEF_BUFF_SIZE > str_len) lhs = lhs_s;
else if ((lhs = (char*) Xmalloc (str_len)) == NULL) else if ((lhs = (char*) Xmalloc (str_len)) == NULL)
return; return;
alloc_chars = DEF_BUFF_SIZE < str_len ? str_len : DEF_BUFF_SIZE; alloc_chars = DEF_BUFF_SIZE < str_len ? str_len : DEF_BUFF_SIZE;
...@@ -1156,7 +1151,7 @@ static void GetDatabase( ...@@ -1156,7 +1151,7 @@ static void GetDatabase(
dolines = doall; dolines = doall;
/* /*
* First: Remove extra whitespace. * First: Remove extra whitespace.
*/ */
do { do {
...@@ -1228,13 +1223,13 @@ static void GetDatabase( ...@@ -1228,13 +1223,13 @@ static void GetDatabase(
* Third: loop through the LHS of the resource specification * Third: loop through the LHS of the resource specification
* storing characters and converting this to a Quark. * storing characters and converting this to a Quark.
*/ */
num_quarks = 0; num_quarks = 0;
t_bindings = bindings; t_bindings = bindings;
sig = 0; sig = 0;
ptr = lhs; ptr = lhs;
*t_bindings = XrmBindTightly; *t_bindings = XrmBindTightly;
for(;;) { for(;;) {
if (!is_binding(bits)) { if (!is_binding(bits)) {
while (!is_EOQ(bits)) { while (!is_EOQ(bits)) {
...@@ -1243,7 +1238,7 @@ static void GetDatabase( ...@@ -1243,7 +1238,7 @@ static void GetDatabase(
bits = next_char(c, str); bits = next_char(c, str);
} }
quarks[num_quarks++] = quarks[num_quarks++] =
_XrmInternalStringToQuark(lhs, ptr - lhs, sig, False); _XrmInternalStringToQuark(lhs, ptr - lhs, sig, False);
if (num_quarks > QLIST_SIZE) { if (num_quarks > QLIST_SIZE) {
...@@ -1263,9 +1258,9 @@ static void GetDatabase( ...@@ -1263,9 +1258,9 @@ static void GetDatabase(
sig = (sig << 1) + c; /* Compute the signature. */ sig = (sig << 1) + c; /* Compute the signature. */
} while (is_space(bits = next_char(c, str))); } while (is_space(bits = next_char(c, str)));
/* /*
* The spec doesn't permit it, but support spaces * The spec doesn't permit it, but support spaces
* internal to resource name/class * internal to resource name/class
*/ */
if (is_separator(bits)) if (is_separator(bits))
...@@ -1289,7 +1284,7 @@ static void GetDatabase( ...@@ -1289,7 +1284,7 @@ static void GetDatabase(
* If two separators appear with no Text between them then * If two separators appear with no Text between them then
* ignore them. * ignore them.
* *
* If anyone of those separators is a '*' then the binding * If anyone of those separators is a '*' then the binding
* will be loose, otherwise it will be tight. * will be loose, otherwise it will be tight.
*/ */
...@@ -1334,7 +1329,7 @@ static void GetDatabase( ...@@ -1334,7 +1329,7 @@ static void GetDatabase(
* the right hand side. * the right hand side.
*/ */
/* /*
* Fourth: Remove more whitespace * Fourth: Remove more whitespace
*/ */
...@@ -1352,7 +1347,7 @@ static void GetDatabase( ...@@ -1352,7 +1347,7 @@ static void GetDatabase(
break; break;
} }
/* /*
* Fifth: Process the right hand side. * Fifth: Process the right hand side.
*/ */
...@@ -1453,8 +1448,8 @@ static void GetDatabase( ...@@ -1453,8 +1448,8 @@ static void GetDatabase(
else { else {
int tcount; int tcount;
/* /*
* Otherwise just insert those characters into the * Otherwise just insert those characters into the
* string, since no special processing is needed on * string, since no special processing is needed on
* numerics we can skip the special processing. * numerics we can skip the special processing.
*/ */
...@@ -1477,7 +1472,7 @@ static void GetDatabase( ...@@ -1477,7 +1472,7 @@ static void GetDatabase(
} }
} }
/* /*
* It is important to make sure that there is room for at least * It is important to make sure that there is room for at least
* four more characters in the buffer, since I can add that * four more characters in the buffer, since I can add that
* many characters into the buffer after a backslash has occured. * many characters into the buffer after a backslash has occured.
...@@ -1486,7 +1481,7 @@ static void GetDatabase( ...@@ -1486,7 +1481,7 @@ static void GetDatabase(
if (ptr + len > ptr_max) { if (ptr + len > ptr_max) {
char * temp_str; char * temp_str;
alloc_chars += BUFSIZ/10; alloc_chars += BUFSIZ/10;
temp_str = Xrealloc(rhs, sizeof(char) * alloc_chars); temp_str = Xrealloc(rhs, sizeof(char) * alloc_chars);
if (!temp_str) { if (!temp_str) {
...@@ -1503,7 +1498,7 @@ static void GetDatabase( ...@@ -1503,7 +1498,7 @@ static void GetDatabase(
} }
/* /*
* Lastly: Terminate the value string, and store this entry * Lastly: Terminate the value string, and store this entry
* into the database. * into the database.
*/ */
...@@ -1512,7 +1507,7 @@ static void GetDatabase( ...@@ -1512,7 +1507,7 @@ static void GetDatabase(
/* Store it in database */ /* Store it in database */
value.size = ptr - rhs; value.size = ptr - rhs;
value.addr = (XPointer) rhs; value.addr = (XPointer) rhs;
PutEntry(db, bindings, quarks, XrmQString, &value); PutEntry(db, bindings, quarks, XrmQString, &value);
} }
...@@ -2277,7 +2272,7 @@ Bool XrmQGetSearchList( ...@@ -2277,7 +2272,7 @@ Bool XrmQGetSearchList(
} else { } else {
if (table && !table->leaf) if (table && !table->leaf)
table = table->next; table = table->next;
if (table && if (table &&
AppendLEntry((LTable)table, names, classes, &closure)) { AppendLEntry((LTable)table, names, classes, &closure)) {
_XUnlockMutex(&db->linfo); _XUnlockMutex(&db->linfo);
return False; return False;
...@@ -2570,12 +2565,8 @@ Bool XrmQGetResource( ...@@ -2570,12 +2565,8 @@ Bool XrmQGetResource(
} }
Bool Bool
XrmGetResource(db, name_str, class_str, pType_str, pValue) XrmGetResource(XrmDatabase db, _Xconst char *name_str, _Xconst char *class_str,
XrmDatabase db; XrmString *pType_str, XrmValuePtr pValue)
_Xconst char *name_str;
_Xconst char *class_str;
XrmString *pType_str; /* RETURN */
XrmValuePtr pValue; /* RETURN */
{ {
XrmName names[MAXDBDEPTH+1]; XrmName names[MAXDBDEPTH+1];
XrmClass classes[MAXDBDEPTH+1]; XrmClass classes[MAXDBDEPTH+1];
...@@ -2654,6 +2645,7 @@ void XrmDestroyDatabase( ...@@ -2654,6 +2645,7 @@ void XrmDestroyDatabase(
else else
DestroyNTable(table); DestroyNTable(table);
} }
_XUnlockMutex(&db->linfo);
_XFreeMutex(&db->linfo); _XFreeMutex(&db->linfo);
(*db->methods->destroy)(db->mbstate); (*db->methods->destroy)(db->mbstate);
Xfree((char *)db); Xfree((char *)db);
......
...@@ -45,7 +45,7 @@ from The Open Group. ...@@ -45,7 +45,7 @@ from The Open Group.
*/ */
#ifdef NULL_NOT_ZERO /* then need to initialize */ #ifdef NULL_NOT_ZERO /* then need to initialize */
#define SetZero(t,var,z) t var = z #define SetZero(t,var,z) t var = z
#else #else
#define SetZero(t,var,z) t var #define SetZero(t,var,z) t var
#endif #endif
...@@ -114,25 +114,25 @@ extern int close(); ...@@ -114,25 +114,25 @@ extern int close();
#ifdef SVR4 #ifdef SVR4
extern int _XsSetupSpStream(); extern int _XsSetupSpStream();
extern int _XsSetupNamedStream(); extern int _XsSetupNamedStream();
#endif #endif
extern int _XsSetupLocalStream(); extern int _XsSetupLocalStream();
extern int _XsConnectLocalClient(); extern int _XsConnectLocalClient();
extern int _XsCallLocalServer(); extern int _XsCallLocalServer();
extern int _XsReadLocalStream(); extern int _XsReadLocalStream();
extern int _XsErrorCall(); extern int _XsErrorCall();
extern int _XsWriteLocalStream(); extern int _XsWriteLocalStream();
extern int _XsCloseLocalStream(); extern int _XsCloseLocalStream();
extern int _XsSetupTliStream(); extern int _XsSetupTliStream();
extern int _XsConnectTliClient(); extern int _XsConnectTliClient();
extern int _XsCallTliServer(); extern int _XsCallTliServer();
extern int _XsReadTliStream(); extern int _XsReadTliStream();
extern int _XsWriteTliStream(); extern int _XsWriteTliStream();
extern int _XsCloseTliStream(); extern int _XsCloseTliStream();
Xstream _XsStream[] = { Xstream _XsStream[] = {
{ {
/* local connections using pseudo-ttys */ /* local connections using pseudo-ttys */
_XsSetupLocalStream, _XsSetupLocalStream,
...@@ -144,7 +144,7 @@ Xstream _XsStream[] = { ...@@ -144,7 +144,7 @@ Xstream _XsStream[] = {
close, close,
NULL NULL
}, },
{ {
#ifdef SVR4 #ifdef SVR4
/* local connections using named streams */ /* local connections using named streams */
......
/* $TOG: imConv.c /main/20 1998/06/17 15:46:41 kaleb $ */
/****************************************************************** /******************************************************************
Copyright 1991, 1992 by Fuji Xerox Co.,Ltd. Copyright 1991, 1992 by Fuji Xerox Co.,Ltd.
...@@ -44,9 +43,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -44,9 +43,9 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "XlcPubI.h" #include "XlcPubI.h"
#ifdef XKB #ifdef XKB
/* /*
* rather than just call _XLookupString (i.e. the pre-XKB XLookupString) * rather than just call _XLookupString (i.e. the pre-XKB XLookupString)
* do this because with XKB the event may have some funky modifiers that * do this because with XKB the event may have some funky modifiers that
* _XLookupString doesn't grok. * _XLookupString doesn't grok.
*/ */
#include "XKBlib.h" #include "XKBlib.h"
...@@ -65,11 +64,11 @@ typedef int (*ucstocsConvProc)( ...@@ -65,11 +64,11 @@ typedef int (*ucstocsConvProc)(
); );
struct SubstRec { struct SubstRec {
char* encoding_name; const char encoding_name[8];
char* charset_name; const char charset_name[12];
}; };
static struct SubstRec SubstTable[] = { static const struct SubstRec SubstTable[] = {
{"STRING", "ISO8859-1"}, {"STRING", "ISO8859-1"},
{"TIS620", "TIS620-0"}, {"TIS620", "TIS620-0"},
{"UTF-8", "ISO10646-1"} {"UTF-8", "ISO10646-1"}
...@@ -105,7 +104,7 @@ _XimGetLocaleCode ( ...@@ -105,7 +104,7 @@ _XimGetLocaleCode (
* locale * locale
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
int int
_XimGetCharCode ( _XimGetCharCode (
XPointer ucs_conv, XPointer ucs_conv,
KeySym keysym, KeySym keysym,
...@@ -144,7 +143,7 @@ static int lookup_string( ...@@ -144,7 +143,7 @@ static int lookup_string(
{ {
int ret; int ret;
unsigned ctrls = XkbGetXlibControls (event->display); unsigned ctrls = XkbGetXlibControls (event->display);
XkbSetXlibControls (event->display, XkbSetXlibControls (event->display,
XkbLC_ForceLatin1Lookup, XkbLC_ForceLatin1Lookup); XkbLC_ForceLatin1Lookup, XkbLC_ForceLatin1Lookup);
ret = XLookupString(event, (char *)buffer, nbytes, keysym, status); ret = XLookupString(event, (char *)buffer, nbytes, keysym, status);
XkbSetXlibControls (event->display, XkbSetXlibControls (event->display,
...@@ -156,13 +155,13 @@ static int lookup_string( ...@@ -156,13 +155,13 @@ static int lookup_string(
#define BUF_SIZE (20) #define BUF_SIZE (20)
int int
_XimLookupMBText(ic, event, buffer, nbytes, keysym, status) _XimLookupMBText(
Xic ic; Xic ic,
XKeyEvent* event; XKeyEvent* event,
char* buffer; char* buffer,
int nbytes; int nbytes,
KeySym* keysym; KeySym* keysym,
XComposeStatus* status; XComposeStatus* status)
{ {
int count; int count;
KeySym symbol; KeySym symbol;
...@@ -181,11 +180,11 @@ _XimLookupMBText(ic, event, buffer, nbytes, keysym, status) ...@@ -181,11 +180,11 @@ _XimLookupMBText(ic, event, buffer, nbytes, keysym, status)
memcpy(look, (char *)buffer,count); memcpy(look, (char *)buffer,count);
look[count] = '\0'; look[count] = '\0';
if ((count = im->methods->ctstombs(ic->core.im, if ((count = im->methods->ctstombs(ic->core.im,
(char*) look, count, (char*) look, count,
buffer, nbytes, &dummy)) < 0) { buffer, nbytes, &dummy)) < 0) {
count = 0; count = 0;
} }
} else if ((count == 0) || } else if ((count == 0) ||
(count == 1 && (symbol > 0x7f && symbol < 0xff00))) { (count == 1 && (symbol > 0x7f && symbol < 0xff00))) {
XPointer from = (XPointer) &ucs4; XPointer from = (XPointer) &ucs4;
...@@ -227,13 +226,13 @@ _XimLookupMBText(ic, event, buffer, nbytes, keysym, status) ...@@ -227,13 +226,13 @@ _XimLookupMBText(ic, event, buffer, nbytes, keysym, status)
} }
int int
_XimLookupWCText(ic, event, buffer, nbytes, keysym, status) _XimLookupWCText(
Xic ic; Xic ic,
XKeyEvent* event; XKeyEvent* event,
wchar_t* buffer; wchar_t* buffer,
int nbytes; int nbytes,
KeySym* keysym; KeySym* keysym,
XComposeStatus* status; XComposeStatus* status)
{ {
int count; int count;
KeySym symbol; KeySym symbol;
...@@ -250,7 +249,7 @@ _XimLookupWCText(ic, event, buffer, nbytes, keysym, status) ...@@ -250,7 +249,7 @@ _XimLookupWCText(ic, event, buffer, nbytes, keysym, status)
if (count > 1) { if (count > 1) {
if ((count = im->methods->ctstowcs(ic->core.im, if ((count = im->methods->ctstowcs(ic->core.im,
(char*) look, count, (char*) look, count,
buffer, nbytes, &dummy)) < 0) { buffer, nbytes, &dummy)) < 0) {
count = 0; count = 0;
} }
...@@ -299,13 +298,13 @@ _XimLookupWCText(ic, event, buffer, nbytes, keysym, status) ...@@ -299,13 +298,13 @@ _XimLookupWCText(ic, event, buffer, nbytes, keysym, status)
} }
int int
_XimLookupUTF8Text(ic, event, buffer, nbytes, keysym, status) _XimLookupUTF8Text(
Xic ic; Xic ic,
XKeyEvent* event; XKeyEvent* event,
char* buffer; char* buffer,
int nbytes; int nbytes,
KeySym* keysym; KeySym* keysym,
XComposeStatus* status; XComposeStatus* status)
{ {
int count; int count;
KeySym symbol; KeySym symbol;
...@@ -324,11 +323,11 @@ _XimLookupUTF8Text(ic, event, buffer, nbytes, keysym, status) ...@@ -324,11 +323,11 @@ _XimLookupUTF8Text(ic, event, buffer, nbytes, keysym, status)
memcpy(look, (char *)buffer,count); memcpy(look, (char *)buffer,count);
look[count] = '\0'; look[count] = '\0';
if ((count = im->methods->ctstoutf8(ic->core.im, if ((count = im->methods->ctstoutf8(ic->core.im,
(char*) look, count, (char*) look, count,
buffer, nbytes, &dummy)) < 0) { buffer, nbytes, &dummy)) < 0) {
count = 0; count = 0;
} }
} else if ((count == 0) || } else if ((count == 0) ||
(count == 1 && (symbol > 0x7f && symbol < 0xff00))) { (count == 1 && (symbol > 0x7f && symbol < 0xff00))) {
XPointer from = (XPointer) &ucs4; XPointer from = (XPointer) &ucs4;
......
/* /*
Copyright 1992, 1998 The Open Group Copyright 1992, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its Permission to use, copy, modify, distribute, and sell this software and its
...@@ -45,11 +45,23 @@ in this Software without prior written authorization from The Open Group. ...@@ -45,11 +45,23 @@ in this Software without prior written authorization from The Open Group.
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
#include "Xprivate.h"
#include "locking.h" #include "locking.h"
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
#include <stdio.h> /* for warn/debug stuff */ #include <stdio.h> /* for warn/debug stuff */
#endif #endif
/* Additional arguments for source code location lock call was made from */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
# define XTHREADS_FILE_LINE_ARGS \
, \
char* file, /* source file, from macro */ \
int line
#else
# define XTHREADS_FILE_LINE_ARGS /* None */
#endif
#define NUM_FREE_CVLS 4 #define NUM_FREE_CVLS 4
/* in lcWrap.c */ /* in lcWrap.c */
...@@ -58,14 +70,14 @@ extern LockInfoPtr _Xi18n_lock; ...@@ -58,14 +70,14 @@ extern LockInfoPtr _Xi18n_lock;
#ifdef WIN32 #ifdef WIN32
static DWORD _X_TlsIndex = (DWORD)-1; static DWORD _X_TlsIndex = (DWORD)-1;
_Xthread_init() void _Xthread_init(void)
{ {
if (_X_TlsIndex == (DWORD)-1) if (_X_TlsIndex == (DWORD)-1)
_X_TlsIndex = TlsAlloc(); _X_TlsIndex = TlsAlloc();
} }
struct _xthread_waiter * struct _xthread_waiter *
_Xthread_waiter() _Xthread_waiter(void)
{ {
struct _xthread_waiter *me; struct _xthread_waiter *me;
...@@ -87,28 +99,18 @@ static xthread_t _Xthread_self(void) ...@@ -87,28 +99,18 @@ static xthread_t _Xthread_self(void)
static LockInfoRec global_lock; static LockInfoRec global_lock;
static LockInfoRec i18n_lock; static LockInfoRec i18n_lock;
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XLockMutex(lip,file,line)
LockInfoPtr lip;
char* file;
int line;
#else
static void _XLockMutex( static void _XLockMutex(
LockInfoPtr lip) LockInfoPtr lip
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
xmutex_lock(lip->lock); xmutex_lock(lip->lock);
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XUnlockMutex( static void _XUnlockMutex(
LockInfoPtr lip, LockInfoPtr lip
char* file, XTHREADS_FILE_LINE_ARGS
int line) )
#else
static void _XUnlockMutex(
LockInfoPtr lip)
#endif
{ {
xmutex_unlock(lip->lock); xmutex_unlock(lip->lock);
} }
...@@ -200,15 +202,10 @@ static void _XLockDisplayWarn( ...@@ -200,15 +202,10 @@ static void _XLockDisplayWarn(
} }
#endif /* XTHREADS_WARN */ #endif /* XTHREADS_WARN */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XUnlockDisplay(dpy,file,line)
Display *dpy;
char *file;
int line;
#else
static void _XUnlockDisplay( static void _XUnlockDisplay(
Display *dpy) Display *dpy
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
xthread_t self = xthread_self(); xthread_t self = xthread_self();
...@@ -328,23 +325,17 @@ static void _XPopReader( ...@@ -328,23 +325,17 @@ static void _XPopReader(
} }
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XConditionWait(cv, mutex,file,line)
xcondition_t cv;
xmutex_t mutex;
char *file;
int line;
#else
static void _XConditionWait( static void _XConditionWait(
xcondition_t cv, xcondition_t cv,
xmutex_t mutex) xmutex_t mutex
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
xthread_t self = xthread_self(); xthread_t self = xthread_self();
char *old_file = locking_file; char *old_file = locking_file;
int old_line = locking_line; int old_line = locking_line;
#ifdef XTHREADS_DEBUG #ifdef XTHREADS_DEBUG
printf("line %d thread %x in condition wait\n", line, self); printf("line %d thread %x in condition wait\n", line, self);
#endif #endif
...@@ -379,15 +370,10 @@ static void _XConditionWait( ...@@ -379,15 +370,10 @@ static void _XConditionWait(
#endif /* XTHREADS_WARN */ #endif /* XTHREADS_WARN */
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XConditionSignal(cv,file,line)
xcondition_t cv;
char *file;
int line;
#else
static void _XConditionSignal( static void _XConditionSignal(
xcondition_t cv) xcondition_t cv
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
#ifdef XTHREADS_DEBUG #ifdef XTHREADS_DEBUG
...@@ -396,17 +382,12 @@ static void _XConditionSignal( ...@@ -396,17 +382,12 @@ static void _XConditionSignal(
#endif #endif
xcondition_signal(cv); xcondition_signal(cv);
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XConditionBroadcast(cv,file,line)
xcondition_t cv;
char *file;
int line;
#else
static void _XConditionBroadcast( static void _XConditionBroadcast(
xcondition_t cv) xcondition_t cv
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
#ifdef XTHREADS_DEBUG #ifdef XTHREADS_DEBUG
...@@ -415,7 +396,7 @@ static void _XConditionBroadcast( ...@@ -415,7 +396,7 @@ static void _XConditionBroadcast(
#endif #endif
xcondition_broadcast(cv); xcondition_broadcast(cv);
} }
static void _XFreeDisplayLock( static void _XFreeDisplayLock(
Display *dpy) Display *dpy)
...@@ -467,15 +448,10 @@ static void _XDisplayLockWait( ...@@ -467,15 +448,10 @@ static void _XDisplayLockWait(
} }
} }
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XLockDisplay(dpy, file, line)
Display *dpy;
char *file; /* source file, from macro */
int line;
#else
static void _XLockDisplay( static void _XLockDisplay(
Display *dpy) Display *dpy
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
_XLockDisplayWarn(dpy, file, line); _XLockDisplayWarn(dpy, file, line);
...@@ -484,23 +460,19 @@ static void _XLockDisplay( ...@@ -484,23 +460,19 @@ static void _XLockDisplay(
#endif #endif
if (dpy->lock->locking_level > 0) if (dpy->lock->locking_level > 0)
_XDisplayLockWait(dpy); _XDisplayLockWait(dpy);
_XIDHandler(dpy);
_XSeqSyncFunction(dpy);
} }
/* /*
* _XReply is allowed to exit from select/poll and clean up even if a * _XReply is allowed to exit from select/poll and clean up even if a
* user-level lock is in force, so it uses this instead of _XFancyLockDisplay. * user-level lock is in force, so it uses this instead of _XFancyLockDisplay.
*/ */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
static void _XInternalLockDisplay(dpy, wskip, file, line)
Display *dpy;
Bool wskip;
char *file; /* source file, from macro */
int line;
#else
static void _XInternalLockDisplay( static void _XInternalLockDisplay(
Display *dpy, Display *dpy,
Bool wskip) Bool wskip
#endif XTHREADS_FILE_LINE_ARGS
)
{ {
#ifdef XTHREADS_WARN #ifdef XTHREADS_WARN
_XLockDisplayWarn(dpy, file, line); _XLockDisplayWarn(dpy, file, line);
...@@ -595,7 +567,7 @@ xthread_t (*_x11_thr_self)() = __x11_thr_self; ...@@ -595,7 +567,7 @@ xthread_t (*_x11_thr_self)() = __x11_thr_self;
#endif #endif
Status XInitThreads() Status XInitThreads(void)
{ {
if (_Xglobal_lock) if (_Xglobal_lock)
return 1; return 1;
...@@ -644,7 +616,7 @@ Status XInitThreads() ...@@ -644,7 +616,7 @@ Status XInitThreads()
} }
#else /* XTHREADS */ #else /* XTHREADS */
Status XInitThreads() Status XInitThreads(void)
{ {
return 0; return 0;
} }
......
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