Commit e399356e authored by Mike Gabriel's avatar Mike Gabriel

drop .original files from the current code base

parent b16b9e46
/* $Xorg: Xpoll.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
/*
Copyright 1994, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/*
* Copyright © 2005 Daniel Stone
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Daniel Stone not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission. Daniel Stone makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* DANIEL STONE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
* DANIEL STONE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $XFree86: xc/include/Xpoll.h,v 3.8 2001/01/17 17:53:11 dawes Exp $ */
#ifndef _XPOLL_H_
#define _XPOLL_H_
#ifndef WIN32
#ifndef USE_POLL
#include <X11/Xos.h>
/* Below is the monster branch from hell. Basically, most systems will drop to
* 'the branch below is the fallthrough for halfway modern systems', and include
* <sys/select.h>, so we get the FD_* macros. */
#if !defined(DGUX)
# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE)
# include <sys/select.h>
# ifdef luna
# include <sysent.h>
# endif
# else /* not SVR4/CRAY/AIXv3 */
# if defined(AIXV4) /* AIX 4.2 fubar-ed <sys/select.h>, so try really hard. */
# if !defined(NFDBITS)
# include <sys/select.h>
# endif
# else /* the branch below is the fallthrough for halfway modern systems */
# ifdef __QNX__ /* Make sure we get 256 bit select masks */
# define FD_SETSIZE 256
# endif
# include <sys/select.h>
# endif
# endif
#else /* DGUX -- No sys/select in Intel DG/ux */
# include <sys/time.h>
# include <sys/types.h>
# include <unistd.h>
#endif
#include <X11/Xmd.h>
#ifdef CSRG_BASED
#include <sys/param.h>
# if BSD < 199103
typedef long fd_mask;
# endif
#endif
#define XFD_SETSIZE 256
#ifndef FD_SETSIZE
#define FD_SETSIZE XFD_SETSIZE
#endif
#ifndef NBBY
#define NBBY 8 /* number of bits in a byte */
#endif
#ifndef NFDBITS
#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
#endif
#ifndef howmany
#define howmany(x,y) (((x)+((y)-1))/(y))
#endif
#if defined(BSD) && BSD < 198911 && !defined(luna)
typedef struct fd_set {
fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;
#endif
#ifndef hpux /* and perhaps old BSD ??? */
# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t)
#else
# ifndef _XPG4_EXTENDED /* HPUX 9.x and earlier */
# define Select(n,r,w,e,t) select(n,(int*)r,(int*)w,(int*)e,(struct timeval*)t)
# else
# define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t)
# endif
#endif
#define __X_FDS_BITS @USE_FDS_BITS@
#ifndef __FDS_BITS
# define __FDS_BITS(p) ((p)->__X_FDS_BITS)
#endif
#define __XFDS_BITS(p, n) (__FDS_BITS(p))[n]
#ifndef FD_SET
#define FD_SET(n, p) (__XFDS_BITS(p, ((n)/NFDBITS)) |= ((fd_mask)1 << ((n) % NFDBITS)))
#endif
#ifndef FD_CLR
#define FD_CLR(n, p) (__XFDS_BITS((p), ((n)/NFDBITS)) &= ~((fd_mask)1 << ((n) % NFDBITS)))
#endif
#ifndef FD_ISSET
#define FD_ISSET(n, p) ((__XFDS_BITS((p), ((n)/NFDBITS))) & ((fd_mask)1 << ((n) % NFDBITS)))
#endif
#ifndef FD_ZERO
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
#endif
/*
* The howmany(FD_SETSIZE, NFDBITS) computes the number of elements in the
* array. before accessing an element in the array we check it exists.
* If it does not exist then the compiler discards the code to access it.
*/
#define XFD_ANYSET(p) \
((howmany(FD_SETSIZE, NFDBITS) > 0 && (__XFDS_BITS(p, 0))) || \
(howmany(FD_SETSIZE, NFDBITS) > 1 && (__XFDS_BITS(p, 1))) || \
(howmany(FD_SETSIZE, NFDBITS) > 2 && (__XFDS_BITS(p, 2))) || \
(howmany(FD_SETSIZE, NFDBITS) > 3 && (__XFDS_BITS(p, 3))) || \
(howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \
(howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \
(howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \
(howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7))))
#define XFD_COPYSET(src,dst) { \
int __i__; \
for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \
__XFDS_BITS((dst), __i__) = __XFDS_BITS((src), __i__); \
}
#define XFD_ANDSET(dst,b1,b2) { \
int __i__; \
for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \
__XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) & (__XFDS_BITS((b2), __i__))); \
}
#define XFD_ORSET(dst,b1,b2) { \
int __i__; \
for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \
__XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) | (__XFDS_BITS((b2), __i__))); \
}
#define XFD_UNSET(dst,b1) { \
int __i__; \
for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \
__XFDS_BITS((dst), __i__) &= ~(__XFDS_BITS((b1), __i__)); \
}
#else /* USE_POLL */
#include <sys/poll.h>
#endif /* USE_POLL */
#else /* WIN32 */
#define XFD_SETSIZE 256
#ifndef FD_SETSIZE
#define FD_SETSIZE XFD_SETSIZE
#endif
#include <X11/Xwinsock.h>
#define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t)
#define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count)
#define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i])
#define XFD_ANYSET(p) XFD_SETCOUNT(p)
#define XFD_COPYSET(src,dst) { \
u_int __i; \
FD_ZERO(dst); \
for (__i = 0; __i < XFD_SETCOUNT(src) ; __i++) { \
XFD_FD(dst,__i) = XFD_FD(src,__i); \
} \
XFD_SETCOUNT(dst) = XFD_SETCOUNT(src); \
}
#define XFD_ANDSET(dst,b1,b2) { \
u_int __i; \
FD_ZERO(dst); \
for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \
if (FD_ISSET(XFD_FD(b1,__i), b2)) \
FD_SET(XFD_FD(b1,__i), dst); \
} \
}
#define XFD_ORSET(dst,b1,b2) { \
u_int __i; \
if (dst != b1) XFD_COPYSET(b1,dst); \
for (__i = 0; __i < XFD_SETCOUNT(b2) ; __i++) { \
if (!FD_ISSET(XFD_FD(b2,__i), dst)) \
FD_SET(XFD_FD(b2,__i), dst); \
} \
}
/* this one is really sub-optimal */
#define XFD_UNSET(dst,b1) { \
u_int __i; \
for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \
FD_CLR(XFD_FD(b1,__i), dst); \
} \
}
/* we have to pay the price of having an array here, unlike with bitmasks
calling twice FD_SET with the same fd is not transparent, so be careful */
#undef FD_SET
#define FD_SET(fd,set) do { \
if (XFD_SETCOUNT(set) < FD_SETSIZE && !FD_ISSET(fd,set)) \
XFD_FD(set,XFD_SETCOUNT(set)++)=(fd); \
} while(0)
#define getdtablesize() FD_SETSIZE
#endif /* WIN32 */
#endif /* _XPOLL_H_ */
/* $Xorg: ChkIfEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */
/*
Copyright 1985, 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86$ */
#define NEED_EVENTS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
/*
* 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
* matches, return. If all else fails, tell the user no events found.
*/
Bool XCheckIfEvent (dpy, event, predicate, arg)
register Display *dpy;
Bool (*predicate)(
Display* /* display */,
XEvent* /* event */,
char* /* arg */
); /* function to call */
register XEvent *event; /* XEvent to be filled in. */
char *arg;
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
int n; /* time through count */
LockDisplay(dpy);
prev = NULL;
for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if(qelt->qserial_num > qe_serial
&& (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event;
_XDeq(dpy, prev, qelt);
UnlockDisplay(dpy);
return True;
}
}
if (prev)
qe_serial = prev->qserial_num;
switch (n) {
case 2:
_XEventsQueued(dpy, QueuedAfterReading);
break;
case 1:
_XFlush(dpy);
break;
}
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
}
UnlockDisplay(dpy);
return False;
}
#ifdef NX_TRANS_SOCKET
/*
* This is just like XCheckIfEvent() but doesn't
* flush the output buffer if it can't read new
* events.
*/
Bool XCheckIfEventNoFlush (dpy, event, predicate, arg)
register Display *dpy;
Bool (*predicate)(
Display* /* display */,
XEvent* /* event */,
char* /* arg */
); /* function to call */
register XEvent *event; /* XEvent to be filled in. */
char *arg;
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
int n; /* time through count */
LockDisplay(dpy);
prev = NULL;
for (n = 2; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if(qelt->qserial_num > qe_serial
&& (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event;
_XDeq(dpy, prev, qelt);
UnlockDisplay(dpy);
return True;
}
}
if (prev)
qe_serial = prev->qserial_num;
switch (n) {
case 1:
_XEventsQueued(dpy, QueuedAfterReading);
break;
}
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
}
UnlockDisplay(dpy);
return False;
}
#endif
/* $Xorg: ChkIfEv.c,v 1.4 2001/02/09 02:03:31 xorgcvs Exp $ */
/*
Copyright 1985, 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86$ */
#define NEED_EVENTS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
/*
* 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
* matches, return. If all else fails, tell the user no events found.
*/
Bool XCheckIfEvent (dpy, event, predicate, arg)
register Display *dpy;
Bool (*predicate)(
Display* /* display */,
XEvent* /* event */,
char* /* arg */
); /* function to call */
register XEvent *event; /* XEvent to be filled in. */
char *arg;
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
int n; /* time through count */
LockDisplay(dpy);
prev = NULL;
for (n = 3; --n >= 0;) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if(qelt->qserial_num > qe_serial
&& (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event;
_XDeq(dpy, prev, qelt);
UnlockDisplay(dpy);
return True;
}
}
if (prev)
qe_serial = prev->qserial_num;
switch (n) {
case 2:
_XEventsQueued(dpy, QueuedAfterReading);
break;
case 1:
_XFlush(dpy);
break;
}
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
}
UnlockDisplay(dpy);
return False;
}
/* $Xorg: IfEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/X11/IfEvent.c,v 1.4 2001/12/14 19:54:01 dawes Exp $ */
#define NEED_EVENTS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
/*
* Flush output and (wait for and) return the next event matching the
* predicate in the queue.
*/
int
XIfEvent (dpy, event, predicate, arg)
register Display *dpy;
Bool (*predicate)(
Display* /* display */,
XEvent* /* event */,
char* /* arg */
); /* function to call */
register XEvent *event;
char *arg;
{
register _XQEvent *qelt, *prev;
unsigned long qe_serial = 0;
LockDisplay(dpy);
prev = NULL;
while (1) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if(qelt->qserial_num > qe_serial
&& (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event;
_XDeq(dpy, prev, qelt);
UnlockDisplay(dpy);
return 0;
}
}
if (prev)
qe_serial = prev->qserial_num;
_XReadEvents(dpy);
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
return 0;
}
#endif
}
}
/* $Xorg: IfEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/X11/IfEvent.c,v 1.4 2001/12/14 19:54:01 dawes Exp $ */
#define NEED_EVENTS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
/*
* Flush output and (wait for and) return the next event matching the
* predicate in the queue.
*/
int
XIfEvent (dpy, event, predicate, arg)
register Display *dpy;
Bool (*predicate)(
Display* /* display */,
XEvent* /* event */,
char* /* arg */
); /* function to call */
register XEvent *event;
char *arg;
{
register _XQEvent *qelt, *prev;
unsigned long qe_serial = 0;
LockDisplay(dpy);
prev = NULL;
while (1) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if(qelt->qserial_num > qe_serial
&& (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event;
_XDeq(dpy, prev, qelt);
UnlockDisplay(dpy);
return 0;
}
}
if (prev)
qe_serial = prev->qserial_num;
_XReadEvents(dpy);
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
}
}
/* $Xorg: MaskEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/X11/MaskEvent.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */
#define NEED_EVENTS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
extern long const _Xevent_to_mask[];
#define AllPointers (PointerMotionMask|PointerMotionHintMask|ButtonMotionMask)
#define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\
Button4MotionMask|Button5MotionMask)
/*
* return the next event in the queue matching one of the events in the mask.
* If no event, flush output, and wait until match succeeds.
* Events earlier in the queue are not discarded.
*/
int
XMaskEvent (dpy, mask, event)
register Display *dpy;
long mask; /* Selected event mask. */
register XEvent *event; /* XEvent to be filled in. */
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
LockDisplay(dpy);
prev = NULL;
while (1) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if ((qelt->event.type < LASTEvent) &&
(_Xevent_to_mask[qelt->event.type] & mask) &&
((qelt->event.type != MotionNotify) ||
(mask & AllPointers) ||
(mask & AllButtons & qelt->event.xmotion.state))) {
*event = qelt->event;
_XDeq(dpy, prev, qelt);
UnlockDisplay(dpy);
return 0;
}
}
if (prev)
qe_serial = prev->qserial_num;
_XReadEvents(dpy);
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
return 0;
}
#endif
}
}
/* $Xorg: MaskEvent.c,v 1.4 2001/02/09 02:03:34 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/X11/MaskEvent.c,v 3.5 2001/10/28 03:32:30 tsi Exp $ */
#define NEED_EVENTS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
extern long const _Xevent_to_mask[];
#define AllPointers (PointerMotionMask|PointerMotionHintMask|ButtonMotionMask)
#define AllButtons (Button1MotionMask|Button2MotionMask|Button3MotionMask|\
Button4MotionMask|Button5MotionMask)
/*
* return the next event in the queue matching one of the events in the mask.
* If no event, flush output, and wait until match succeeds.
* Events earlier in the queue are not discarded.
*/
int
XMaskEvent (dpy, mask, event)
register Display *dpy;
long mask; /* Selected event mask. */
register XEvent *event; /* XEvent to be filled in. */
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
LockDisplay(dpy);
prev = NULL;
while (1) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if ((qelt->event.type < LASTEvent) &&
(_Xevent_to_mask[qelt->event.type] & mask) &&
((qelt->event.type != MotionNotify) ||
(mask & AllPointers) ||
(mask & AllButtons & qelt->event.xmotion.state))) {
*event = qelt->event;
_XDeq(dpy, prev, qelt);
UnlockDisplay(dpy);
return 0;
}
}
if (prev)
qe_serial = prev->qserial_num;
_XReadEvents(dpy);
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
}
}
/* $Xorg: PeekIfEv.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/X11/PeekIfEv.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */
#define NEED_EVENTS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
/*
* return the next event in the queue that satisfies the predicate.
* BUT do not remove it from the queue.
* If none found, flush, and then wait until one satisfies the predicate.
*/
int
XPeekIfEvent (dpy, event, predicate, arg)
register Display *dpy;
register XEvent *event;
Bool (*predicate)(
Display* /* display */,
XEvent* /* event */,
char* /* arg */
);
char *arg;
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
LockDisplay(dpy);
prev = NULL;
while (1) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if(qelt->qserial_num > qe_serial
&& (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event;
UnlockDisplay(dpy);
return 0;
}
}
if (prev)
qe_serial = prev->qserial_num;
_XReadEvents(dpy);
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
#ifdef NX_TRANS_SOCKET
if (_XGetIOError(dpy)) {
return 0;
}
#endif
}
}
/* $Xorg: PeekIfEv.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/X11/PeekIfEv.c,v 1.4 2001/12/14 19:54:03 dawes Exp $ */
#define NEED_EVENTS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
/*
* return the next event in the queue that satisfies the predicate.
* BUT do not remove it from the queue.
* If none found, flush, and then wait until one satisfies the predicate.
*/
int
XPeekIfEvent (dpy, event, predicate, arg)
register Display *dpy;
register XEvent *event;
Bool (*predicate)(
Display* /* display */,
XEvent* /* event */,
char* /* arg */
);
char *arg;
{
register _XQEvent *prev, *qelt;
unsigned long qe_serial = 0;
LockDisplay(dpy);
prev = NULL;
while (1) {
for (qelt = prev ? prev->next : dpy->head;
qelt;
prev = qelt, qelt = qelt->next) {
if(qelt->qserial_num > qe_serial
&& (*predicate)(dpy, &qelt->event, arg)) {
*event = qelt->event;
UnlockDisplay(dpy);
return 0;
}
}
if (prev)
qe_serial = prev->qserial_num;
_XReadEvents(dpy);
if (prev && prev->qserial_num != qe_serial)
/* another thread has snatched this event */
prev = NULL;
}
}
/* $Xorg: Pending.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
#include <stdio.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
/* Read in pending events if needed and return the number of queued events. */
int XEventsQueued (dpy, mode)
register Display *dpy;
int mode;
{
int ret_val;
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST)
fprintf(stderr, "\nXEventsQueued: Called with a display at [%p].\n", dpy);
#endif
LockDisplay(dpy);
if (dpy->qlen || (mode == QueuedAlready))
ret_val = dpy->qlen;
else
ret_val = _XEventsQueued (dpy, mode);
#if defined(NX_TRANS_SOCKET) && defined(NX_TRANS_TEST)
fprintf(stderr, "\nXEventsQueued: Going to unlock the display at [%p].\n", dpy);
#endif
UnlockDisplay(dpy);
return ret_val;
}
int XPending (dpy)
register Display *dpy;
{
int ret_val;
LockDisplay(dpy);
if (dpy->qlen)
ret_val = dpy->qlen;
else
ret_val = _XEventsQueued (dpy, QueuedAfterFlush);
UnlockDisplay(dpy);
return ret_val;
}
/* $Xorg: Pending.c,v 1.4 2001/02/09 02:03:35 xorgcvs Exp $ */
/*
Copyright 1986, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "Xlibint.h"
/* Read in pending events if needed and return the number of queued events. */
int XEventsQueued (dpy, mode)
register Display *dpy;
int mode;
{
int ret_val;
LockDisplay(dpy);
if (dpy->qlen || (mode == QueuedAlready))
ret_val = dpy->qlen;
else
ret_val = _XEventsQueued (dpy, mode);
UnlockDisplay(dpy);
return ret_val;
}
int XPending (dpy)
register Display *dpy;
{
int ret_val;
LockDisplay(dpy);
if (dpy->qlen)
ret_val = dpy->qlen;
else
ret_val = _XEventsQueued (dpy, QueuedAfterFlush);
UnlockDisplay(dpy);
return ret_val;
}
/* $Xorg: XlibAsync.c,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */
/*
Copyright 1992, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NX-X11, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#define NEED_REPLIES
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <X11/Xlibint.h>
#include <X11/Xos.h>
/*ARGSUSED*/
Bool
_XAsyncErrorHandler(dpy, rep, buf, len, data)
register Display *dpy;
register xReply *rep;
char *buf;
int len;
XPointer data;
{
register _XAsyncErrorState *state;
state = (_XAsyncErrorState *)data;
if (rep->generic.type == X_Error &&
(!state->error_code ||
rep->error.errorCode == state->error_code) &&
(!state->major_opcode ||
rep->error.majorCode == state->major_opcode) &&
(!state->minor_opcode ||
rep->error.minorCode == state->minor_opcode) &&
(!state->min_sequence_number ||
(state->min_sequence_number <= dpy->last_request_read)) &&
(!state->max_sequence_number ||
(state->max_sequence_number >= dpy->last_request_read))) {
state->last_error_received = rep->error.errorCode;
state->error_count++;
return True;
}
return False;
}
void _XDeqAsyncHandler(dpy, handler)
Display *dpy;
register _XAsyncHandler *handler;
{
register _XAsyncHandler **prev;
register _XAsyncHandler *async;
for (prev = &dpy->async_handlers;
(async = *prev) && (async != handler);
prev = &async->next)
;
if (async)
*prev = async->next;
}
char *
_XGetAsyncReply(dpy, replbuf, rep, buf, len, extra, discard)
register Display *dpy;
register char *replbuf; /* data is read into this buffer */
register xReply *rep; /* value passed to calling handler */
char *buf; /* value passed to calling handler */
int len; /* value passed to calling handler */
int extra; /* extra words to read, ala _XReply */
Bool discard; /* discard after extra?, ala _XReply */
{
if (extra == 0) {
if (discard && (rep->generic.length << 2) > len)
_XEatData (dpy, (rep->generic.length << 2) - len);
return (char *)rep;
}
if (extra <= rep->generic.length) {
int size = SIZEOF(xReply) + (extra << 2);
if (size > len) {
memcpy(replbuf, buf, len);
_XRead(dpy, replbuf + len, size - len);
buf = replbuf;
len = size;
#ifdef MUSTCOPY
} else {
memcpy(replbuf, buf, size);
buf = replbuf;
#endif
}
if (discard && rep->generic.length > extra &&
(rep->generic.length << 2) > len)
_XEatData (dpy, (rep->generic.length << 2) - len);
return buf;
}
/*
*if we get here, then extra > rep->generic.length--meaning we
* read a reply that's shorter than we expected. This is an
* error, but we still need to figure out how to handle it...
*/
if ((rep->generic.length << 2) > len)
_XEatData (dpy, (rep->generic.length << 2) - len);
#ifdef NX_TRANS_SOCKET
/*
* The original code has provision
* for returning already.
*/
#endif
_XIOError (dpy);
return (char *)rep;
}
void
_XGetAsyncData(dpy, data, buf, len, skip, datalen, discardtotal)
Display *dpy;
char *data; /* data is read into this buffer */
char *buf; /* value passed to calling handler */
int len; /* value passed to calling handler */
int skip; /* number of bytes already read in previous
_XGetAsyncReply or _XGetAsyncData calls */
int datalen; /* size of data buffer in bytes */
int discardtotal; /* min. bytes to consume (after skip) */
{
buf += skip;
len -= skip;
if (!data) {
if (datalen > len)
_XEatData(dpy, datalen - len);
} else if (datalen <= len) {
memcpy(data, buf, datalen);
} else {
memcpy(data, buf, len);
_XRead(dpy, data + len, datalen - len);
}
if (discardtotal > len) {
if (datalen > len)
len = datalen;
_XEatData(dpy, discardtotal - len);
}
}
/* $Xorg: XlibAsync.c,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */
/*
Copyright 1992, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
#define NEED_REPLIES
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <X11/Xlibint.h>
#include <X11/Xos.h>
/*ARGSUSED*/
Bool
_XAsyncErrorHandler(dpy, rep, buf, len, data)
register Display *dpy;
register xReply *rep;
char *buf;
int len;
XPointer data;
{
register _XAsyncErrorState *state;
state = (_XAsyncErrorState *)data;
if (rep->generic.type == X_Error &&
(!state->error_code ||
rep->error.errorCode == state->error_code) &&
(!state->major_opcode ||
rep->error.majorCode == state->major_opcode) &&
(!state->minor_opcode ||
rep->error.minorCode == state->minor_opcode) &&
(!state->min_sequence_number ||
(state->min_sequence_number <= dpy->last_request_read)) &&
(!state->max_sequence_number ||
(state->max_sequence_number >= dpy->last_request_read))) {
state->last_error_received = rep->error.errorCode;
state->error_count++;
return True;
}
return False;
}
void _XDeqAsyncHandler(dpy, handler)
Display *dpy;
register _XAsyncHandler *handler;
{
register _XAsyncHandler **prev;
register _XAsyncHandler *async;
for (prev = &dpy->async_handlers;
(async = *prev) && (async != handler);
prev = &async->next)
;
if (async)
*prev = async->next;
}
char *
_XGetAsyncReply(dpy, replbuf, rep, buf, len, extra, discard)
register Display *dpy;
register char *replbuf; /* data is read into this buffer */
register xReply *rep; /* value passed to calling handler */
char *buf; /* value passed to calling handler */
int len; /* value passed to calling handler */
int extra; /* extra words to read, ala _XReply */
Bool discard; /* discard after extra?, ala _XReply */
{
if (extra == 0) {
if (discard && (rep->generic.length << 2) > len)
_XEatData (dpy, (rep->generic.length << 2) - len);
return (char *)rep;
}
if (extra <= rep->generic.length) {
int size = SIZEOF(xReply) + (extra << 2);
if (size > len) {
memcpy(replbuf, buf, len);
_XRead(dpy, replbuf + len, size - len);
buf = replbuf;
len = size;
#ifdef MUSTCOPY
} else {
memcpy(replbuf, buf, size);
buf = replbuf;
#endif
}
if (discard && rep->generic.length > extra &&
(rep->generic.length << 2) > len)
_XEatData (dpy, (rep->generic.length << 2) - len);
return buf;
}
/*
*if we get here, then extra > rep->generic.length--meaning we
* read a reply that's shorter than we expected. This is an
* error, but we still need to figure out how to handle it...
*/
if ((rep->generic.length << 2) > len)
_XEatData (dpy, (rep->generic.length << 2) - len);
_XIOError (dpy);
return (char *)rep;
}
void
_XGetAsyncData(dpy, data, buf, len, skip, datalen, discardtotal)
Display *dpy;
char *data; /* data is read into this buffer */
char *buf; /* value passed to calling handler */
int len; /* value passed to calling handler */
int skip; /* number of bytes already read in previous
_XGetAsyncReply or _XGetAsyncData calls */
int datalen; /* size of data buffer in bytes */
int discardtotal; /* min. bytes to consume (after skip) */
{
buf += skip;
len -= skip;
if (!data) {
if (datalen > len)
_XEatData(dpy, datalen - len);
} else if (datalen <= len) {
memcpy(data, buf, datalen);
} else {
memcpy(data, buf, len);
_XRead(dpy, data + len, datalen - len);
}
if (discardtotal > len) {
if (datalen > len)
len = datalen;
_XEatData(dpy, discardtotal - len);
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/* $Xorg: cmsProp.c,v 1.3 2000/08/17 19:45:10 cpqbld Exp $ */
/*
*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved
*
* This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this
* software and its documentation for any purpose and without fee, provided
* that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc.
*
* Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults.
*
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
* CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
*
* NAME
* XcmsProp.c
*
* DESCRIPTION
* This utility routines for manipulating properties.
*
*/
/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <X11/Xatom.h>
#include "Xlibint.h"
#include "Xcmsint.h"
#include "Cv.h"
/************************************************************************
* *
* API PRIVATE ROUTINES *
* *
************************************************************************/
/*
* NAME
* _XcmsGetElement -- get an element value from the property passed
*
* SYNOPSIS
*/
unsigned long
_XcmsGetElement(
int format,
char **pValue,
unsigned long *pCount)
/*
* DESCRIPTION
* Get the next element from the property and return it.
* Also increment the pointer the amount needed.
*
* Returns
* unsigned long
*/
{
unsigned long value;
switch (format) {
case 32:
value = *((unsigned long *)(*pValue)) & 0xFFFFFFFF;
*pValue += sizeof(unsigned long);
*pCount -= 1;
break;
case 16:
value = *((unsigned short *)(*pValue));
*pValue += sizeof(unsigned short);
*pCount -= 1;
break;
case 8:
value = *((unsigned char *) (*pValue));
*pValue += 1;
*pCount -= 1;
break;
default:
value = 0;
break;
}
return(value);
}
/*
* NAME
* _XcmsGetProperty -- Determine the existance of a property
*
* SYNOPSIS
*/
int
_XcmsGetProperty(
Display *pDpy,
Window w,
Atom property,
int *pFormat,
unsigned long *pNItems,
unsigned long *pNBytes,
char **pValue)
/*
* DESCRIPTION
*
* Returns
* 0 if property does not exist.
* 1 if property exists.
*/
{
char *prop_ret;
int format_ret;
long len = 6516;
unsigned long nitems_ret, after_ret;
Atom atom_ret;
while (XGetWindowProperty (pDpy, w, property, 0, len, False,
XA_INTEGER, &atom_ret, &format_ret,
&nitems_ret, &after_ret,
(unsigned char **)&prop_ret)) {
if (after_ret > 0) {
len += nitems_ret * (format_ret >> 3);
XFree (prop_ret);
} else {
break;
}
}
if (format_ret == 0 || nitems_ret == 0) {
/* the property does not exist or is of an unexpected type */
return(XcmsFailure);
}
*pFormat = format_ret;
*pNItems = nitems_ret;
*pNBytes = nitems_ret * (format_ret >> 3);
*pValue = prop_ret;
return(XcmsSuccess);
}
/* $Xorg: AuRead.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
/*
Copyright 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/Xau/AuRead.c,v 1.5 2001/07/25 15:04:48 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <X11/Xauth.h>
#include <stdlib.h>
#include <errno.h>
static int
read_short (unsigned short *shortp, FILE *file)
{
unsigned char file_short[2];
/*
* Added a check on EINTR to prevent the fread() call to be
* interrupted by any signal not blocked by OsBlockSignals().
*/
for (;;) {
if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) {
if (errno == EINTR && ferror (file)) {
perror ("Reading from auth file");
clearerr (file);
continue;
}
return 0;
}
break;
}
*shortp = file_short[0] * 256 + file_short[1];
return 1;
}
static int
read_counted_string (unsigned short *countp, char **stringp, FILE *file)
{
unsigned short len;
char *data;
if (read_short (&len, file) == 0)
return 0;
if (len == 0) {
data = 0;
} else {
data = malloc ((unsigned) len);
if (!data)
return 0;
for (;;)
{
if (fread (data, (int) sizeof (char), (int) len, file) != len)
{
if (errno == EINTR && ferror (file))
{
perror ("Reading from auth file");
clearerr (file);
continue;
}
bzero (data, len);
free (data);
return 0;
}
break;
}
}
*stringp = data;
*countp = len;
return 1;
}
Xauth *
XauReadAuth (auth_file)
FILE *auth_file;
{
Xauth local;
Xauth *ret;
if (read_short (&local.family, auth_file) == 0)
return 0;
if (read_counted_string (&local.address_length, &local.address, auth_file) == 0)
return 0;
if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) {
if (local.address) free (local.address);
return 0;
}
if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) {
if (local.address) free (local.address);
if (local.number) free (local.number);
return 0;
}
if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) {
if (local.address) free (local.address);
if (local.number) free (local.number);
if (local.name) free (local.name);
return 0;
}
ret = (Xauth *) malloc (sizeof (Xauth));
if (!ret) {
if (local.address) free (local.address);
if (local.number) free (local.number);
if (local.name) free (local.name);
if (local.data) {
bzero (local.data, local.data_length);
free (local.data);
}
return 0;
}
*ret = local;
return ret;
}
/* $Xorg: AuRead.c,v 1.4 2001/02/09 02:03:42 xorgcvs Exp $ */
/*
Copyright 1988, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* $XFree86: xc/lib/Xau/AuRead.c,v 1.5 2001/07/25 15:04:48 dawes Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <X11/Xauth.h>
#include <stdlib.h>
static int
read_short (unsigned short *shortp, FILE *file)
{
unsigned char file_short[2];
if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1)
return 0;
*shortp = file_short[0] * 256 + file_short[1];
return 1;
}
static int
read_counted_string (unsigned short *countp, char **stringp, FILE *file)
{
unsigned short len;
char *data;
if (read_short (&len, file) == 0)
return 0;
if (len == 0) {
data = 0;
} else {
data = malloc ((unsigned) len);
if (!data)
return 0;
if (fread (data, (int) sizeof (char), (int) len, file) != len) {
bzero (data, len);
free (data);
return 0;
}
}
*stringp = data;
*countp = len;
return 1;
}
Xauth *
XauReadAuth (auth_file)
FILE *auth_file;
{
Xauth local;
Xauth *ret;
if (read_short (&local.family, auth_file) == 0)
return 0;
if (read_counted_string (&local.address_length, &local.address, auth_file) == 0)
return 0;
if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) {
if (local.address) free (local.address);
return 0;
}
if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) {
if (local.address) free (local.address);
if (local.number) free (local.number);
return 0;
}
if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) {
if (local.address) free (local.address);
if (local.number) free (local.number);
if (local.name) free (local.name);
return 0;
}
ret = (Xauth *) malloc (sizeof (Xauth));
if (!ret) {
if (local.address) free (local.address);
if (local.number) free (local.number);
if (local.name) free (local.name);
if (local.data) {
bzero (local.data, local.data_length);
free (local.data);
}
return 0;
}
*ret = local;
return ret;
}
XCOMM $XFree86: xc/lib/Xpm/Imakefile,v 1.1 1999/01/11 14:40:02 dawes Exp $
/* This is a simplified version of the standard Xpm Imakefile */
#ifdef SunArchitecture
#define DoNormalLib YES
#else
#define DoNormalLib NormalLibXpm
#endif
#define DoSharedLib SharedLibXpm
#define DoExtraLib SharedLibXpm
#define DoDebugLib DebugLibXpm
#define DoProfileLib ProfileLibXpm
#define HasSharedData NO
#define LibName Xpm
#define SoRev SOXPMREV
#define IncSubdir X11
#ifdef SharedXpmReqs
REQUIREDLIBS = SharedXpmReqs
#endif
/*
* if your system doesn't provide strcasecmp add -DNEED_STRCASECMP
* if your system doesn't provide strdup add -DNEED_STRDUP
* if your system doesn't provide pipe add -DNO_ZPIPE
* if on your system sprintf doesn't return the number of bytes transmitted
* add -DVOID_SPRINTF
* if you want xpm to try name.xpm.Z and name.xpm.gz when asked to read
* name.xpm , add -DSTAT_ZFILE
*/
#if defined(LinuxArchitecture)
ZFILEDEF = -DSTAT_ZFILE
#endif
#if defined(UltrixArchitecture) || \
(defined(MipsArchitecture) && !defined(SGIArchitecture))
STRDUPDEF = -DNEED_STRDUP
#endif
#if !HasStrcasecmp
STRCASECMPDEF = -DNEED_STRCASECMP
#endif
#if defined(SunArchitecture) && !defined(SVR4Architecture)
SPRINTFDEF = -DVOID_SPRINTF
#endif
#if HasStrlcat
STRLCATDEF = -DHAS_STRLCAT
#endif
#if HasSnprintf
SNPRINTFDEF = -DHAS_SNPRINTF
#else
SNPRINTFDEF = -Dsnprintf=_XpmSnprintf
SNPRINTFSRCS = snprintf.c
SNPRINTFOBJS = snprintf.o
#endif
#if defined(Win32Architecture)
ZPIPEDEF = -DNO_ZPIPE
#endif
DEFINES = $(STRDUPDEF) $(STRCASECMPDEF) $(SPRINTFDEF) $(STRLCATDEF) \
$(SNPRINTFDEF) $(ZPIPEDEF) $(ZFILEDEF)
HEADERS = xpm.h
SRCS = data.c create.c misc.c rgb.c scan.c parse.c hashtab.c \
CrBufFrI.c CrDatFrP.c CrPFrBuf.c RdFToI.c WrFFrI.c \
CrBufFrP.c CrIFrBuf.c CrPFrDat.c RdFToP.c WrFFrP.c \
CrDatFrI.c CrIFrDat.c RdFToDat.c WrFFrDat.c \
Attrib.c CrIFrP.c CrPFrI.c Image.c Info.c RdFToBuf.c WrFFrBuf.c \
$(SNPRINTFSRCS)
OBJS = data.o create.o misc.o rgb.o scan.o parse.o hashtab.o \
CrBufFrI.o CrDatFrP.o CrPFrBuf.o RdFToI.o WrFFrI.o \
CrBufFrP.o CrIFrBuf.o CrPFrDat.o RdFToP.o WrFFrP.o \
CrDatFrI.o CrIFrDat.o RdFToDat.o WrFFrDat.o \
Attrib.o CrIFrP.o CrPFrI.o Image.o Info.o RdFToBuf.o WrFFrBuf.o \
$(SNPRINTFOBJS)
XPMDIR = $(TOP)/extras/Xpm
XPMLIBDIR = $(TOP)/extras/Xpm/lib
INCLUDES = -I$(XPMLIBDIR)
LINTLIBS = $(LINTXTOLL) $(LINTXLIB)
#include <Library.tmpl>
LinkSourceFile(data.c,$(XPMLIBDIR))
LinkSourceFile(create.c,$(XPMLIBDIR))
LinkSourceFile(misc.c,$(XPMLIBDIR))
LinkSourceFile(rgb.c,$(XPMLIBDIR))
LinkSourceFile(scan.c,$(XPMLIBDIR))
LinkSourceFile(parse.c,$(XPMLIBDIR))
LinkSourceFile(hashtab.c,$(XPMLIBDIR))
LinkSourceFile(CrBufFrI.c,$(XPMLIBDIR))
LinkSourceFile(CrDatFrP.c,$(XPMLIBDIR))
LinkSourceFile(CrPFrBuf.c,$(XPMLIBDIR))
LinkSourceFile(RdFToI.c,$(XPMLIBDIR))
LinkSourceFile(WrFFrI.c,$(XPMLIBDIR))
LinkSourceFile(CrBufFrP.c,$(XPMLIBDIR))
LinkSourceFile(CrIFrBuf.c,$(XPMLIBDIR))
LinkSourceFile(CrPFrDat.c,$(XPMLIBDIR))
LinkSourceFile(RdFToP.c,$(XPMLIBDIR))
LinkSourceFile(WrFFrP.c,$(XPMLIBDIR))
LinkSourceFile(CrDatFrI.c,$(XPMLIBDIR))
LinkSourceFile(CrIFrDat.c,$(XPMLIBDIR))
LinkSourceFile(RdFToDat.c,$(XPMLIBDIR))
LinkSourceFile(WrFFrDat.c,$(XPMLIBDIR))
LinkSourceFile(Attrib.c,$(XPMLIBDIR))
LinkSourceFile(CrIFrP.c,$(XPMLIBDIR))
LinkSourceFile(CrPFrI.c,$(XPMLIBDIR))
LinkSourceFile(Image.c,$(XPMLIBDIR))
LinkSourceFile(Info.c,$(XPMLIBDIR))
LinkSourceFile(RdFToBuf.c,$(XPMLIBDIR))
LinkSourceFile(WrFFrBuf.c,$(XPMLIBDIR))
LinkSourceFile(xpm.h,$(XPMLIBDIR))
#if !HasSnprintf
LinkSourceFile(snprintf.c,$(LIBSRC)/misc)
#endif
DependTarget()
XCOMM $XFree86: xc/lib/Xpm/Imakefile,v 1.1 1999/01/11 14:40:02 dawes Exp $
/* This is a simplified version of the standard Xpm Imakefile */
#define DoNormalLib NormalLibXpm
#define DoSharedLib SharedLibXpm
#define DoExtraLib SharedLibXpm
#define DoDebugLib DebugLibXpm
#define DoProfileLib ProfileLibXpm
#define HasSharedData NO
#define LibName Xpm
#define SoRev SOXPMREV
#define IncSubdir X11
#ifdef SharedXpmReqs
REQUIREDLIBS = SharedXpmReqs
#endif
/*
* if your system doesn't provide strcasecmp add -DNEED_STRCASECMP
* if your system doesn't provide strdup add -DNEED_STRDUP
* if your system doesn't provide pipe add -DNO_ZPIPE
* if on your system sprintf doesn't return the number of bytes transmitted
* add -DVOID_SPRINTF
* if you want xpm to try name.xpm.Z and name.xpm.gz when asked to read
* name.xpm , add -DSTAT_ZFILE
*/
#if defined(LinuxArchitecture)
ZFILEDEF = -DSTAT_ZFILE
#endif
#if defined(UltrixArchitecture) || \
(defined(MipsArchitecture) && !defined(SGIArchitecture))
STRDUPDEF = -DNEED_STRDUP
#endif
#if !HasStrcasecmp
STRCASECMPDEF = -DNEED_STRCASECMP
#endif
#if defined(SunArchitecture) && !defined(SVR4Architecture)
SPRINTFDEF = -DVOID_SPRINTF
#endif
#if HasStrlcat
STRLCATDEF = -DHAS_STRLCAT
#endif
#if HasSnprintf
SNPRINTFDEF = -DHAS_SNPRINTF
#else
SNPRINTFDEF = -Dsnprintf=_XpmSnprintf
SNPRINTFSRCS = snprintf.c
SNPRINTFOBJS = snprintf.o
#endif
#if defined(Win32Architecture)
ZPIPEDEF = -DNO_ZPIPE
#endif
DEFINES = $(STRDUPDEF) $(STRCASECMPDEF) $(SPRINTFDEF) $(STRLCATDEF) \
$(SNPRINTFDEF) $(ZPIPEDEF) $(ZFILEDEF)
HEADERS = xpm.h
SRCS = data.c create.c misc.c rgb.c scan.c parse.c hashtab.c \
CrBufFrI.c CrDatFrP.c CrPFrBuf.c RdFToI.c WrFFrI.c \
CrBufFrP.c CrIFrBuf.c CrPFrDat.c RdFToP.c WrFFrP.c \
CrDatFrI.c CrIFrDat.c RdFToDat.c WrFFrDat.c \
Attrib.c CrIFrP.c CrPFrI.c Image.c Info.c RdFToBuf.c WrFFrBuf.c \
$(SNPRINTFSRCS)
OBJS = data.o create.o misc.o rgb.o scan.o parse.o hashtab.o \
CrBufFrI.o CrDatFrP.o CrPFrBuf.o RdFToI.o WrFFrI.o \
CrBufFrP.o CrIFrBuf.o CrPFrDat.o RdFToP.o WrFFrP.o \
CrDatFrI.o CrIFrDat.o RdFToDat.o WrFFrDat.o \
Attrib.o CrIFrP.o CrPFrI.o Image.o Info.o RdFToBuf.o WrFFrBuf.o \
$(SNPRINTFOBJS)
XPMDIR = $(TOP)/extras/Xpm
XPMLIBDIR = $(TOP)/extras/Xpm/lib
INCLUDES = -I$(XPMLIBDIR)
LINTLIBS = $(LINTXTOLL) $(LINTXLIB)
#include <Library.tmpl>
LinkSourceFile(data.c,$(XPMLIBDIR))
LinkSourceFile(create.c,$(XPMLIBDIR))
LinkSourceFile(misc.c,$(XPMLIBDIR))
LinkSourceFile(rgb.c,$(XPMLIBDIR))
LinkSourceFile(scan.c,$(XPMLIBDIR))
LinkSourceFile(parse.c,$(XPMLIBDIR))
LinkSourceFile(hashtab.c,$(XPMLIBDIR))
LinkSourceFile(CrBufFrI.c,$(XPMLIBDIR))
LinkSourceFile(CrDatFrP.c,$(XPMLIBDIR))
LinkSourceFile(CrPFrBuf.c,$(XPMLIBDIR))
LinkSourceFile(RdFToI.c,$(XPMLIBDIR))
LinkSourceFile(WrFFrI.c,$(XPMLIBDIR))
LinkSourceFile(CrBufFrP.c,$(XPMLIBDIR))
LinkSourceFile(CrIFrBuf.c,$(XPMLIBDIR))
LinkSourceFile(CrPFrDat.c,$(XPMLIBDIR))
LinkSourceFile(RdFToP.c,$(XPMLIBDIR))
LinkSourceFile(WrFFrP.c,$(XPMLIBDIR))
LinkSourceFile(CrDatFrI.c,$(XPMLIBDIR))
LinkSourceFile(CrIFrDat.c,$(XPMLIBDIR))
LinkSourceFile(RdFToDat.c,$(XPMLIBDIR))
LinkSourceFile(WrFFrDat.c,$(XPMLIBDIR))
LinkSourceFile(Attrib.c,$(XPMLIBDIR))
LinkSourceFile(CrIFrP.c,$(XPMLIBDIR))
LinkSourceFile(CrPFrI.c,$(XPMLIBDIR))
LinkSourceFile(Image.c,$(XPMLIBDIR))
LinkSourceFile(Info.c,$(XPMLIBDIR))
LinkSourceFile(RdFToBuf.c,$(XPMLIBDIR))
LinkSourceFile(WrFFrBuf.c,$(XPMLIBDIR))
LinkSourceFile(xpm.h,$(XPMLIBDIR))
#if !HasSnprintf
LinkSourceFile(snprintf.c,$(LIBSRC)/misc)
#endif
DependTarget()
XCOMM $Xorg: Imakefile,v 1.4 2000/08/17 19:47:01 cpqbld Exp $
XCOMM $XFree86: xc/programs/Imakefile,v 3.54 2003/04/14 20:37:16 herrb Exp $
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NX-X11, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#define IHaveSubdirs
#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)"
#if BuildServer || UseRgbTxt
RGBSRCDIR = rgb
#endif
#if BuildServer
XSSRCDIR = Xserver
#endif
#if BuildXkbcomp
XKBCOMPDIR = xkbcomp
#endif
#ifndef Win32Architecture
#if HasXServer
XINITSRCDIR = xinit
#endif
#if BuildFontServer
XFSSRCDIR = xfs
#endif
#if BuildXKBlib
XKBSRCDIRS = setxkbmap $(XKBCOMPDIR) xkbevd xkbprint xkbutils
#endif
#if BuildScreenSaverLibrary
SCREENSAVESRCDIR = beforelight
#endif
#if BuildXF86VidModeLibrary
XVIDTUNESRCDIR = xvidtune
#endif
#if BuildXF86DGALibrary
XF86DGASRCDIR = xf86dga
#endif
#if BuildXAServer
XASSRCDIR = Xaserver
#endif
#if BuildLBX
LBXPROXYSRCDIR = lbxproxy
#endif
#if BuildXprintClients
XPSRCDIRS = xplsprinters xprehashprinterlist xphelloworld xpr
#endif
PROXYMGRSRCDIR = proxymngr
RSTARTSRCDIR = rstart
SMPROXYSRCDIR = smproxy
TWMSRCDIR = twm
XCONSOLESRCDIR = xconsole
XDMSRCDIR = xdm
XFINDPROXYSRCDIR = xfindproxy
XFWPSRCDIR = xfwp
#if BuildXF86VidModeLibrary
XGAMMASRCDIR = xgamma
#endif
#if BuildXvLibrary
XVINFOSRCDIR = xvinfo
#endif
XHOSTSRCDIR = xhost
#if BuildPlugin && BuildXaw
XRXSRCDIR = xrx
#endif
XSMSRCDIR = xsm
#if BuildXterm
XTERMSRCDIR = xterm
#endif
SCRIPTSDIR = scripts
#endif /* Win32Architecture */
#if BuildCID
MKCFMSRCDIR = mkcfm
#endif
#if (HasFreetype2 || BuildFreetype2Library) && BuildFontEncLib
MKFONTSCALEDIR = mkfontscale
#endif
#if BuildXInputLib
XINPUTCLIENTDIRS = xsetmode xsetpointer
#endif
#if BuildXTrapLibrary
XTRAPCLIENTDIRS = xtrap
#endif
/* makepsres should be considered as part of the DPS libraries */
#if BuildDPSLibraries
MAKEPSRESDIR = makepsres
#endif
/* on the other hand, the following are independent clients */
#if BuildDPSClients
DPSCLIENTDIRS = dpsinfo dpsexec texteroids
#endif
#if BuildDBElib && BuildXprintClients
DBECLIENTDIRS = xdbedizzy
#endif
XPMCLIENTDIRS = cxpm sxpm
#if BuildGLXLibrary
GLXCLIENTDIRS = glxinfo glxgears
#endif
XLOADDIR = xload
#if BuildRandRLibrary
XRANDRDIR = xrandr
#endif
#if BuildXcursorgen
XCURSORGENDIR = xcursorgen
#endif
#if BuildFontconfigLibrary
FCDIRS = fc-cache fc-list
#endif
#if 0
FCLANGDIR = fc-lang
#endif
#if BuildXDriInfo
XDRIINFO = xdriinfo
#endif
#if BuildXaw
XMORE = xmore
#endif
#if BuildServersOnly || !BuildClients
#if defined(NXEmbeddedXServer)
SUBDIRS = $(XSSRCDIR)
#else
SUBDIRS = $(XSSRCDIR) nxauth
#endif
#else
SUBDIRS = \
appres bdftopcf bitmap \
$(SCREENSAVESRCDIR) editres $(FCDIRS) $(FCLANGDIR) fslsfonts fstobdf \
iceauth ico listres luit \
$(MAKEPSRESDIR) $(DPSCLIENTDIRS) $(DBECLIENTDIRS) \
$(MKCFMSRCDIR) \
mkfontdir $(MKFONTSCALEDIR) oclock $(PROXYMGRSRCDIR) \
$(RGBSRCDIR) $(RSTARTSRCDIR) showfont \
$(SMPROXYSRCDIR) $(TWMSRCDIR) viewres x11perf xauth xbiff xcalc \
xclipboard xclock \
xcmsdb $(XCONSOLESRCDIR) xditview $(XDMSRCDIR) xdpyinfo \
$(XF86DGASRCDIR) xedit xev xeyes xfd xfontsel $(XFSSRCDIR) xfsinfo \
$(XFINDPROXYSRCDIR) $(XFWPSRCDIR) $(XGAMMASRCDIR) xgc $(XHOSTSRCDIR) \
$(XINITSRCDIR) $(XKBSRCDIRS) xkill $(XLOADDIR) xlogo xlsatoms \
xlsclients xlsfonts xmag xman xmessage xmh xmodmap $(XMORE) xprop \
xrdb xrefresh $(XRXSRCDIR) xset \
xsetroot $(XSMSRCDIR) xstdcmap $(XINPUTCLIENTDIRS) \
$(XTERMSRCDIR) $(XTRAPCLIENTDIRS) $(XVIDTUNESRCDIR) xwd xwininfo xwud \
$(XPMCLIENTDIRS) $(XVINFOSRCDIR) \
$(XSSRCDIR) $(XASSRCDIR) $(LBXPROXYSRCDIR) $(XPSRCDIRS) $(SCRIPTSDIR) \
$(GLXCLIENTDIRS) $(XRANDRDIR) $(XCURSORGENDIR) $(XDRIINFO)
#endif
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
XCOMM $Xorg: Imakefile,v 1.4 2000/08/17 19:47:01 cpqbld Exp $
XCOMM $XFree86: xc/programs/Imakefile,v 3.54 2003/04/14 20:37:16 herrb Exp $
#define IHaveSubdirs
#define PassCDebugFlags CDEBUGFLAGS="$(CDEBUGFLAGS)"
#if BuildServer || UseRgbTxt
RGBSRCDIR = rgb
#endif
#if BuildServer
XSSRCDIR = Xserver
#endif
#if BuildXkbcomp
XKBCOMPDIR = xkbcomp
#endif
#ifndef Win32Architecture
#if HasXServer
XINITSRCDIR = xinit
#endif
#if BuildFontServer
XFSSRCDIR = xfs
#endif
#if BuildXKBlib
XKBSRCDIRS = setxkbmap $(XKBCOMPDIR) xkbevd xkbprint xkbutils
#endif
#if BuildScreenSaverLibrary
SCREENSAVESRCDIR = beforelight
#endif
#if BuildXF86VidModeLibrary
XVIDTUNESRCDIR = xvidtune
#endif
#if BuildXF86DGALibrary
XF86DGASRCDIR = xf86dga
#endif
#if BuildXAServer
XASSRCDIR = Xaserver
#endif
#if BuildLBX
LBXPROXYSRCDIR = lbxproxy
#endif
#if BuildXprintClients
XPSRCDIRS = xplsprinters xprehashprinterlist xphelloworld xpr
#endif
PROXYMGRSRCDIR = proxymngr
RSTARTSRCDIR = rstart
SMPROXYSRCDIR = smproxy
TWMSRCDIR = twm
XCONSOLESRCDIR = xconsole
XDMSRCDIR = xdm
XFINDPROXYSRCDIR = xfindproxy
XFWPSRCDIR = xfwp
#if BuildXF86VidModeLibrary
XGAMMASRCDIR = xgamma
#endif
#if BuildXvLibrary
XVINFOSRCDIR = xvinfo
#endif
XHOSTSRCDIR = xhost
#if BuildPlugin && BuildXaw
XRXSRCDIR = xrx
#endif
XSMSRCDIR = xsm
#if BuildXterm
XTERMSRCDIR = xterm
#endif
SCRIPTSDIR = scripts
#endif /* Win32Architecture */
#if BuildCID
MKCFMSRCDIR = mkcfm
#endif
#if (HasFreetype2 || BuildFreetype2Library) && BuildFontEncLib
MKFONTSCALEDIR = mkfontscale
#endif
#if BuildXInputLib
XINPUTCLIENTDIRS = xsetmode xsetpointer
#endif
#if BuildXTrapLibrary
XTRAPCLIENTDIRS = xtrap
#endif
/* makepsres should be considered as part of the DPS libraries */
#if BuildDPSLibraries
MAKEPSRESDIR = makepsres
#endif
/* on the other hand, the following are independent clients */
#if BuildDPSClients
DPSCLIENTDIRS = dpsinfo dpsexec texteroids
#endif
#if BuildDBElib && BuildXprintClients
DBECLIENTDIRS = xdbedizzy
#endif
XPMCLIENTDIRS = cxpm sxpm
#if BuildGLXLibrary
GLXCLIENTDIRS = glxinfo glxgears
#endif
XLOADDIR = xload
#if BuildRandRLibrary
XRANDRDIR = xrandr
#endif
#if BuildXcursorgen
XCURSORGENDIR = xcursorgen
#endif
#if BuildFontconfigLibrary
FCDIRS = fc-cache fc-list
#endif
#if 0
FCLANGDIR = fc-lang
#endif
#if BuildXDriInfo
XDRIINFO = xdriinfo
#endif
#if BuildXaw
XMORE = xmore
#endif
#if BuildServersOnly || !BuildClients
SUBDIRS = $(XSSRCDIR) $(XKBCOMPDIR)
#else
SUBDIRS = \
appres bdftopcf bitmap \
$(SCREENSAVESRCDIR) editres $(FCDIRS) $(FCLANGDIR) fslsfonts fstobdf \
iceauth ico listres luit \
$(MAKEPSRESDIR) $(DPSCLIENTDIRS) $(DBECLIENTDIRS) \
$(MKCFMSRCDIR) \
mkfontdir $(MKFONTSCALEDIR) oclock $(PROXYMGRSRCDIR) \
$(RGBSRCDIR) $(RSTARTSRCDIR) showfont \
$(SMPROXYSRCDIR) $(TWMSRCDIR) viewres x11perf xauth xbiff xcalc \
xclipboard xclock \
xcmsdb $(XCONSOLESRCDIR) xditview $(XDMSRCDIR) xdpyinfo \
$(XF86DGASRCDIR) xedit xev xeyes xfd xfontsel $(XFSSRCDIR) xfsinfo \
$(XFINDPROXYSRCDIR) $(XFWPSRCDIR) $(XGAMMASRCDIR) xgc $(XHOSTSRCDIR) \
$(XINITSRCDIR) $(XKBSRCDIRS) xkill $(XLOADDIR) xlogo xlsatoms \
xlsclients xlsfonts xmag xman xmessage xmh xmodmap $(XMORE) xprop \
xrdb xrefresh $(XRXSRCDIR) xset \
xsetroot $(XSMSRCDIR) xstdcmap $(XINPUTCLIENTDIRS) \
$(XTERMSRCDIR) $(XTRAPCLIENTDIRS) $(XVIDTUNESRCDIR) xwd xwininfo xwud \
$(XPMCLIENTDIRS) $(XVINFOSRCDIR) \
$(XSSRCDIR) $(XASSRCDIR) $(LBXPROXYSRCDIR) $(XPSRCDIRS) $(SCRIPTSDIR) \
$(GLXCLIENTDIRS) $(XRANDRDIR) $(XCURSORGENDIR) $(XDRIINFO)
#endif
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.8 2004/02/03 23:04:08 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/* #define NEED_REPLIES */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <glxserver.h>
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
#include "indirect_size.h"
void __glXDisp_Map1f(GLbyte *pc)
{
GLint order, k;
GLfloat u1, u2, *points;
GLenum target;
target = *(GLenum *)(pc + 0);
order = *(GLint *)(pc + 12);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
points = (GLfloat *)(pc + 16);
k = __glMap1f_size(target);
glMap1f(target, u1, u2, k, order, points);
}
void __glXDisp_Map2f(GLbyte *pc)
{
GLint uorder, vorder, ustride, vstride, k;
GLfloat u1, u2, v1, v2, *points;
GLenum target;
target = *(GLenum *)(pc + 0);
uorder = *(GLint *)(pc + 12);
vorder = *(GLint *)(pc + 24);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
v1 = *(GLfloat *)(pc + 16);
v2 = *(GLfloat *)(pc + 20);
points = (GLfloat *)(pc + 28);
k = __glMap2f_size(target);
ustride = vorder * k;
vstride = k;
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDisp_Map1d(GLbyte *pc)
{
GLint order, k;
#ifdef __GLX_ALIGN64
GLint compsize;
#endif
GLenum target;
GLdouble u1, u2, *points;
target = *(GLenum*) (pc + 16);
order = *(GLint*) (pc + 20);
k = __glMap1d_size(target);
#ifdef __GLX_ALIGN64
if (order < 0 || k < 0) {
compsize = 0;
} else {
compsize = order * k;
}
#endif
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
pc += 24;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap1d(target, u1, u2, k, order, points);
}
void __glXDisp_Map2d(GLbyte *pc)
{
GLdouble u1, u2, v1, v2, *points;
GLint uorder, vorder, ustride, vstride, k;
#ifdef __GLX_ALIGN64
GLint compsize;
#endif
GLenum target;
target = *(GLenum *)(pc + 32);
uorder = *(GLint *)(pc + 36);
vorder = *(GLint *)(pc + 40);
k = __glMap2d_size(target);
#ifdef __GLX_ALIGN64
if (vorder < 0 || uorder < 0 || k < 0) {
compsize = 0;
} else {
compsize = uorder * vorder * k;
}
#endif
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
__GLX_GET_DOUBLE(v1,pc+16);
__GLX_GET_DOUBLE(v2,pc+24);
pc += 44;
ustride = vorder * k;
vstride = k;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDisp_CallLists(GLbyte *pc)
{
GLenum type;
GLsizei n;
type = *(GLenum *)(pc + 4);
n = *(GLsizei *)(pc + 0);
glCallLists(n, type, pc + 8);
}
void __glXDisp_DrawArrays(GLbyte *pc)
{
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
__GLXdispatchDrawArraysComponentHeader *compHeader;
GLint numVertexes = hdr->numVertexes;
GLint numComponents = hdr->numComponents;
GLenum primType = hdr->primType;
GLint stride = 0;
int i;
pc += sizeof(__GLXdispatchDrawArraysHeader);
compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
/* compute stride (same for all component arrays) */
for (i = 0; i < numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
/* set up component arrays */
for (i = 0; i < numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
GLenum component = compHeader[i].component;
switch (component) {
case GL_VERTEX_ARRAY:
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(numVals, datatype, stride, pc);
break;
case GL_NORMAL_ARRAY:
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(datatype, stride, pc);
break;
case GL_COLOR_ARRAY:
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(numVals, datatype, stride, pc);
break;
case GL_INDEX_ARRAY:
glEnableClientState(GL_INDEX_ARRAY);
glIndexPointer(datatype, stride, pc);
break;
case GL_TEXTURE_COORD_ARRAY:
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(numVals, datatype, stride, pc);
break;
case GL_EDGE_FLAG_ARRAY:
glEnableClientState(GL_EDGE_FLAG_ARRAY);
glEdgeFlagPointer(stride, (const GLboolean *)pc);
break;
case GL_SECONDARY_COLOR_ARRAY:
glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
glSecondaryColorPointer(numVals, datatype, stride, pc);
break;
case GL_FOG_COORD_ARRAY:
glEnableClientState(GL_FOG_COORD_ARRAY);
glFogCoordPointer(datatype, stride, pc);
break;
default:
break;
}
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
glDrawArrays(primType, 0, numVertexes);
/* turn off anything we might have turned on */
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_INDEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_EDGE_FLAG_ARRAY);
glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
glDisableClientState(GL_FOG_COORD_ARRAY);
}
void __glXDisp_DrawArraysEXT(GLbyte *pc)
{
__glXDisp_DrawArrays(pc);
}
/* $XFree86: xc/programs/Xserver/GL/glx/render2.c,v 1.8 2004/02/03 23:04:08 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
*/
/* #define NEED_REPLIES */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <glxserver.h>
#include "unpack.h"
#include "g_disptab.h"
#include "g_disptab_EXT.h"
void __glXDisp_Map1f(GLbyte *pc)
{
GLint order, k;
GLfloat u1, u2, *points;
GLenum target;
target = *(GLenum *)(pc + 0);
order = *(GLint *)(pc + 12);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
points = (GLfloat *)(pc + 16);
k = __glMap1f_size(target);
glMap1f(target, u1, u2, k, order, points);
}
void __glXDisp_Map2f(GLbyte *pc)
{
GLint uorder, vorder, ustride, vstride, k;
GLfloat u1, u2, v1, v2, *points;
GLenum target;
target = *(GLenum *)(pc + 0);
uorder = *(GLint *)(pc + 12);
vorder = *(GLint *)(pc + 24);
u1 = *(GLfloat *)(pc + 4);
u2 = *(GLfloat *)(pc + 8);
v1 = *(GLfloat *)(pc + 16);
v2 = *(GLfloat *)(pc + 20);
points = (GLfloat *)(pc + 28);
k = __glMap2f_size(target);
ustride = vorder * k;
vstride = k;
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDisp_Map1d(GLbyte *pc)
{
GLint order, k;
#ifdef __GLX_ALIGN64
GLint compsize;
#endif
GLenum target;
GLdouble u1, u2, *points;
target = *(GLenum*) (pc + 16);
order = *(GLint*) (pc + 20);
k = __glMap1d_size(target);
#ifdef __GLX_ALIGN64
if (order < 0 || k < 0) {
compsize = 0;
} else {
compsize = order * k;
}
#endif
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
pc += 24;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap1d(target, u1, u2, k, order, points);
}
void __glXDisp_Map2d(GLbyte *pc)
{
GLdouble u1, u2, v1, v2, *points;
GLint uorder, vorder, ustride, vstride, k;
#ifdef __GLX_ALIGN64
GLint compsize;
#endif
GLenum target;
target = *(GLenum *)(pc + 32);
uorder = *(GLint *)(pc + 36);
vorder = *(GLint *)(pc + 40);
k = __glMap2d_size(target);
#ifdef __GLX_ALIGN64
if (vorder < 0 || uorder < 0 || k < 0) {
compsize = 0;
} else {
compsize = uorder * vorder * k;
}
#endif
__GLX_GET_DOUBLE(u1,pc);
__GLX_GET_DOUBLE(u2,pc+8);
__GLX_GET_DOUBLE(v1,pc+16);
__GLX_GET_DOUBLE(v2,pc+24);
pc += 44;
ustride = vorder * k;
vstride = k;
#ifdef __GLX_ALIGN64
if (((unsigned long)pc) & 7) {
/*
** Copy the doubles up 4 bytes, trashing the command but aligning
** the data in the process
*/
__GLX_MEM_COPY(pc-4, pc, compsize*8);
points = (GLdouble*) (pc - 4);
} else {
points = (GLdouble*) pc;
}
#else
points = (GLdouble*) pc;
#endif
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
}
void __glXDisp_CallLists(GLbyte *pc)
{
GLenum type;
GLsizei n;
type = *(GLenum *)(pc + 4);
n = *(GLsizei *)(pc + 0);
glCallLists(n, type, pc + 8);
}
void __glXDisp_DrawArrays(GLbyte *pc)
{
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
__GLXdispatchDrawArraysComponentHeader *compHeader;
GLint numVertexes = hdr->numVertexes;
GLint numComponents = hdr->numComponents;
GLenum primType = hdr->primType;
GLint stride = 0;
int i;
pc += sizeof(__GLXdispatchDrawArraysHeader);
compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
/* compute stride (same for all component arrays) */
for (i = 0; i < numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
/* set up component arrays */
for (i = 0; i < numComponents; i++) {
GLenum datatype = compHeader[i].datatype;
GLint numVals = compHeader[i].numVals;
GLenum component = compHeader[i].component;
switch (component) {
case GL_VERTEX_ARRAY:
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(numVals, datatype, stride, pc);
break;
case GL_NORMAL_ARRAY:
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(datatype, stride, pc);
break;
case GL_COLOR_ARRAY:
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(numVals, datatype, stride, pc);
break;
case GL_INDEX_ARRAY:
glEnableClientState(GL_INDEX_ARRAY);
glIndexPointer(datatype, stride, pc);
break;
case GL_TEXTURE_COORD_ARRAY:
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(numVals, datatype, stride, pc);
break;
case GL_EDGE_FLAG_ARRAY:
glEnableClientState(GL_EDGE_FLAG_ARRAY);
glEdgeFlagPointer(stride, (const GLboolean *)pc);
break;
case GL_SECONDARY_COLOR_ARRAY:
glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
glSecondaryColorPointer(numVals, datatype, stride, pc);
break;
case GL_FOG_COORD_ARRAY:
glEnableClientState(GL_FOG_COORD_ARRAY);
glFogCoordPointer(datatype, stride, pc);
break;
default:
break;
}
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
}
glDrawArrays(primType, 0, numVertexes);
/* turn off anything we might have turned on */
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_INDEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_EDGE_FLAG_ARRAY);
glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
glDisableClientState(GL_FOG_COORD_ARRAY);
}
void __glXDisp_DrawArraysEXT(GLbyte *pc)
{
__glXDisp_DrawArrays(pc);
}
XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/Imakefile,v 1.16 2002/11/22 22:56:01 tsi Exp $
#if DoLoadableServer
#if !BuildModuleInSubdir
#define IHaveModules
#elif !defined(IHaveModules)
#define IHaveSubdirs
SUBDIRS = module
#endif
#endif
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaXBuildDir /**/
#define MesaInXServer
#if !defined(IHaveModules) || !BuildModuleInSubdir
#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
#else
#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
#endif
LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11)
DRIVER_SRCS = $(XMESA_SRCS)
DRIVER_OBJS = $(XMESA_OBJS)
COMMON_SRCS = driverfuncs.c
COMMON_OBJS = driverfuncs.o
#ifndef XFree86Version
/* This appears to be the quickest way to build a non-XFree86 server */
GLXSRV_DEFINES = -DXFree86Server
#endif
GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c
GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o
SRCS = $(DRIVER_SRCS) $(GLX_SRCS) $(COMMON_SRCS)
OBJS = $(DRIVER_OBJS) $(GLX_OBJS) $(COMMON_OBJS)
INCLUDES = -I$(SERVERSRC)/GL/mesa/X -I$(XINCLUDESRC) \
-I$(EXTINCSRC) \
-I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src -I$(MESASRCDIR)/src/mesa/drivers/x11 \
-I$(MESASRCDIR)/include \
-I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \
-I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \
-I$(SERVERSRC)/GL/glx \
-I$(XF86OSSRC) \
-I$(DRMSRCDIR)/shared-core
DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
#ifdef IHaveModules
ModuleObjectRule()
#else
NormalLibraryObjectRule()
#endif
SubdirLibraryRule($(OBJS))
LintLibraryTarget(dri,$(SRCS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
#if defined(IHaveModules) && BuildModuleInSubdir
LinkSourceFile(xf86glx.c,..)
LinkSourceFile(xf86glx_util.c,..)
#endif
#ifndef MesaDrvSrcDir
#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri
#endif
MESADRVSRCDIR = MesaDrvSrcDir
LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common)
LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common)
XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/X/Imakefile,v 1.16 2002/11/22 22:56:01 tsi Exp $
#if DoLoadableServer
#if !BuildModuleInSubdir
#define IHaveModules
#elif !defined(IHaveModules)
#define IHaveSubdirs
SUBDIRS = module
#endif
#endif
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaXBuildDir /**/
#define MesaInXServer
#if !defined(IHaveModules) || !BuildModuleInSubdir
#include "../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
#else
#include "../../../../../../lib/GL/mesa/drivers/x11/Imakefile.inc"
#endif
LinkSourceFile(compsize.c,$(MESASRCDIR)/src/glx/x11)
DRIVER_SRCS = $(XMESA_SRCS)
DRIVER_OBJS = $(XMESA_OBJS)
COMMON_SRCS = driverfuncs.c
COMMON_OBJS = driverfuncs.o
#ifndef XFree86Version
/* This appears to be the quickest way to build a non-XFree86 server */
GLXSRV_DEFINES = -DXFree86Server
#endif
GLX_SRCS = xf86glx.c xf86glx_util.c compsize.c
GLX_OBJS = xf86glx.o xf86glx_util.o compsize.o
SRCS = $(DRIVER_SRCS) $(GLX_SRCS) $(COMMON_SRCS)
OBJS = $(DRIVER_OBJS) $(GLX_OBJS) $(COMMON_OBJS)
INCLUDES = -I$(SERVERSRC)/GL/mesa/X -I$(XINCLUDESRC) \
-I$(EXTINCSRC) \
-I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src -I$(MESASRCDIR)/src/mesa/drivers/x11 \
-I$(MESASRCDIR)/include \
-I$(LIBSRC)/GL/glx -I$(LIBSRC)/GL/include \
-I$(SERVERSRC)/include -I$(SERVERSRC)/GL/include \
-I$(SERVERSRC)/GL/glx \
-I$(XF86OSSRC) \
-I$(DRMSRCDIR)/shared-core
DEFINES = $(GLX_DEFINES) $(GLXSRV_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
#ifdef IHaveModules
ModuleObjectRule()
#else
NormalLibraryObjectRule()
#endif
SubdirLibraryRule($(OBJS))
LintLibraryTarget(dri,$(SRCS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
#if defined(IHaveModules) && BuildModuleInSubdir
LinkSourceFile(xf86glx.c,..)
LinkSourceFile(xf86glx_util.c,..)
#endif
#ifndef MesaDrvSrcDir
#define MesaDrvSrcDir $(MESASRCDIR)/src/mesa/drivers/dri
#endif
MESADRVSRCDIR = MesaDrvSrcDir
LinkSourceFile(driverfuncs.c, $(MESADRVSRCDIR)/../common)
LinkSourceFile(driverfuncs.h, $(MESADRVSRCDIR)/../common)
XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:34:43 kem Exp $
XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
#if DoLoadableServer
#if !BuildModuleInSubdir
#define IHaveModules
#elif !defined(IHaveModules)
#define IHaveSubdirs
SUBDIRS = module
#endif
#endif
/* Large PIC tables needed for Solaris/SPARC builds */
#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
PICFLAGS = LargePositionIndependentCFlags
#endif
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaBuildDir /**/
#if !defined(IHaveModules) || !BuildModuleInSubdir
#include "../../../../../lib/GL/mesa/main/Imakefile.inc"
#else
#include "../../../../../../lib/GL/mesa/main/Imakefile.inc"
#endif
SRCS = $(COREMESABASESRCS)
OBJS = $(COREMESABASEOBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) -DNXAGENT_SERVER /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
#ifdef IHaveModules
ModuleObjectRule()
#else
NormalLibraryObjectRule()
#endif
SubdirLibraryRule($(OBJS))
LintLibraryTarget(dri,$(SRCS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
XCOMM $XdotOrg: xc/programs/Xserver/GL/mesa/main/Imakefile,v 1.2 2004/08/19 07:34:43 kem Exp $
XCOMM $XFree86: xc/programs/Xserver/GL/mesa/src/math/Imakefile,v 1.8 2002/11/22 22:56:01 tsi Exp $
#if DoLoadableServer
#if !BuildModuleInSubdir
#define IHaveModules
#elif !defined(IHaveModules)
#define IHaveSubdirs
SUBDIRS = module
#endif
#endif
/* Large PIC tables needed for Solaris/SPARC builds */
#if defined(SunArchitecture) && defined(SparcArchitecture) && defined(LargePositionIndependentCFlags)
PICFLAGS = LargePositionIndependentCFlags
#endif
#include <Server.tmpl>
#define NeedAllMesaSrc
#define NeedToLinkMesaSrc
#define MesaBuildDir /**/
#if !defined(IHaveModules) || !BuildModuleInSubdir
#include "../../../../../lib/GL/mesa/main/Imakefile.inc"
#else
#include "../../../../../../lib/GL/mesa/main/Imakefile.inc"
#endif
SRCS = $(COREMESABASESRCS)
OBJS = $(COREMESABASEOBJS)
INCLUDES = -I$(MESASRCDIR)/src/mesa \
-I$(MESASRCDIR)/src/mesa/main \
-I$(MESASRCDIR)/src/mesa/shader \
-I$(MESASRCDIR)/src/mesa/glapi \
-I$(MESASRCDIR)/include \
-I$(SERVERSRC)/include -I$(XINCLUDESRC) \
-I$(SERVERSRC)/GL/include -I$(SERVERSRC)/GL/glx \
-I$(LIBSRC)/GL/include \
-I$(XF86SRC) -I$(INCLUDESRC)
DEFINES = $(GLX_DEFINES) /*-DUSE_X86_ASM*/ /*-DUSE_SPARC_ASM*/
#ifdef IHaveModules
ModuleObjectRule()
#else
NormalLibraryObjectRule()
#endif
SubdirLibraryRule($(OBJS))
LintLibraryTarget(dri,$(SRCS))
NormalLintTarget($(SRCS))
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
/* $XdotOrg: xc/programs/Xserver/Xext/Imakefile,v 1.9 2005/04/24 01:10:12 gisburn Exp $ */
XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:55 cpqbld Exp $
XCOMM $XFree86: xc/programs/Xserver/Xext/Imakefile,v 3.43 2003/04/21 18:56:48 sven Exp $
/**************************************************************************/
/* */
/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
/* */
/* NX-X11, NX protocol compression and NX extensions to this software */
/* are copyright of NoMachine. Redistribution and use of the present */
/* software is allowed according to terms specified in the file LICENSE */
/* which comes in the source distribution. */
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
/**************************************************************************/
#include <Server.tmpl>
#if DoLoadableServer
#define IHaveSubdirs
SUBDIRS = extmod
#endif
#if BuildEVI
#ifdef SGIArchitectureNotTog
EVISRCS = EVI.c sgiEVI.c
EVIOBJS = EVI.o sgiEVI.o
#else
EVISRCS = EVI.c sampleEVI.c
EVIOBJS = EVI.o sampleEVI.o
#endif
#endif
#if HasShm
SHMSRCS = shm.c
SHMOBJS = shm.o
#endif
#if BuildMultibuffer
MULTIBUFSRC = mbuf.c
MULTIBUFOBJ = mbuf.o
#endif
#if BuildScreenSaverExt
SCRNSAVSRC = saver.c
SCRNSAVOBJ = saver.o
#endif
#if BuildXF86VidModeExt && \
((defined(XF86Server) && XF86Server) || \
(defined(XorgServer) && XorgServer))
VIDMODESRCS = xf86vmode.c
VIDMODEOBJS = xf86vmode.o
#endif
#if BuildXF86MiscExt && \
((defined(XF86Server) && XF86Server) || \
(defined(XorgServer) && XorgServer))
XF86MISCSRCS = xf86misc.c
XF86MISCOBJS = xf86misc.o
#endif
#if BuildXF86BigfontExt
XF86BIGFSRCS = xf86bigfont.c
XF86BIGFOBJS = xf86bigfont.o
#if HasShm
SHM_DEFINES = -DHAS_SHM
#endif
#endif
#if BuildXF86DGA
XF86DGASRCS = xf86dga.c xf86dga2.c
XF86DGAOBJS = xf86dga.o xf86dga2.o
#if HasShm
XVMCSHM_DEFINES = -DHAS_XVMCSHM
#endif
#endif
#if BuildXvExt
XVSRCS = xvmain.c xvdisp.c xvmc.c
XVOBJS = xvmain.o xvdisp.o xvmc.o
#endif
#if BuildXResExt
XRESSRCS = xres.c
XRESOBJS = xres.o
#endif
#if BuildAppgroup
APPGROUPSRCS = appgroup.c
APPGROUPOBJS = appgroup.o
#endif
#if BuildXCSecurity
SECURITYSRCS = security.c
SECURITYOBJS = security.o
SERVERCONFIGDIR = ServerConfigDir
POLICYFILEDEF = -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGDIR)/SecurityPolicy\"
#endif
#if BuildCup
CUPSRCS = cup.c
CUPOBJS = cup.o
#endif
#if BuildXinerama
PNRXSRCS = panoramiX.c panoramiXSwap.c panoramiXprocs.c
PNRXOBJS = panoramiX.o panoramiXSwap.o panoramiXprocs.o
PNRXINCLUDES = -I$(FONTINCSRC) -I../mi -I../render
#endif
#if XdmxServer
DMXSRCS = dmx.c
DMXOBJS = dmx.o
DMXINCLUDES = -I../hw/dmx
#endif
#if BuildDPMS
DPMSSRCS = dpms.c
DPMSOBJS = dpms.o
#endif
#if BuildFontCache
FONTCACHESRCS = fontcache.c
FONTCACHEOBJS = fontcache.o
#if 0
FONTCACHEINCLUDES = -I$(XF86SRC)/os-support
#endif
#endif
#if BuildXevie
XEVIESRCS = xevie.c
XEVIEOBJS = xevie.o
#endif
#if BuildXprint
XPRINTSRCS = xprint.c
XPRINTOBJS = xprint.o
#endif
SRCS = shape.c $(SHMSRCS) $(MULTIBUFSRC) \
mitmisc.c xtest.c xtest1di.c xtest1dd.c sleepuntil.c \
bigreq.c sync.c $(SCRNSAVSRC) xcmisc.c $(VIDMODESRCS) \
$(XF86MISCSRCS) $(XF86BIGFSRCS) $(XF86DGASRCS) $(SECURITYSRCS) \
$(APPGROUPSRCS) $(XPRINTSRCS) $(CUPSRCS) $(PNRXSRCS) $(DPMSSRCS) \
$(XEVIESRCS) \
$(EVISRCS) $(XVSRCS) $(FONTCACHESRCS) $(XRESSRCS) $(DMXSRCS)
OBJS = shape.o $(SHMOBJS) $(MULTIBUFOBJ) \
mitmisc.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o \
bigreq.o sync.o $(SCRNSAVOBJ) xcmisc.o $(VIDMODEOBJS) \
$(XF86MISCOBJS) $(XF86BIGFOBJS) $(XF86DGAOBJS) $(SECURITYOBJS) \
$(APPGROUPOBJS) $(XPRINTOBJS) $(CUPOBJS) $(PNRXOBJS) $(DPMSOBJS) \
$(XEVIEOBJS) \
$(EVIOBJS) $(XVOBJS) $(FONTCACHEOBJS) $(XRESOBJS) $(DMXOBJS)
SOBJS = $(SHMOBJS) $(APPGROUPOBJS) $(SECURITYOBJS) $(XPRINTOBJS) \
shape.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o $(PNRXOBJS) \
$(XEVIEOBJS) \
$(XF86BIGFOBJS)
#if defined(NXAgentServer) && NXAgentServer
NX_DEFINES = -DNXAGENT_SERVER
#endif
#if (defined(XFree86Version) || defined(XorgVersion))
/* XXX Check if this can be eliminated */
XF86INCLUDES = -I$(XF86COMSRC)
#endif
INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \
$(PNRXINCLUDES) $(XF86INCLUDES) -I$(FONTINCSRC) \
$(FONTCACHEINCLUDES) $(DMXINCLUDES)
LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln
#if defined(NXAgentServer) && NXAgentServer
DEFINES = $(EXT_DEFINES) $(XVMCSHM_DEFINES) $(NX_DEFINES)
#else
DEFINES = $(EXT_DEFINES) $(XVMCSHM_DEFINES)
#endif
NormalLibraryObjectRule()
/*
* A hack to work around an optimization problem with gcc 2.95.2
*/
#if BuildXF86VidModeExt && defined(GccOptBug295)
SpecialCObjectRule(xf86vmode,NullParameter,-O0)
#endif
NormalLibraryTarget(ext,$(OBJS))
LintLibraryTarget(ext,$(SRCS))
NormalLintTarget($(SRCS))
#if DoLoadableServer
NormalLibraryTarget(exts,$(SOBJS))
#endif
#if BuildXF86BigfontExt
SpecialCObjectRule(xf86bigfont,$(ICONFIGFILES),$(SHM_DEFINES))
#endif
#if BuildXCSecurity
SpecialCObjectRule(security,$(ICONFIGFILES),$(POLICYFILEDEF))
#endif
LinkConfDirectory(xserver,.,xserver,.)
LinkSourceFile(modinit.h,extmod)
#if BuildXCSecurity && InstallSecurityConfig
InstallNonExecFile(SecurityPolicy,$(SERVERCONFIGDIR))
#endif
DependTarget()
#if DoLoadableServer
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
InstallDriverSDKNonExecFile(dgaproc.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(xvdix.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(xvmcext.h,$(DRIVERSDKINCLUDEDIR))
/* $XdotOrg: xc/programs/Xserver/Xext/Imakefile,v 1.9 2005/04/24 01:10:12 gisburn Exp $ */
XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:47:55 cpqbld Exp $
XCOMM $XFree86: xc/programs/Xserver/Xext/Imakefile,v 3.43 2003/04/21 18:56:48 sven Exp $
#include <Server.tmpl>
#if DoLoadableServer
#define IHaveSubdirs
SUBDIRS = extmod
#endif
#if BuildEVI
#ifdef SGIArchitectureNotTog
EVISRCS = EVI.c sgiEVI.c
EVIOBJS = EVI.o sgiEVI.o
#else
EVISRCS = EVI.c sampleEVI.c
EVIOBJS = EVI.o sampleEVI.o
#endif
#endif
#if HasShm
SHMSRCS = shm.c
SHMOBJS = shm.o
#endif
#if BuildMultibuffer
MULTIBUFSRC = mbuf.c
MULTIBUFOBJ = mbuf.o
#endif
#if BuildScreenSaverExt
SCRNSAVSRC = saver.c
SCRNSAVOBJ = saver.o
#endif
#if BuildXF86VidModeExt && \
((defined(XF86Server) && XF86Server) || \
(defined(XorgServer) && XorgServer))
VIDMODESRCS = xf86vmode.c
VIDMODEOBJS = xf86vmode.o
#endif
#if BuildXF86MiscExt && \
((defined(XF86Server) && XF86Server) || \
(defined(XorgServer) && XorgServer))
XF86MISCSRCS = xf86misc.c
XF86MISCOBJS = xf86misc.o
#endif
#if BuildXF86BigfontExt
XF86BIGFSRCS = xf86bigfont.c
XF86BIGFOBJS = xf86bigfont.o
#if HasShm
SHM_DEFINES = -DHAS_SHM
#endif
#endif
#if BuildXF86DGA
XF86DGASRCS = xf86dga.c xf86dga2.c
XF86DGAOBJS = xf86dga.o xf86dga2.o
#if HasShm
XVMCSHM_DEFINES = -DHAS_XVMCSHM
#endif
#endif
#if BuildXvExt
XVSRCS = xvmain.c xvdisp.c xvmc.c
XVOBJS = xvmain.o xvdisp.o xvmc.o
#endif
#if BuildXResExt
XRESSRCS = xres.c
XRESOBJS = xres.o
#endif
#if BuildAppgroup
APPGROUPSRCS = appgroup.c
APPGROUPOBJS = appgroup.o
#endif
#if BuildXCSecurity
SECURITYSRCS = security.c
SECURITYOBJS = security.o
SERVERCONFIGDIR = ServerConfigDir
POLICYFILEDEF = -DDEFAULTPOLICYFILE=\"$(SERVERCONFIGDIR)/SecurityPolicy\"
#endif
#if BuildCup
CUPSRCS = cup.c
CUPOBJS = cup.o
#endif
#if BuildXinerama
PNRXSRCS = panoramiX.c panoramiXSwap.c panoramiXprocs.c
PNRXOBJS = panoramiX.o panoramiXSwap.o panoramiXprocs.o
PNRXINCLUDES = -I$(FONTINCSRC) -I../mi -I../render
#endif
#if XdmxServer
DMXSRCS = dmx.c
DMXOBJS = dmx.o
DMXINCLUDES = -I../hw/dmx
#endif
#if BuildDPMS
DPMSSRCS = dpms.c
DPMSOBJS = dpms.o
#endif
#if BuildFontCache
FONTCACHESRCS = fontcache.c
FONTCACHEOBJS = fontcache.o
#if 0
FONTCACHEINCLUDES = -I$(XF86SRC)/os-support
#endif
#endif
#if BuildXevie
XEVIESRCS = xevie.c
XEVIEOBJS = xevie.o
#endif
#if BuildXprint
XPRINTSRCS = xprint.c
XPRINTOBJS = xprint.o
#endif
SRCS = shape.c $(SHMSRCS) $(MULTIBUFSRC) \
mitmisc.c xtest.c xtest1di.c xtest1dd.c sleepuntil.c \
bigreq.c sync.c $(SCRNSAVSRC) xcmisc.c $(VIDMODESRCS) \
$(XF86MISCSRCS) $(XF86BIGFSRCS) $(XF86DGASRCS) $(SECURITYSRCS) \
$(APPGROUPSRCS) $(XPRINTSRCS) $(CUPSRCS) $(PNRXSRCS) $(DPMSSRCS) \
$(XEVIESRCS) \
$(EVISRCS) $(XVSRCS) $(FONTCACHESRCS) $(XRESSRCS) $(DMXSRCS)
OBJS = shape.o $(SHMOBJS) $(MULTIBUFOBJ) \
mitmisc.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o \
bigreq.o sync.o $(SCRNSAVOBJ) xcmisc.o $(VIDMODEOBJS) \
$(XF86MISCOBJS) $(XF86BIGFOBJS) $(XF86DGAOBJS) $(SECURITYOBJS) \
$(APPGROUPOBJS) $(XPRINTOBJS) $(CUPOBJS) $(PNRXOBJS) $(DPMSOBJS) \
$(XEVIEOBJS) \
$(EVIOBJS) $(XVOBJS) $(FONTCACHEOBJS) $(XRESOBJS) $(DMXOBJS)
SOBJS = $(SHMOBJS) $(APPGROUPOBJS) $(SECURITYOBJS) $(XPRINTOBJS) \
shape.o xtest.o xtest1di.o xtest1dd.o sleepuntil.o $(PNRXOBJS) \
$(XEVIEOBJS) \
$(XF86BIGFOBJS)
#if (defined(XFree86Version) || defined(XorgVersion))
/* XXX Check if this can be eliminated */
XF86INCLUDES = -I$(XF86COMSRC)
#endif
INCLUDES = -I. -I../include -I$(XINCLUDESRC) -I$(EXTINCSRC) \
$(PNRXINCLUDES) $(XF86INCLUDES) -I$(FONTINCSRC) \
$(FONTCACHEINCLUDES) $(DMXINCLUDES)
LINTLIBS = ../dix/llib-ldix.ln ../os/llib-los.ln
DEFINES = $(EXT_DEFINES) $(XVMCSHM_DEFINES)
NormalLibraryObjectRule()
/*
* A hack to work around an optimization problem with gcc 2.95.2
*/
#if BuildXF86VidModeExt && defined(GccOptBug295)
SpecialCObjectRule(xf86vmode,NullParameter,-O0)
#endif
NormalLibraryTarget(ext,$(OBJS))
LintLibraryTarget(ext,$(SRCS))
NormalLintTarget($(SRCS))
#if DoLoadableServer
NormalLibraryTarget(exts,$(SOBJS))
#endif
#if BuildXF86BigfontExt
SpecialCObjectRule(xf86bigfont,$(ICONFIGFILES),$(SHM_DEFINES))
#endif
#if BuildXCSecurity
SpecialCObjectRule(security,$(ICONFIGFILES),$(POLICYFILEDEF))
#endif
LinkConfDirectory(xserver,.,xserver,.)
LinkSourceFile(modinit.h,extmod)
#if BuildXCSecurity && InstallSecurityConfig
InstallNonExecFile(SecurityPolicy,$(SERVERCONFIGDIR))
#endif
DependTarget()
#if DoLoadableServer
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
InstallDriverSDKNonExecFile(dgaproc.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(xvdix.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(xvmcext.h,$(DRIVERSDKINCLUDEDIR))
/* $Xorg: pixmap.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
/*
Copyright 1993, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/Xserver/dix/pixmap.c,v 3.4 2001/01/17 22:36:44 dawes Exp $ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "scrnintstr.h"
#include "misc.h"
#include "os.h"
#include "windowstr.h"
#include "resource.h"
#include "dixstruct.h"
#include "gcstruct.h"
#include "servermd.h"
#include "site.h"
/*
* Scratch pixmap management and device independent pixmap allocation
* function.
*/
/* callable by ddx */
PixmapPtr
GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth,
int bitsPerPixel, int devKind, pointer pPixData)
{
PixmapPtr pPixmap = pScreen->pScratchPixmap;
if (pPixmap)
pScreen->pScratchPixmap = NULL;
else
/* width and height of 0 means don't allocate any pixmap data */
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
if (pPixmap) {
if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
bitsPerPixel, devKind, pPixData))
return pPixmap;
(*pScreen->DestroyPixmap)(pPixmap);
}
return NullPixmap;
}
/* callable by ddx */
void
FreeScratchPixmapHeader(PixmapPtr pPixmap)
{
if (pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
pPixmap->devPrivate.ptr = NULL; /* lest ddx chases bad ptr */
if (pScreen->pScratchPixmap)
(*pScreen->DestroyPixmap)(pPixmap);
else
pScreen->pScratchPixmap = pPixmap;
}
}
Bool
CreateScratchPixmapsForScreen(int scrnum)
{
/* let it be created on first use */
screenInfo.screens[scrnum]->pScratchPixmap = NULL;
return TRUE;
}
void
FreeScratchPixmapsForScreen(int scrnum)
{
FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap);
}
/* callable by ddx */
PixmapPtr
AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
{
PixmapPtr pPixmap;
#ifdef PIXPRIV
char *ptr;
DevUnion *ppriv;
unsigned *sizes;
unsigned size;
int i;
if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize)
return NullPixmap;
/*
* FIXME: Allocate 4 bytes at the end of each pixmap. This
* is a quick workaround intended to fix a problem reported
* by Valgrind due to fbBlt() writing just after the end of
* the pixmap buffer. This may be a RENDER bug.
*/
pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize + 4);
if (!pPixmap)
return NullPixmap;
ppriv = (DevUnion *)(pPixmap + 1);
pPixmap->devPrivates = ppriv;
sizes = pScreen->PixmapPrivateSizes;
ptr = (char *)(ppriv + pScreen->PixmapPrivateLen);
for (i = pScreen->PixmapPrivateLen; --i >= 0; ppriv++, sizes++)
{
if ((size = *sizes) != 0)
{
ppriv->ptr = (pointer)ptr;
ptr += size;
}
else
ppriv->ptr = (pointer)NULL;
}
#else
pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize);
#endif
return pPixmap;
}
/* $Xorg: pixmap.c,v 1.4 2001/02/09 02:04:40 xorgcvs Exp $ */
/*
Copyright 1993, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/* $XFree86: xc/programs/Xserver/dix/pixmap.c,v 3.4 2001/01/17 22:36:44 dawes Exp $ */
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <X11/X.h>
#include "scrnintstr.h"
#include "misc.h"
#include "os.h"
#include "windowstr.h"
#include "resource.h"
#include "dixstruct.h"
#include "gcstruct.h"
#include "servermd.h"
#include "site.h"
/*
* Scratch pixmap management and device independent pixmap allocation
* function.
*/
/* callable by ddx */
PixmapPtr
GetScratchPixmapHeader(ScreenPtr pScreen, int width, int height, int depth,
int bitsPerPixel, int devKind, pointer pPixData)
{
PixmapPtr pPixmap = pScreen->pScratchPixmap;
if (pPixmap)
pScreen->pScratchPixmap = NULL;
else
/* width and height of 0 means don't allocate any pixmap data */
pPixmap = (*pScreen->CreatePixmap)(pScreen, 0, 0, depth);
if (pPixmap) {
if ((*pScreen->ModifyPixmapHeader)(pPixmap, width, height, depth,
bitsPerPixel, devKind, pPixData))
return pPixmap;
(*pScreen->DestroyPixmap)(pPixmap);
}
return NullPixmap;
}
/* callable by ddx */
void
FreeScratchPixmapHeader(PixmapPtr pPixmap)
{
if (pPixmap)
{
ScreenPtr pScreen = pPixmap->drawable.pScreen;
pPixmap->devPrivate.ptr = NULL; /* lest ddx chases bad ptr */
if (pScreen->pScratchPixmap)
(*pScreen->DestroyPixmap)(pPixmap);
else
pScreen->pScratchPixmap = pPixmap;
}
}
Bool
CreateScratchPixmapsForScreen(int scrnum)
{
/* let it be created on first use */
screenInfo.screens[scrnum]->pScratchPixmap = NULL;
return TRUE;
}
void
FreeScratchPixmapsForScreen(int scrnum)
{
FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap);
}
/* callable by ddx */
PixmapPtr
AllocatePixmap(ScreenPtr pScreen, int pixDataSize)
{
PixmapPtr pPixmap;
#ifdef PIXPRIV
char *ptr;
DevUnion *ppriv;
unsigned *sizes;
unsigned size;
int i;
if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize)
return NullPixmap;
pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize);
if (!pPixmap)
return NullPixmap;
ppriv = (DevUnion *)(pPixmap + 1);
pPixmap->devPrivates = ppriv;
sizes = pScreen->PixmapPrivateSizes;
ptr = (char *)(ppriv + pScreen->PixmapPrivateLen);
for (i = pScreen->PixmapPrivateLen; --i >= 0; ppriv++, sizes++)
{
if ((size = *sizes) != 0)
{
ppriv->ptr = (pointer)ptr;
ptr += size;
}
else
ppriv->ptr = (pointer)NULL;
}
#else
pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize);
#endif
return pPixmap;
}
XCOMM $XFree86: xc/programs/Xserver/fb/Imakefile,v 1.16 2002/05/31 16:12:17 dawes Exp $
XCOMM
XCOMM
XCOMM Id: Imakefile,v 1.1 1999/11/02 03:54:44 keithp Exp $
/*
* The X.org 6.8.99.16 snapshot fails to compile with GCC 4.
* Temporarily disable the MMX features until the bug is
* fixed.
*
#if defined(HasGcc34) && HasGcc34
MMXOPTIONS= -mmmx -msse -Winline --param inline-unit-growth=10000 \
--param large-function-growth=10000 -DUSE_MMX
USEMMXOPTIONS= -DUSE_MMX
#if defined(i386Architecture) || defined(AMD64Architecture)
SpecialCObjectRule(fbmmx,fbmmx.c,$(MMXOPTIONS))
SpecialCObjectRule(fbpict,fbpict.c,$(USEMMXOPTIONS))
SpecialCObjectRule(fbfill,fbfill.c,$(USEMMXOPTIONS))
SpecialCObjectRule(fbcopy,fbcopy.c,$(USEMMXOPTIONS))
#endif
#endif
*/
#if DoLoadableServer
#if !BuildModuleInSubdir
#define IHaveModules
#elif !defined(IHaveModules)
#define IHaveSubdirs
SUBDIRS = module
#endif
#endif
#include <Server.tmpl>
#ifdef FbNoPixelAddrCode
DEFINES=-DFBNOPIXADDR -DFBNO24BIT
#endif
#if defined(IHaveModules)
XFMODSRC = fbmodule.c
XFMODOBJ = fbmodule.o
#endif
#if BuildRender
RENDERSRC = fbcompose.c
RENDEROBJ = fbcompose.o
#endif
SRCS = $(XFMODSRC) \
fballpriv.c \
fbbits.c \
fbblt.c \
fbbltone.c \
fbbstore.c \
fbcmap.c \
$(RENDERSRC) \
fbcopy.c \
fbedge.c \
fbfill.c \
fbfillrect.c \
fbfillsp.c \
fbgc.c \
fbgetsp.c \
fbglyph.c \
fbimage.c \
fbline.c \
fboverlay.c \
fbpixmap.c \
fbpoint.c \
fbpush.c \
fbscreen.c \
fbseg.c \
fbsetsp.c \
fbsolid.c \
fbstipple.c \
fbtile.c \
fbtrap.c \
fbutil.c \
fbwindow.c \
fb24_32.c \
fbpict.c \
fbmmx.c \
fbpseudocolor.c
OBJS = $(XFMODOBJ) \
fbarc.o \
fballpriv.o \
fbbits.o \
fbblt.o \
fbbltone.o \
fbbstore.o \
fbcmap.o \
$(RENDEROBJ) \
fbcopy.o \
fbedge.o \
fbfill.o \
fbfillrect.o \
fbfillsp.o \
fbgc.o \
fbgetsp.o \
fbglyph.o \
fbimage.o \
fbline.o \
fboverlay.o \
fbpixmap.o \
fbpoint.o \
fbpush.o \
fbscreen.o \
fbseg.o \
fbsetsp.o \
fbsolid.o \
fbstipple.o \
fbtile.o \
fbtrap.o \
fbutil.o \
fbwindow.o \
fb24_32.o \
fbpict.o \
fbmmx.o \
fbpseudocolor.o
INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) \
-I$(FONTINCSRC) -I$(XF86SRC)/common $(EXTRAINCLUDES) \
-I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext
LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \
$(SERVERSRC)/mi/llib-lmi.ln
#ifdef IHaveModules
ModuleObjectRule()
LibraryModuleTarget(fb,$(OBJS))
#else
NormalLibraryObjectRule()
NormalLibraryTarget(fb,$(OBJS))
#endif
LintLibraryTarget(fb,$(SRCS))
NormalLintTarget($(SRCS))
#ifdef IHaveModules
InstallLibraryModule(fb,$(MODULEDIR),.)
#endif
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
#ifdef LinkDirectory
LinkSourceFile(fb24_32.c,LinkDirectory)
LinkSourceFile(fballpriv.c,LinkDirectory)
LinkSourceFile(fbarc.c,LinkDirectory)
LinkSourceFile(fbbits.c,LinkDirectory)
LinkSourceFile(fbblt.c,LinkDirectory)
LinkSourceFile(fbbltone.c,LinkDirectory)
LinkSourceFile(fbbstore.c,LinkDirectory)
LinkSourceFile(fbcmap.c,LinkDirectory)
#if BuildRender
LinkSourceFile(fbcompose.c,LinkDirectory)
#endif
LinkSourceFile(fbcopy.c,LinkDirectory)
LinkSourceFile(fbfill.c,LinkDirectory)
LinkSourceFile(fbfillrect.c,LinkDirectory)
LinkSourceFile(fbfillsp.c,LinkDirectory)
LinkSourceFile(fbgc.c,LinkDirectory)
LinkSourceFile(fbgetsp.c,LinkDirectory)
LinkSourceFile(fbglyph.c,LinkDirectory)
LinkSourceFile(fbimage.c,LinkDirectory)
LinkSourceFile(fbline.c,LinkDirectory)
LinkSourceFile(fbmodule.c,LinkDirectory)
LinkSourceFile(fboverlay.c,LinkDirectory)
LinkSourceFile(fbpict.c,LinkDirectory)
LinkSourceFile(fbpixmap.c,LinkDirectory)
LinkSourceFile(fbpoint.c,LinkDirectory)
LinkSourceFile(fbpush.c,LinkDirectory)
LinkSourceFile(fbscreen.c,LinkDirectory)
LinkSourceFile(fbseg.c,LinkDirectory)
LinkSourceFile(fbsetsp.c,LinkDirectory)
LinkSourceFile(fbsolid.c,LinkDirectory)
LinkSourceFile(fbstipple.c,LinkDirectory)
LinkSourceFile(fbtile.c,LinkDirectory)
LinkSourceFile(fbtrap.c,LinkDirectory)
LinkSourceFile(fbutil.c,LinkDirectory)
LinkSourceFile(fbwindow.c,LinkDirectory)
LinkSourceFile(fbmmx.c,LinkDirectory)
#endif
InstallDriverSDKLibraryModule(fb,$(DRIVERSDKMODULEDIR),.)
InstallDriverSDKNonExecFile(fb.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(fbrop.h,$(DRIVERSDKINCLUDEDIR))
XCOMM $XFree86: xc/programs/Xserver/fb/Imakefile,v 1.16 2002/05/31 16:12:17 dawes Exp $
XCOMM
XCOMM
XCOMM Id: Imakefile,v 1.1 1999/11/02 03:54:44 keithp Exp $
#if defined(HasGcc34) && HasGcc34
MMXOPTIONS= -mmmx -msse -Winline --param inline-unit-growth=10000 \
--param large-function-growth=10000 -DUSE_MMX
USEMMXOPTIONS= -DUSE_MMX
#if defined(i386Architecture) || defined(AMD64Architecture)
SpecialCObjectRule(fbmmx,fbmmx.c,$(MMXOPTIONS))
SpecialCObjectRule(fbpict,fbpict.c,$(USEMMXOPTIONS))
SpecialCObjectRule(fbfill,fbfill.c,$(USEMMXOPTIONS))
SpecialCObjectRule(fbcopy,fbcopy.c,$(USEMMXOPTIONS))
#endif
#endif
#if DoLoadableServer
#if !BuildModuleInSubdir
#define IHaveModules
#elif !defined(IHaveModules)
#define IHaveSubdirs
SUBDIRS = module
#endif
#endif
#include <Server.tmpl>
#ifdef FbNoPixelAddrCode
DEFINES=-DFBNOPIXADDR -DFBNO24BIT
#endif
#if defined(IHaveModules)
XFMODSRC = fbmodule.c
XFMODOBJ = fbmodule.o
#endif
#if BuildRender
RENDERSRC = fbcompose.c
RENDEROBJ = fbcompose.o
#endif
SRCS = $(XFMODSRC) \
fballpriv.c \
fbbits.c \
fbblt.c \
fbbltone.c \
fbbstore.c \
fbcmap.c \
$(RENDERSRC) \
fbcopy.c \
fbedge.c \
fbfill.c \
fbfillrect.c \
fbfillsp.c \
fbgc.c \
fbgetsp.c \
fbglyph.c \
fbimage.c \
fbline.c \
fboverlay.c \
fbpixmap.c \
fbpoint.c \
fbpush.c \
fbscreen.c \
fbseg.c \
fbsetsp.c \
fbsolid.c \
fbstipple.c \
fbtile.c \
fbtrap.c \
fbutil.c \
fbwindow.c \
fb24_32.c \
fbpict.c \
fbmmx.c \
fbpseudocolor.c
OBJS = $(XFMODOBJ) \
fbarc.o \
fballpriv.o \
fbbits.o \
fbblt.o \
fbbltone.o \
fbbstore.o \
fbcmap.o \
$(RENDEROBJ) \
fbcopy.o \
fbedge.o \
fbfill.o \
fbfillrect.o \
fbfillsp.o \
fbgc.o \
fbgetsp.o \
fbglyph.o \
fbimage.o \
fbline.o \
fboverlay.o \
fbpixmap.o \
fbpoint.o \
fbpush.o \
fbscreen.o \
fbseg.o \
fbsetsp.o \
fbsolid.o \
fbstipple.o \
fbtile.o \
fbtrap.o \
fbutil.o \
fbwindow.o \
fb24_32.o \
fbpict.o \
fbmmx.o \
fbpseudocolor.o
INCLUDES = -I$(SERVERSRC)/fb -I$(SERVERSRC)/mi -I$(SERVERSRC)/include \
-I$(XINCLUDESRC) \
-I$(FONTINCSRC) -I$(XF86SRC)/common $(EXTRAINCLUDES) \
-I$(SERVERSRC)/render -I$(EXTINCSRC) -I$(SERVERSRC)/Xext
LINTLIBS = $(SERVERSRC)/dix/llib-ldix.ln $(SERVERSRC)/os/llib-los.ln \
$(SERVERSRC)/mi/llib-lmi.ln
#ifdef IHaveModules
ModuleObjectRule()
LibraryModuleTarget(fb,$(OBJS))
#else
NormalLibraryObjectRule()
NormalLibraryTarget(fb,$(OBJS))
#endif
LintLibraryTarget(fb,$(SRCS))
NormalLintTarget($(SRCS))
#ifdef IHaveModules
InstallLibraryModule(fb,$(MODULEDIR),.)
#endif
DependTarget()
#ifdef IHaveSubdirs
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#endif
#ifdef LinkDirectory
LinkSourceFile(fb24_32.c,LinkDirectory)
LinkSourceFile(fballpriv.c,LinkDirectory)
LinkSourceFile(fbarc.c,LinkDirectory)
LinkSourceFile(fbbits.c,LinkDirectory)
LinkSourceFile(fbblt.c,LinkDirectory)
LinkSourceFile(fbbltone.c,LinkDirectory)
LinkSourceFile(fbbstore.c,LinkDirectory)
LinkSourceFile(fbcmap.c,LinkDirectory)
#if BuildRender
LinkSourceFile(fbcompose.c,LinkDirectory)
#endif
LinkSourceFile(fbcopy.c,LinkDirectory)
LinkSourceFile(fbfill.c,LinkDirectory)
LinkSourceFile(fbfillrect.c,LinkDirectory)
LinkSourceFile(fbfillsp.c,LinkDirectory)
LinkSourceFile(fbgc.c,LinkDirectory)
LinkSourceFile(fbgetsp.c,LinkDirectory)
LinkSourceFile(fbglyph.c,LinkDirectory)
LinkSourceFile(fbimage.c,LinkDirectory)
LinkSourceFile(fbline.c,LinkDirectory)
LinkSourceFile(fbmodule.c,LinkDirectory)
LinkSourceFile(fboverlay.c,LinkDirectory)
LinkSourceFile(fbpict.c,LinkDirectory)
LinkSourceFile(fbpixmap.c,LinkDirectory)
LinkSourceFile(fbpoint.c,LinkDirectory)
LinkSourceFile(fbpush.c,LinkDirectory)
LinkSourceFile(fbscreen.c,LinkDirectory)
LinkSourceFile(fbseg.c,LinkDirectory)
LinkSourceFile(fbsetsp.c,LinkDirectory)
LinkSourceFile(fbsolid.c,LinkDirectory)
LinkSourceFile(fbstipple.c,LinkDirectory)
LinkSourceFile(fbtile.c,LinkDirectory)
LinkSourceFile(fbtrap.c,LinkDirectory)
LinkSourceFile(fbutil.c,LinkDirectory)
LinkSourceFile(fbwindow.c,LinkDirectory)
LinkSourceFile(fbmmx.c,LinkDirectory)
#endif
InstallDriverSDKLibraryModule(fb,$(DRIVERSDKMODULEDIR),.)
InstallDriverSDKNonExecFile(fb.h,$(DRIVERSDKINCLUDEDIR))
InstallDriverSDKNonExecFile(fbrop.h,$(DRIVERSDKINCLUDEDIR))
/*
* $Id: fbtrap.c,v 1.5 2005/07/03 07:01:23 daniels Exp $
*
* Copyright © 2004 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "fb.h"
#ifdef RENDER
#include "picturestr.h"
#include "mipict.h"
#include "renderedge.h"
#include "fbpict.h"
void
fbAddTraps (PicturePtr pPicture,
INT16 x_off,
INT16 y_off,
int ntrap,
xTrap *traps)
{
FbBits *buf;
int bpp;
int width;
int stride;
int height;
int pxoff, pyoff;
xFixed x_off_fixed;
xFixed y_off_fixed;
RenderEdge l, r;
xFixed t, b;
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
width = pPicture->pDrawable->width;
height = pPicture->pDrawable->height;
x_off += pxoff;
y_off += pyoff;
x_off_fixed = IntToxFixed(y_off);
y_off_fixed = IntToxFixed(y_off);
while (ntrap--)
{
t = traps->top.y + y_off_fixed;
if (t < 0)
t = 0;
t = RenderSampleCeilY (t, bpp);
b = traps->bot.y + y_off_fixed;
if (xFixedToInt (b) >= height)
b = IntToxFixed (height) - 1;
b = RenderSampleFloorY (b, bpp);
if (b >= t)
{
/* initialize edge walkers */
RenderEdgeInit (&l, bpp, t,
traps->top.l + x_off_fixed,
traps->top.y + y_off_fixed,
traps->bot.l + x_off_fixed,
traps->bot.y + y_off_fixed);
RenderEdgeInit (&r, bpp, t,
traps->top.r + x_off_fixed,
traps->top.y + y_off_fixed,
traps->bot.r + x_off_fixed,
traps->bot.y + y_off_fixed);
fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
}
traps++;
}
}
void
fbRasterizeTrapezoid (PicturePtr pPicture,
xTrapezoid *trap,
int x_off,
int y_off)
{
FbBits *buf;
int bpp;
int width;
int stride;
int height;
int pxoff, pyoff;
xFixed x_off_fixed;
xFixed y_off_fixed;
RenderEdge l, r;
xFixed t, b;
if (!xTrapezoidValid (trap))
return;
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
width = pPicture->pDrawable->width;
height = pPicture->pDrawable->height;
x_off += pxoff;
y_off += pyoff;
x_off_fixed = IntToxFixed(x_off);
y_off_fixed = IntToxFixed(y_off);
t = trap->top + y_off_fixed;
if (t < 0)
t = 0;
t = RenderSampleCeilY (t, bpp);
b = trap->bottom + y_off_fixed;
if (xFixedToInt (b) >= height)
b = IntToxFixed (height) - 1;
b = RenderSampleFloorY (b, bpp);
if (b >= t)
{
/* initialize edge walkers */
RenderLineFixedEdgeInit (&l, bpp, t, &trap->left, x_off, y_off);
RenderLineFixedEdgeInit (&r, bpp, t, &trap->right, x_off, y_off);
fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
}
}
static int
_GreaterY (xPointFixed *a, xPointFixed *b)
{
if (a->y == b->y)
return a->x > b->x;
return a->y > b->y;
}
/*
* Note that the definition of this function is a bit odd because
* of the X coordinate space (y increasing downwards).
*/
static int
_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b)
{
xPointFixed ad, bd;
ad.x = a->x - ref->x;
ad.y = a->y - ref->y;
bd.x = b->x - ref->x;
bd.y = b->y - ref->y;
return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0;
}
/* FIXME -- this could be made more efficient */
void
fbAddTriangles (PicturePtr pPicture,
INT16 x_off,
INT16 y_off,
int ntri,
xTriangle *tris)
{
xPointFixed *top, *left, *right, *tmp;
xTrapezoid trap;
for (; ntri; ntri--, tris++)
{
top = &tris->p1;
left = &tris->p2;
right = &tris->p3;
if (_GreaterY (top, left)) {
tmp = left; left = top; top = tmp;
}
if (_GreaterY (top, right)) {
tmp = right; right = top; top = tmp;
}
if (_Clockwise (top, right, left)) {
tmp = right; right = left; left = tmp;
}
/*
* Two cases:
*
* + +
* / \ / \
* / \ / \
* / + + \
* / -- -- \
* / -- -- \
* / --- --- \
* +-- --+
*/
trap.top = top->y;
trap.left.p1 = *top;
trap.left.p2 = *left;
trap.right.p1 = *top;
trap.right.p2 = *right;
if (right->y < left->y)
trap.bottom = right->y;
else
trap.bottom = left->y;
fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
if (right->y < left->y)
{
trap.top = right->y;
trap.bottom = left->y;
trap.right.p1 = *right;
trap.right.p2 = *left;
}
else
{
trap.top = left->y;
trap.bottom = right->y;
trap.left.p1 = *left;
trap.left.p2 = *right;
}
fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
}
}
#endif /* RENDER */
/*
* $Id: fbtrap.c,v 1.5 2005/07/03 07:01:23 daniels Exp $
*
* Copyright © 2004 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Keith Packard not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Keith Packard makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include "fb.h"
#ifdef RENDER
#include "picturestr.h"
#include "mipict.h"
#include "renderedge.h"
#include "fbpict.h"
void
fbAddTraps (PicturePtr pPicture,
INT16 x_off,
INT16 y_off,
int ntrap,
xTrap *traps)
{
FbBits *buf;
int bpp;
int width;
int stride;
int height;
int pxoff, pyoff;
xFixed x_off_fixed;
xFixed y_off_fixed;
RenderEdge l, r;
xFixed t, b;
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
width = pPicture->pDrawable->width;
height = pPicture->pDrawable->height;
x_off += pxoff;
y_off += pyoff;
x_off_fixed = IntToxFixed(y_off);
y_off_fixed = IntToxFixed(y_off);
while (ntrap--)
{
t = traps->top.y + y_off_fixed;
if (t < 0)
t = 0;
t = RenderSampleCeilY (t, bpp);
b = traps->bot.y + y_off_fixed;
if (xFixedToInt (b) >= height)
b = IntToxFixed (height) - 1;
b = RenderSampleFloorY (b, bpp);
if (b >= t)
{
/* initialize edge walkers */
RenderEdgeInit (&l, bpp, t,
traps->top.l + x_off_fixed,
traps->top.y + y_off_fixed,
traps->bot.l + x_off_fixed,
traps->bot.y + y_off_fixed);
RenderEdgeInit (&r, bpp, t,
traps->top.r + x_off_fixed,
traps->top.y + y_off_fixed,
traps->bot.r + x_off_fixed,
traps->bot.y + y_off_fixed);
fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
}
traps++;
}
}
void
fbRasterizeTrapezoid (PicturePtr pPicture,
xTrapezoid *trap,
int x_off,
int y_off)
{
FbBits *buf;
int bpp;
int width;
int stride;
int height;
int pxoff, pyoff;
xFixed x_off_fixed;
xFixed y_off_fixed;
RenderEdge l, r;
xFixed t, b;
fbGetDrawable (pPicture->pDrawable, buf, stride, bpp, pxoff, pyoff);
width = pPicture->pDrawable->width;
height = pPicture->pDrawable->height;
x_off += pxoff;
y_off += pyoff;
x_off_fixed = IntToxFixed(x_off);
y_off_fixed = IntToxFixed(y_off);
t = trap->top + y_off_fixed;
if (t < 0)
t = 0;
t = RenderSampleCeilY (t, bpp);
b = trap->bottom + y_off_fixed;
if (xFixedToInt (b) >= height)
b = IntToxFixed (height) - 1;
b = RenderSampleFloorY (b, bpp);
if (b >= t)
{
/* initialize edge walkers */
RenderLineFixedEdgeInit (&l, bpp, t, &trap->left, x_off, y_off);
RenderLineFixedEdgeInit (&r, bpp, t, &trap->right, x_off, y_off);
fbRasterizeEdges (buf, bpp, width, stride, &l, &r, t, b);
}
}
static int
_GreaterY (xPointFixed *a, xPointFixed *b)
{
if (a->y == b->y)
return a->x > b->x;
return a->y > b->y;
}
/*
* Note that the definition of this function is a bit odd because
* of the X coordinate space (y increasing downwards).
*/
static int
_Clockwise (xPointFixed *ref, xPointFixed *a, xPointFixed *b)
{
xPointFixed ad, bd;
ad.x = a->x - ref->x;
ad.y = a->y - ref->y;
bd.x = b->x - ref->x;
bd.y = b->y - ref->y;
return ((xFixed_32_32) bd.y * ad.x - (xFixed_32_32) ad.y * bd.x) < 0;
}
/* FIXME -- this could be made more efficient */
void
fbAddTriangles (PicturePtr pPicture,
INT16 x_off,
INT16 y_off,
int ntri,
xTriangle *tris)
{
xPointFixed *top, *left, *right, *tmp;
xTrapezoid trap;
for (; ntri; ntri--, tris++)
{
top = &tris->p1;
left = &tris->p2;
right = &tris->p3;
if (_GreaterY (top, left)) {
tmp = left; left = top; top = tmp;
}
if (_GreaterY (top, right)) {
tmp = right; right = top; top = tmp;
}
if (_Clockwise (top, right, left)) {
tmp = right; right = left; left = tmp;
}
/*
* Two cases:
*
* + +
* / \ / \
* / \ / \
* / + + \
* / -- -- \
* / -- -- \
* / --- --- \
* +-- --+
*/
trap.top = top->y;
trap.left.p1 = *top;
trap.left.p2 = *left;
trap.right.p1 = *top;
trap.right.p2 = *right;
if (right->y < left->y)
trap.bottom = right->y;
else
trap.bottom = left->y;
fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
if (right->y < left->y)
{
trap.top = right->y;
trap.bottom = left->y;
trap.right.p1 = *right;
trap.right.p2 = *left;
}
else
{
trap.top = left->y;
trap.bottom = right->y;
trap.left.p1 = *left;
trap.left.p2 = *right;
}
fbRasterizeTrapezoid (pPicture, &trap, x_off, y_off);
}
}
#endif /* RENDER */
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment