Commit 282b071a authored by dscho's avatar dscho

dropped miregion and all the X stuff in favour of Wez' sraRegion, added dox

parent c30ded8d
CC=cc #CC=cc
CFLAGS=-g -Wall CFLAGS=-g -Wall
#CFLAGS=-O2 -Wall #CFLAGS=-O2 -Wall
RANLIB=ranlib RANLIB=ranlib
INCLUDES=-I. -Iinclude INCLUDES=-I.
VNCSERVERLIB=-L. -lvncserver -L/usr/local/lib -lz -ljpeg VNCSERVERLIB=-L. -lvncserver -L/usr/local/lib -lz -ljpeg
# These two lines enable useage of PThreads # These two lines enable useage of PThreads
...@@ -17,11 +17,11 @@ OSX_LIBS = -framework ApplicationServices -framework Carbon ...@@ -17,11 +17,11 @@ OSX_LIBS = -framework ApplicationServices -framework Carbon
# for Example # for Example
SOURCES=main.c rfbserver.c miregion.c auth.c sockets.c xalloc.c \ SOURCES=main.c rfbserver.c sraRegion.c auth.c sockets.c \
stats.c corre.c hextile.c rre.c translate.c cutpaste.c \ stats.c corre.c hextile.c rre.c translate.c cutpaste.c \
zlib.c tight.c httpd.c cursor.o \ zlib.c tight.c httpd.c cursor.o \
d3des.c vncauth.c d3des.c vncauth.c
OBJS=main.o rfbserver.o miregion.o auth.o sockets.o xalloc.o \ OBJS=main.o rfbserver.o sraRegion.o auth.o sockets.o \
stats.o corre.o hextile.o rre.o translate.o cutpaste.o \ stats.o corre.o hextile.o rre.o translate.o cutpaste.o \
zlib.o tight.o httpd.o cursor.o \ zlib.o tight.o httpd.o cursor.o \
d3des.o vncauth.o d3des.o vncauth.o
...@@ -50,9 +50,15 @@ OSXvnc-server: mac.o libvncserver.a ...@@ -50,9 +50,15 @@ OSXvnc-server: mac.o libvncserver.a
storepasswd: storepasswd.o d3des.o vncauth.o storepasswd: storepasswd.o d3des.o vncauth.o
$(CC) -o storepasswd storepasswd.o d3des.o vncauth.o $(CC) -o storepasswd storepasswd.o d3des.o vncauth.o
sratest: sratest.o
$(CC) -o sratest sratest.o
sratest.o: sraRegion.c
$(CC) $(CFLAGS) $(INCLUDES) -DSRA_TEST -c -o sratest.o sraRegion.c
clean: clean:
rm -f $(OBJS) *~ core "#"* *.bak *.orig storepasswd.o \ rm -f $(OBJS) *~ core "#"* *.bak *.orig storepasswd.o \
mac.o example.o pnmshow.o $(OBJS) mac.o example.o pnmshow.o sratest.o $(OBJS)
realclean: clean realclean: clean
rm -f OSXvnc-server storepasswd example pnmshow libvncserver.a rm -f OSXvnc-server storepasswd example pnmshow libvncserver.a
......
...@@ -18,17 +18,45 @@ There are two examples included: ...@@ -18,17 +18,45 @@ There are two examples included:
The examples are not too well documented, but easy straight forward and a The examples are not too well documented, but easy straight forward and a
good starting point. good starting point.
Try example: it outputs on which port it listens (default: 5900), so it is
display 0. To view, call
vncviewer :0
You should see a sheet with a gradient and "Hello World!" written on it. Try
to paint something. Note that everytime you click, there is some bigger blot.
The size depends on the mouse button you click. Open a second vncviewer with
the same parameters and watch it as you paint in the other window. This also
works over internet. You just have to know either the name or the IP of your
machine. Then it is
vncviewer machine.where.example.runs.com:0
or similar for the remote client. Now you are ready to type something. Be sure
that your mouse sits still, because everytime the mouse moves, the cursor is
reset! If you are done with that demo, just press Escape in the viewer. Note
that the server still runs, even if you closed both windows. When you
reconnect now, everything you painted and wrote is still there. So you press
"Page Up" for a blank page.
The demo pnmshow is much simpler: you either provide a filename as argument
or pipe a file through stdin. Note that the file has to be a raw pnm/ppm file,
i.e. a truecolour graphics. Only the Escape key is implemented. This may be
the best starting point if you want to learn how to use LibVNCServer. You
are confronted with the fact that the bytes per pixel can only be 8, 16 or 32.
How to use How to use
---------- ----------
To make a server, you just have to initialise a server structure using the To make a server, you just have to initialise a server structure using the
function rfbDefaultScreenInit, like function rfbDefaultScreenInit, like
rfbScreenInfoPtr rfbScreen = rfbScreenInfoPtr rfbScreen =
rfbGetScreen(argc,argv,maxx,maxy,8,3,bpp); rfbGetScreen(argc,argv,width,height,8,3,bpp);
where byte per pixel is 1, 2 or 4. This is so because of speed considerations
(you can use native data types of that width).
You then can set hooks and io functions (see below) or other You then can set hooks and io functions (see below) or other
options (see below). options (see below).
And you allocate the frame buffer like this:
rfbScreen->frameBuffer = (char*)malloc(width*height*bpp);
After that, you initialize the server, like After that, you initialize the server, like
rfbInitServer(rfbScreen); rfbInitServer(rfbScreen);
...@@ -60,6 +88,11 @@ that network traffic is low, and also the cursor doesn't need to be ...@@ -60,6 +88,11 @@ that network traffic is low, and also the cursor doesn't need to be
drawn the cursor everytime an update is sent. LibVNCServer handles drawn the cursor everytime an update is sent. LibVNCServer handles
all the details. Just set the cursor and don't bother any more. all the details. Just set the cursor and don't bother any more.
To set the mouse coordinates (or emulate mouse clicks), call
defaultPtrAddEvent(buttonMask,x,y,cl);
However, this works only if your client doesn't do local cursor drawing. There
is no way (to my knowledge) to set the pointer of a client via RFB protocol.
What is the difference between rfbScreenInfoPtr and rfbClientPtr? What is the difference between rfbScreenInfoPtr and rfbClientPtr?
----------------------------------------------------------------- -----------------------------------------------------------------
...@@ -121,6 +154,9 @@ kbdReleaseAllKeys(rfbClientPtr cl) ...@@ -121,6 +154,9 @@ kbdReleaseAllKeys(rfbClientPtr cl)
is not called at all (maybe in the future). is not called at all (maybe in the future).
ptrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl) ptrAddEvent(int buttonMask,int x,int y,rfbClientPtr cl)
is called when the mouse moves or a button is pressed. is called when the mouse moves or a button is pressed.
WARNING: if you want to have proper cursor handling, call
defaultPtrAddEvent(buttonMask,x,y,cl)
in your own function. This sets the coordinates of the cursor.
setXCutText(char* str,int len,rfbClientPtr cl) setXCutText(char* str,int len,rfbClientPtr cl)
is called when the selection changes. is called when the selection changes.
......
...@@ -10,7 +10,6 @@ in the works: ...@@ -10,7 +10,6 @@ in the works:
adapt rdp2vnc (rdesktop) adapt rdp2vnc (rdesktop)
optionally dont draw rich cursors as xcursors optionally dont draw rich cursors as xcursors
use sraRegion from Wez instead of miregion, because it is much smaller
later: later:
------ ------
...@@ -32,4 +31,5 @@ done: ...@@ -32,4 +31,5 @@ done:
.other encodings .other encodings
.test drawing of cursors when not using xcursor or rich cursor encoding .test drawing of cursors when not using xcursor or rich cursor encoding
fix bug with odd width (depends on client depth: width has to be multiple of server.bytesPerPixel/client.bytesPerPixel). only raw!! -> bug of vncviewer! fix bug with odd width (depends on client depth: width has to be multiple of server.bytesPerPixel/client.bytesPerPixel). only raw!! -> bug of vncviewer!
.use sraRegion from Wez instead of miregion, because it is much smaller
This diff is collapsed.
/* $XConsortium: Xalloca.h /main/6 1996/09/28 16:17:22 rws $ */
/*
Copyright (c) 1995 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice 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 X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
/*
* The purpose of this header is to define the macros ALLOCATE_LOCAL and
* DEALLOCATE_LOCAL appropriately for the platform being compiled on.
* These macros are used to make fast, function-local memory allocations.
* Their characteristics are as follows:
*
* void *ALLOCATE_LOCAL(int size)
* Returns a pointer to size bytes of memory, or NULL if the allocation
* failed. The memory must be freed with DEALLOCATE_LOCAL before the
* function that made the allocation returns. You should not ask for
* large blocks of memory with this function, since on many platforms
* the memory comes from the stack, which may have limited size.
*
* void DEALLOCATE_LOCAL(void *)
* Frees the memory allocated by ALLOCATE_LOCAL. Omission of this
* step may be harmless on some platforms, but will result in
* memory leaks or worse on others.
*
* Before including this file, you should define two macros,
* ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK, that have the
* same characteristics as ALLOCATE_LOCAL and DEALLOCATE_LOCAL. The
* header uses the fallbacks if it doesn't know a "better" way to define
* ALLOCATE_LOCAL and DEALLOCATE_LOCAL. Typical usage would be:
*
* #define ALLOCATE_LOCAL_FALLBACK(_size) malloc(_size)
* #define DEALLOCATE_LOCAL_FALLBACK(_ptr) free(_ptr)
* #include "Xalloca.h"
*/
#ifndef XALLOCA_H
#define XALLOCA_H 1
#ifdef INCLUDE_ALLOCA_H
# include <alloca.h>
#endif
#ifndef NO_ALLOCA
/*
* os-dependent definition of local allocation and deallocation
* If you want something other than (DE)ALLOCATE_LOCAL_FALLBACK
* for ALLOCATE/DEALLOCATE_LOCAL then you add that in here.
*/
# if defined(__HIGHC__)
# ifndef NCR
extern char *alloca();
# if HCVERSION < 21003
# define ALLOCATE_LOCAL(size) alloca((int)(size))
pragma on(alloca);
# else /* HCVERSION >= 21003 */
# define ALLOCATE_LOCAL(size) _Alloca((int)(size))
# endif /* HCVERSION < 21003 */
# else /* NCR */
# define ALLOCATE_LOCAL(size) alloca(size)
# endif
# define DEALLOCATE_LOCAL(ptr) /* as nothing */
# endif /* defined(__HIGHC__) */
# ifdef __GNUC__
# ifndef alloca
# define alloca __builtin_alloca
# endif /* !alloca */
# define ALLOCATE_LOCAL(size) alloca((int)(size))
# define DEALLOCATE_LOCAL(ptr) /* as nothing */
# else /* ! __GNUC__ */
/*
* warning: old mips alloca (pre 2.10) is unusable, new one is built in
* Test is easy, the new one is named __builtin_alloca and comes
* from alloca.h which #defines alloca.
*/
# ifndef NCR
# if defined(vax) || defined(sun) || defined(apollo) || defined(stellar) || defined(USL) || defined(alloca)
/*
* Some System V boxes extract alloca.o from /lib/libPW.a; if you
* decide that you don't want to use alloca, you might want to fix it here.
*/
/* alloca might be a macro taking one arg (hi, Sun!), so give it one. */
# ifndef __sgi /* IRIX 5/6 has definition */
# define __Xnullarg /* as nothing */
# ifndef X_NOT_STDC_ENV
extern void *alloca(__Xnullarg);
# else
extern char *alloca(__Xnullarg);
# endif
# endif /* __sgi */
# define ALLOCATE_LOCAL(size) alloca((int)(size))
# define DEALLOCATE_LOCAL(ptr) /* as nothing */
# endif /* who does alloca */
# endif /* NCR */
# endif /* __GNUC__ */
#endif /* NO_ALLOCA */
#if !defined(ALLOCATE_LOCAL)
# if defined(ALLOCATE_LOCAL_FALLBACK) && defined(DEALLOCATE_LOCAL_FALLBACK)
# define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK(_size)
# define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK(_ptr)
# else /* no fallbacks supplied; error */
# define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK undefined!
# define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK undefined!
# endif /* defined(ALLOCATE_LOCAL_FALLBACK && DEALLOCATE_LOCAL_FALLBACK) */
#endif /* !defined(ALLOCATE_LOCAL) */
#endif /* XALLOCA_H */
/* $XConsortium: Xfuncproto.h,v 1.9 95/06/08 23:20:39 gildea Exp $ */
/*
*
Copyright (c) 1989, 1991 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*
*/
/* Definitions to make function prototypes manageable */
#ifndef _XFUNCPROTO_H_
#define _XFUNCPROTO_H_
#ifndef NeedFunctionPrototypes
#if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
#define NeedFunctionPrototypes 1
#else
#define NeedFunctionPrototypes 0
#endif
#endif /* NeedFunctionPrototypes */
#ifndef NeedVarargsPrototypes
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&2)
#define NeedVarargsPrototypes 1
#else
#define NeedVarargsPrototypes 0
#endif
#endif /* NeedVarargsPrototypes */
#if NeedFunctionPrototypes
#ifndef NeedNestedPrototypes
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&8)
#define NeedNestedPrototypes 1
#else
#define NeedNestedPrototypes 0
#endif
#endif /* NeedNestedPrototypes */
#ifndef _Xconst
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) || (FUNCPROTO&4)
#define _Xconst const
#else
#define _Xconst
#endif
#endif /* _Xconst */
#ifndef NeedWidePrototypes
#ifdef NARROWPROTO
#define NeedWidePrototypes 0
#else
#define NeedWidePrototypes 1 /* default to make interropt. easier */
#endif
#endif /* NeedWidePrototypes */
#endif /* NeedFunctionPrototypes */
#ifndef _XFUNCPROTOBEGIN
#ifdef __cplusplus /* for C++ V2.0 */
#define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */
#define _XFUNCPROTOEND }
#else
#define _XFUNCPROTOBEGIN
#define _XFUNCPROTOEND
#endif
#endif /* _XFUNCPROTOBEGIN */
#endif /* _XFUNCPROTO_H_ */
/*
* $XConsortium: Xfuncs.h,v 1.16 94/12/01 16:25:53 kaleb Exp $
* $XFree86: xc/include/Xfuncs.h,v 3.2 1995/01/28 15:42:03 dawes Exp $
*
*
Copyright (c) 1990 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*
*/
#ifndef _XFUNCS_H_
#define _XFUNCS_H_
#include <X11/Xosdefs.h>
/* the old Xfuncs.h, for pre-R6 */
#ifdef X_USEBFUNCS
void bcopy();
void bzero();
int bcmp();
#else
#if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_)
#include <string.h>
#define _XFUNCS_H_INCLUDED_STRING_H
#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
#define bzero(b,len) memset(b, 0, (size_t)(len))
#define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
#else
#ifdef sgi
#include <bstring.h>
#else
#ifdef SYSV
#include <memory.h>
void bcopy();
#define bzero(b,len) memset(b, 0, len)
#define bcmp(b1,b2,len) memcmp(b1, b2, len)
#else
#ifdef __EMX__
#include <strings.h>
#define _XFUNCS_H_INCLUDED_STRING_H
/* bcopy, bcmp, bzero declared */
#else /* bsd */
void bcopy();
void bzero();
int bcmp();
#endif
#endif /* SYSV */
#endif /* sgi */
#endif /* __STDC__ and relatives */
#endif /* X_USEBFUNCS */
/* the new Xfuncs.h */
#if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
/* the ANSI C way */
#ifndef _XFUNCS_H_INCLUDED_STRING_H
#include <string.h>
#endif
#undef bzero
#define bzero(b,len) memset(b,0,len)
#else /* else X_NOT_STDC_ENV or SunOS 4 */
#if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
#include <memory.h>
#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
#if defined(SYSV) && defined(_XBCOPYFUNC)
#undef memmove
#define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
#define _XNEEDBCOPYFUNC
#endif
#else /* else vanilla BSD */
#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
#define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
#define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
#endif /* SYSV else */
#endif /* ! X_NOT_STDC_ENV else */
#endif /* _XFUNCS_H_ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#ifndef XMD_H
#define XMD_H 1
/* $XConsortium: Xmd.h,v 1.49 95/06/08 23:20:39 gildea Exp $ */
/* $XFree86: xc/include/Xmd.h,v 3.4 1996/12/31 04:15:20 dawes Exp $ */
/*
* Xmd.h: MACHINE DEPENDENT DECLARATIONS.
*/
/*
* Special per-machine configuration flags.
*/
#ifdef CRAY
#define WORD64 /* 64-bit architecture */
#endif
#if defined(__alpha) || defined(__alpha__)
#define LONG64 /* 32/64-bit architecture */
#endif
#ifdef __sgi
#if (_MIPS_SZLONG == 64)
#define LONG64
#endif
#endif
/*
* Stuff to handle large architecture machines; the constants were generated
* on a 32-bit machine and must coorespond to the protocol.
*/
#ifdef WORD64
#define MUSTCOPY
#endif /* WORD64 */
/*
* Definition of macro used to set constants for size of network structures;
* machines with preprocessors that can't handle all of the sz_ symbols
* can define this macro to be sizeof(x) if and only if their compiler doesn't
* pad out structures (esp. the xTextElt structure which contains only two
* one-byte fields). Network structures should always define sz_symbols.
*
* The sz_ prefix is used instead of something more descriptive so that the
* symbols are no more than 32 characters long (which causes problems for some
* compilers and preprocessors).
*
* The extra indirection in the __STDC__ case is to get macro arguments to
* expand correctly before the concatenation, rather than afterward.
*/
#if ((defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)) && !defined(UNIXCPP)) || defined(ANSICPP)
#define _SIZEOF(x) sz_##x
#define SIZEOF(x) _SIZEOF(x)
#else
#define SIZEOF(x) sz_/**/x
#endif /* if ANSI C compiler else not */
/*
* Bitfield suffixes for the protocol structure elements, if you
* need them. Note that bitfields are not guarranteed to be signed
* (or even unsigned) according to ANSI C.
*/
#ifdef WORD64
typedef long INT64;
typedef unsigned long CARD64;
#define B32 :32
#define B16 :16
#ifdef UNSIGNEDBITFIELDS
typedef unsigned int INT32;
typedef unsigned int INT16;
#else
#ifdef __STDC__
typedef signed int INT32;
typedef signed int INT16;
#else
typedef int INT32;
typedef int INT16;
#endif
#endif
#else
#define B32
#define B16
#ifdef LONG64
typedef long INT64;
typedef int INT32;
#else
typedef long INT32;
#endif
typedef short INT16;
#endif
#if defined(__STDC__) || defined(sgi) || defined(AIXV3)
typedef signed char INT8;
#else
typedef char INT8;
#endif
#ifdef LONG64
typedef unsigned long CARD64;
typedef unsigned int CARD32;
#else
typedef unsigned long CARD32;
#endif
typedef unsigned short CARD16;
typedef unsigned char CARD8;
typedef CARD32 BITS32;
typedef CARD16 BITS16;
#ifndef __EMX__
typedef CARD8 BYTE;
typedef CARD8 BOOL;
#else
/*
* This is bad style, but the central include file <os2.h> declares them
* as well
*/
#define BYTE CARD8
#define BOOL CARD8
#endif
/*
* definitions for sign-extending bitfields on 64-bit architectures
*/
#if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
#define cvtINT8toInt(val) (((val) & 0x00000080) ? ((val) | 0xffffffffffffff00) : (val))
#define cvtINT16toInt(val) (((val) & 0x00008000) ? ((val) | 0xffffffffffff0000) : (val))
#define cvtINT32toInt(val) (((val) & 0x80000000) ? ((val) | 0xffffffff00000000) : (val))
#define cvtINT8toShort(val) cvtINT8toInt(val)
#define cvtINT16toShort(val) cvtINT16toInt(val)
#define cvtINT32toShort(val) cvtINT32toInt(val)
#define cvtINT8toLong(val) cvtINT8toInt(val)
#define cvtINT16toLong(val) cvtINT16toInt(val)
#define cvtINT32toLong(val) cvtINT32toInt(val)
#else
#define cvtINT8toInt(val) (val)
#define cvtINT16toInt(val) (val)
#define cvtINT32toInt(val) (val)
#define cvtINT8toShort(val) (val)
#define cvtINT16toShort(val) (val)
#define cvtINT32toShort(val) (val)
#define cvtINT8toLong(val) (val)
#define cvtINT16toLong(val) (val)
#define cvtINT32toLong(val) (val)
#endif /* WORD64 and UNSIGNEDBITFIELDS */
#ifdef MUSTCOPY
/*
* This macro must not cast or else pointers will get aligned and be wrong
*/
#define NEXTPTR(p,t) (((char *) p) + SIZEOF(t))
#else /* else not MUSTCOPY, this is used for 32-bit machines */
/*
* this version should leave result of type (t *), but that should only be
* used when not in MUSTCOPY
*/
#define NEXTPTR(p,t) (((t *)(p)) + 1)
#endif /* MUSTCOPY - used machines whose C structs don't line up with proto */
#endif /* XMD_H */
/*
* $XConsortium: Xos.h /main/70 1996/11/15 16:00:41 kaleb $
* $XFree86: xc/include/Xos.h,v 3.21.2.1 1998/01/23 12:35:11 dawes Exp $
*
*
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*
* The X Window System is a Trademark of X Consortium.
*
*/
/* This is a collection of things to try and minimize system dependencies
* in a "signficant" number of source files.
*/
#ifndef _XOS_H_
#define _XOS_H_
#include <X11/Xosdefs.h>
/*
* Get major data types (esp. caddr_t)
*/
#ifdef USG
#ifndef __TYPES__
#ifdef CRAY
#define word word_t
#endif /* CRAY */
#include <sys/types.h> /* forgot to protect it... */
#define __TYPES__
#endif /* __TYPES__ */
#else /* USG */
#if defined(_POSIX_SOURCE) && (defined(MOTOROLA) || defined(AMOEBA))
#undef _POSIX_SOURCE
#include <sys/types.h>
#define _POSIX_SOURCE
#else
#include <sys/types.h>
#endif
#endif /* USG */
/*
* Just about everyone needs the strings routines. We provide both forms here,
* index/rindex and strchr/strrchr, so any systems that don't provide them all
* need to have #defines here.
*
* NOTE: The following ISN'T true for this XFree86 version of this file.
*
* These macros are defined this way, rather than, e.g.:
* #defined index(s,c) strchr(s,c)
* because someone might be using them as function pointers, and such
* a change would break compatibility for anyone who's relying on them
* being the way they currently are. So we're stuck with them this way,
* which can be really inconvenient. :-(
*/
#ifndef X_NOT_STDC_ENV
#include <string.h>
#ifdef __STDC__
#ifndef index
#define index(s,c) (strchr((s),(c)))
#endif
#ifndef rindex
#define rindex(s,c) (strrchr((s),(c)))
#endif
#else
#ifndef index
#define index strchr
#endif
#ifndef rindex
#define rindex strrchr
#endif
#endif
#else
#ifdef SYSV
#if defined(clipper) || defined(__clipper__)
#include <malloc.h>
#endif
#include <string.h>
#define index strchr
#define rindex strrchr
#else
#include <strings.h>
#define strchr index
#define strrchr rindex
#endif
#endif /* X_NOT_STDC_ENV */
/*
* strerror()
*/
#if (defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4)) || defined(macII)) && !defined(__GLIBC__)
#ifndef strerror
extern char *sys_errlist[];
extern int sys_nerr;
#define strerror(n) \
(((n) >= 0 && (n) < sys_nerr) ? sys_errlist[n] : "unknown error")
#endif
#endif
/*
* Get open(2) constants
*/
#ifdef X_NOT_POSIX
#include <fcntl.h>
#if defined(USL) || defined(CRAY) || defined(MOTOROLA) || (defined(i386) && (defined(SYSV) || defined(SVR4))) || defined(__sxg__)
#include <unistd.h>
#endif
#ifdef WIN32
#include <X11/Xw32defs.h>
#else
#include <sys/file.h>
#endif
#else /* X_NOT_POSIX */
#if !defined(_POSIX_SOURCE) && defined(macII)
#define _POSIX_SOURCE
#include <fcntl.h>
#include <unistd.h>
#undef _POSIX_SOURCE
#else
#include <fcntl.h>
#include <unistd.h>
#endif
#endif /* X_NOT_POSIX else */
#ifdef CSRG_BASED
#include <stdlib.h>
#include <unistd.h>
#endif /* CSRG_BASED */
/*
* Get struct timeval
*/
#ifdef SYSV
#ifndef USL
#include <sys/time.h>
#endif
#include <time.h>
#ifdef CRAY
#undef word
#endif /* CRAY */
#if defined(USG) && !defined(CRAY) && !defined(MOTOROLA) && !defined(uniosu) && !defined(__sxg__) && !defined(clipper) && !defined(__clipper__)
struct timeval {
long tv_sec;
long tv_usec;
};
#ifndef USL_SHARELIB
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
#endif /* USL_SHARELIB */
#endif /* USG */
#ifdef _SEQUENT_
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
#endif /* _SEQUENT_ */
#else /* not SYSV */
#if defined(_ANSI_SOURCE) && defined(__bsdi__)
#undef _ANSI_SOURCE
#include <sys/time.h>
#define _ANSI_SOURCE
#endif
#if defined(_POSIX_SOURCE) && defined(SVR4)
/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
#undef _POSIX_SOURCE
#include <sys/time.h>
#define _POSIX_SOURCE
#else /* defined(_POSIX_SOURCE) && defined(SVR4) */
#ifdef WIN32
#include <time.h>
#if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_)
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
#endif
#include <sys/timeb.h>
#define gettimeofday(t) \
{ \
struct _timeb _gtodtmp; \
_ftime (&_gtodtmp); \
(t)->tv_sec = _gtodtmp.time; \
(t)->tv_usec = _gtodtmp.millitm * 1000; \
}
#else /* WIN32 */
#ifdef _SEQUENT_
#include <time.h>
#else /* _SEQUENT_ */
#ifdef AMOEBA
#include <time.h>
#include <sys/time.h>
#else /* AMOEBA */
#ifdef MINIX
#include <time.h>
#else /* !MINIX */
#ifndef Lynx
#include <sys/time.h>
#else
#include <time.h>
#endif /* Lynx */
#endif /* MINIX */
#endif /* AMOEBA */
#endif /* _SEQUENT_ */
#endif /* WIN32 else */
#endif /* defined(_POSIX_SOURCE) && defined(SVR4) */
#endif /* SYSV */
/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
#if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */
#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
#else
#if defined(SVR4) || defined(VMS) || defined(WIN32)
#define X_GETTIMEOFDAY(t) gettimeofday(t)
#else
#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0)
#endif
#endif /* XPG4 else */
#ifdef MINIX
#include <errno.h>
#include <net/gen/in.h>
#include <net/gen/socket.h>
#include <net/gen/udp.h>
#include <net/gen/udp_hdr.h>
struct sockaddr
{
u16_t sa_family;
char sa_data[14];
};
struct sockaddr_in
{
u16_t sin_family;
u16_t sin_port;
struct
{
ipaddr_t s_addr;
} sin_addr;
char sin_zero[8];
};
struct in_addr
{
ipaddr_t s_addr;
};
typedef char *caddr_t;
typedef unsigned char u_char;
#endif /* MINIX */
#ifdef __EMX__
typedef unsigned long fd_mask;
#endif
/* use POSIX name for signal */
#if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD) && !defined(ISC)
#define SIGCHLD SIGCLD
#endif
#ifdef ISC
#include <sys/bsdtypes.h>
#include <sys/limits.h>
#define NGROUPS 16
#endif
#if defined(ISC) || defined(__EMX__)
/*
* Some OS's may not have this
*/
#define X_NO_SYS_UN 1
struct sockaddr_un {
short sun_family;
char sun_path[108];
};
#endif
#endif /* _XOS_H_ */
/*
* O/S-dependent (mis)feature macro definitions
*
* $XConsortium: Xosdefs.h /main/16 1996/09/28 16:17:29 rws $
* $XFree86: xc/include/Xosdefs.h,v 3.11 1996/12/23 05:58:09 dawes Exp $
*
Copyright (c) 1991 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
#ifndef _XOSDEFS_H_
#define _XOSDEFS_H_
/*
* X_NOT_STDC_ENV means does not have ANSI C header files. Lack of this
* symbol does NOT mean that the system has stdarg.h.
*
* X_NOT_POSIX means does not have POSIX header files. Lack of this
* symbol does NOT mean that the POSIX environment is the default.
* You may still have to define _POSIX_SOURCE to get it.
*/
#ifdef NOSTDHDRS
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef sony
#if !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV)
#define X_NOT_POSIX
#endif
#endif
#ifdef UTEK
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef vax
#ifndef ultrix /* assume vanilla BSD */
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#endif
#ifdef luna
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef Mips
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef USL
#ifdef SYSV /* (release 3.2) */
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#endif
#ifdef i386
#ifdef SYSV
#if !(defined(ISC) && defined(_POSIX_SOURCE))
#ifndef SCO
#ifndef _SCO_DS /* SCO 5.0 has SVR4 header files */
#define X_NOT_POSIX
#endif
#define X_NOT_STDC_ENV
#endif
#endif /* !(defined(ISC) && defined(_POSIX_SOURCE)) */
#endif
#endif
#ifdef MOTOROLA
#ifdef SYSV
#define X_NOT_STDC_ENV
#endif
#endif
#ifdef sun
#ifdef SVR4
/* define this to whatever it needs to be */
#define X_POSIX_C_SOURCE 199300L
#endif
#endif
#ifdef WIN32
#ifndef _POSIX_
#define X_NOT_POSIX
#endif
#endif
#if defined(nec_ews_svr2) || defined(SX) || defined(PC_UX)
#define X_NOT_POSIX
#define X_NOT_STDC_ENV
#endif
#ifdef __EMX__
#define USGISH
/* EMX claims to be ANSI, so X_NOT_STDC_ENV does not hold */
/* could have been provided as std flags as well */
#define X_WCHAR
#define X_LOCALE
#endif
#endif /* _XOSDEFS_H_ */
This diff is collapsed.
/* $XConsortium: Xprotostr.h,v 1.5 94/04/17 20:10:53 rws Exp $ */
#ifndef XPROTOSTRUCTS_H
#define XPROTOSTRUCTS_H
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#include <X11/Xmd.h>
/* Used by PolySegment */
typedef struct _xSegment {
INT16 x1 B16, y1 B16, x2 B16, y2 B16;
} xSegment;
/* POINT */
typedef struct _xPoint {
INT16 x B16, y B16;
} xPoint;
typedef struct _xRectangle {
INT16 x B16, y B16;
CARD16 width B16, height B16;
} xRectangle;
/* ARC */
typedef struct _xArc {
INT16 x B16, y B16;
CARD16 width B16, height B16;
INT16 angle1 B16, angle2 B16;
} xArc;
#endif /* XPROTOSTRUCTS_H */
/* $XConsortium: keysym.h,v 1.15 94/04/17 20:10:55 rws Exp $ */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
/* default keysyms */
#define XK_MISCELLANY
#define XK_XKB_KEYS
#define XK_LATIN1
#define XK_LATIN2
#define XK_LATIN3
#define XK_LATIN4
#define XK_GREEK
#include <X11/keysymdef.h>
This diff is collapsed.
/*
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
*/
/* $XConsortium: colormap.h,v 1.28 94/04/17 20:25:32 dpw Exp $ */
/* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.2 1997/01/14 22:22:38 dawes Exp $ */
#ifndef CMAP_H
#define CMAP_H 1
#include "X11/Xproto.h"
#include "screenint.h"
#include "window.h"
/* these follow X.h's AllocNone and AllocAll */
#define CM_PSCREEN 2
#define CM_PWIN 3
/* Passed internally in colormap.c */
#define REDMAP 0
#define GREENMAP 1
#define BLUEMAP 2
#define PSEUDOMAP 3
#define AllocPrivate (-1)
#define AllocTemporary (-2)
#define DynamicClass 1
/* Values for the flags field of a colormap. These should have 1 bit set
* and not overlap */
#define IsDefault 1
#define AllAllocated 2
#define BeingCreated 4
typedef CARD32 Pixel;
typedef struct _CMEntry *EntryPtr;
/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
typedef struct _colorResource *colorResourcePtr;
extern int CreateColormap(
#if NeedFunctionPrototypes
Colormap /*mid*/,
ScreenPtr /*pScreen*/,
VisualPtr /*pVisual*/,
ColormapPtr* /*ppcmap*/,
int /*alloc*/,
int /*client*/
#endif
);
extern int FreeColormap(
#if NeedFunctionPrototypes
pointer /*pmap*/,
XID /*mid*/
#endif
);
extern int TellLostMap(
#if NeedFunctionPrototypes
X11WindowPtr /*pwin*/,
pointer /* Colormap *pmid */
#endif
);
extern int TellGainedMap(
#if NeedFunctionPrototypes
X11WindowPtr /*pwin*/,
pointer /* Colormap *pmid */
#endif
);
extern int CopyColormapAndFree(
#if NeedFunctionPrototypes
Colormap /*mid*/,
ColormapPtr /*pSrc*/,
int /*client*/
#endif
);
extern int AllocColor(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
unsigned short* /*pred*/,
unsigned short* /*pgreen*/,
unsigned short* /*pblue*/,
Pixel* /*pPix*/,
int /*client*/
#endif
);
extern void FakeAllocColor(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
xColorItem * /*item*/
#endif
);
extern void FakeFreeColor(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
Pixel /*pixel*/
#endif
);
typedef int (*ColorCompareProcPtr)(
#if NeedNestedPrototypes
EntryPtr /*pent*/,
xrgb * /*prgb*/
#endif
);
extern int FindColor(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
EntryPtr /*pentFirst*/,
int /*size*/,
xrgb* /*prgb*/,
Pixel* /*pPixel*/,
int /*channel*/,
int /*client*/,
ColorCompareProcPtr /*comp*/
#endif
);
extern int QueryColors(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
int /*count*/,
Pixel* /*ppixIn*/,
xrgb* /*prgbList*/
#endif
);
extern int FreeClientPixels(
#if NeedFunctionPrototypes
pointer /*pcr*/,
XID /*fakeid*/
#endif
);
extern int AllocColorCells(
#if NeedFunctionPrototypes
int /*client*/,
ColormapPtr /*pmap*/,
int /*colors*/,
int /*planes*/,
Bool /*contig*/,
Pixel* /*ppix*/,
Pixel* /*masks*/
#endif
);
extern int AllocColorPlanes(
#if NeedFunctionPrototypes
int /*client*/,
ColormapPtr /*pmap*/,
int /*colors*/,
int /*r*/,
int /*g*/,
int /*b*/,
Bool /*contig*/,
Pixel* /*pixels*/,
Pixel* /*prmask*/,
Pixel* /*pgmask*/,
Pixel* /*pbmask*/
#endif
);
extern int FreeColors(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
int /*client*/,
int /*count*/,
Pixel* /*pixels*/,
Pixel /*mask*/
#endif
);
extern int StoreColors(
#if NeedFunctionPrototypes
ColormapPtr /*pmap*/,
int /*count*/,
xColorItem* /*defs*/
#endif
);
extern int IsMapInstalled(
#if NeedFunctionPrototypes
Colormap /*map*/,
X11WindowPtr /*pWin*/
#endif
);
#endif /* CMAP_H */
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
/* $XConsortium: cursor.h,v 1.22 94/04/17 20:25:34 dpw Exp $ */
#ifndef CURSOR_H
#define CURSOR_H
#include "misc.h"
#include "screenint.h"
#include "window.h"
#define NullCursor ((CursorPtr)NULL)
typedef struct _Cursor *CursorPtr;
typedef struct _CursorMetric *CursorMetricPtr;
extern CursorPtr rootCursor;
extern int FreeCursor(
#if NeedFunctionPrototypes
pointer /*pCurs*/,
XID /*cid*/
#endif
);
extern CursorPtr X11AllocCursor(
#if NeedFunctionPrototypes
unsigned char* /*psrcbits*/,
unsigned char* /*pmaskbits*/,
CursorMetricPtr /*cm*/,
unsigned /*foreRed*/,
unsigned /*foreGreen*/,
unsigned /*foreBlue*/,
unsigned /*backRed*/,
unsigned /*backGreen*/,
unsigned /*backBlue*/
#endif
);
extern int AllocGlyphCursor(
#if NeedFunctionPrototypes
Font /*source*/,
unsigned int /*sourceChar*/,
Font /*mask*/,
unsigned int /*maskChar*/,
unsigned /*foreRed*/,
unsigned /*foreGreen*/,
unsigned /*foreBlue*/,
unsigned /*backRed*/,
unsigned /*backGreen*/,
unsigned /*backBlue*/,
CursorPtr* /*ppCurs*/,
ClientPtr /*client*/
#endif
);
extern CursorPtr CreateRootCursor(
#if NeedFunctionPrototypes
char* /*pfilename*/,
unsigned int /*glyph*/
#endif
);
extern int ServerBitsFromGlyph(
#if NeedFunctionPrototypes
FontPtr /*pfont*/,
unsigned int /*ch*/,
register CursorMetricPtr /*cm*/,
unsigned char ** /*ppbits*/
#endif
);
extern Bool CursorMetricsFromGlyph(
#if NeedFunctionPrototypes
FontPtr /*pfont*/,
unsigned /*ch*/,
CursorMetricPtr /*cm*/
#endif
);
extern void CheckCursorConfinement(
#if NeedFunctionPrototypes
X11WindowPtr /*pWin*/
#endif
);
extern void NewCurrentScreen(
#if NeedFunctionPrototypes
ScreenPtr /*newScreen*/,
int /*x*/,
int /*y*/
#endif
);
extern Bool PointerConfinedToScreen(
#if NeedFunctionPrototypes
void
#endif
);
extern void GetSpritePosition(
#if NeedFunctionPrototypes
int * /*px*/,
int * /*py*/
#endif
);
#endif /* CURSOR_H */
This diff is collapsed.
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
******************************************************************/
/* $XConsortium: gc.h /main/16 1996/08/01 19:18:17 dpw $ */
#ifndef GC_H
#define GC_H
#include "misc.h" /* for Bool */
#include "X11/X.h" /* for GContext, Mask */
#include "X11/Xproto.h"
#include "screenint.h" /* for ScreenPtr */
#include "pixmap.h" /* for DrawablePtr */
/* clientClipType field in GC */
#define CT_NONE 0
#define CT_PIXMAP 1
#define CT_REGION 2
#define CT_UNSORTED 6
#define CT_YSORTED 10
#define CT_YXSORTED 14
#define CT_YXBANDED 18
#define GCQREASON_VALIDATE 1
#define GCQREASON_CHANGE 2
#define GCQREASON_COPY_SRC 3
#define GCQREASON_COPY_DST 4
#define GCQREASON_DESTROY 5
#define GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
#define GC_CALL_VALIDATE_BIT (1L<<30)
#define GCExtensionInterest (1L<<29)
#define DRAWABLE_SERIAL_BITS (~(GC_CHANGE_SERIAL_BIT))
#define MAX_SERIAL_NUM (1L<<28)
#define NEXT_SERIAL_NUMBER ((++globalSerialNumber) > MAX_SERIAL_NUM ? \
(globalSerialNumber = 1): globalSerialNumber)
typedef struct _GCInterest *GCInterestPtr;
typedef struct _GC *GCPtr;
typedef struct _GCOps *GCOpsPtr;
extern void ValidateGC(
#if NeedFunctionPrototypes
DrawablePtr /*pDraw*/,
GCPtr /*pGC*/
#endif
);
extern int ChangeGC(
#if NeedFunctionPrototypes
GCPtr/*pGC*/,
BITS32 /*mask*/,
XID* /*pval*/
#endif
);
extern int DoChangeGC(
#if NeedFunctionPrototypes
GCPtr/*pGC*/,
BITS32 /*mask*/,
XID* /*pval*/,
int /*fPointer*/
#endif
);
typedef union {
CARD32 val;
pointer ptr;
} ChangeGCVal, *ChangeGCValPtr;
extern int dixChangeGC(
#if NeedFunctionPrototypes
ClientPtr /*client*/,
GCPtr /*pGC*/,
BITS32 /*mask*/,
CARD32 * /*pval*/,
ChangeGCValPtr /*pCGCV*/
#endif
);
extern GCPtr CreateGC(
#if NeedFunctionPrototypes
DrawablePtr /*pDrawable*/,
BITS32 /*mask*/,
XID* /*pval*/,
int* /*pStatus*/
#endif
);
extern int CopyGC(
#if NeedFunctionPrototypes
GCPtr/*pgcSrc*/,
GCPtr/*pgcDst*/,
BITS32 /*mask*/
#endif
);
extern int FreeGC(
#if NeedFunctionPrototypes
pointer /*pGC*/,
XID /*gid*/
#endif
);
extern void SetGCMask(
#if NeedFunctionPrototypes
GCPtr /*pGC*/,
Mask /*selectMask*/,
Mask /*newDataMask*/
#endif
);
extern GCPtr CreateScratchGC(
#if NeedFunctionPrototypes
ScreenPtr /*pScreen*/,
unsigned /*depth*/
#endif
);
extern void FreeGCperDepth(
#if NeedFunctionPrototypes
int /*screenNum*/
#endif
);
extern Bool CreateGCperDepth(
#if NeedFunctionPrototypes
int /*screenNum*/
#endif
);
extern Bool CreateDefaultStipple(
#if NeedFunctionPrototypes
int /*screenNum*/
#endif
);
extern void FreeDefaultStipple(
#if NeedFunctionPrototypes
int /*screenNum*/
#endif
);
extern int SetDashes(
#if NeedFunctionPrototypes
GCPtr /*pGC*/,
unsigned /*offset*/,
unsigned /*ndash*/,
unsigned char* /*pdash*/
#endif
);
extern int VerifyRectOrder(
#if NeedFunctionPrototypes
int /*nrects*/,
xRectangle* /*prects*/,
int /*ordering*/
#endif
);
extern int SetClipRects(
#if NeedFunctionPrototypes
GCPtr /*pGC*/,
int /*xOrigin*/,
int /*yOrigin*/,
int /*nrects*/,
xRectangle* /*prects*/,
int /*ordering*/
#endif
);
extern GCPtr GetScratchGC(
#if NeedFunctionPrototypes
unsigned /*depth*/,
ScreenPtr /*pScreen*/
#endif
);
extern void FreeScratchGC(
#if NeedFunctionPrototypes
GCPtr /*pGC*/
#endif
);
#endif /* GC_H */
This diff is collapsed.
/***********************************************************
Copyright (c) 1987 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL 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.
Copyright 1992, 1993 Data General Corporation;
Copyright 1992, 1993 OMRON Corporation
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
neither the name OMRON or DATA GENERAL be used in advertising or publicity
pertaining to distribution of the software without specific, written prior
permission of the party whose name is to be used. Neither OMRON or
DATA GENERAL make any representation about the suitability of this software
for any purpose. It is provided "as is" without express or implied warranty.
OMRON AND DATA GENERAL EACH DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
IN NO EVENT SHALL OMRON OR DATA GENERAL 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.
******************************************************************/
/* $XConsortium: misc.h /main/28 1996/12/02 10:22:01 lehors $ */
/* $XFree86: xc/programs/Xserver/include/misc.h,v 3.5 1996/12/23 07:09:29 dawes Exp $ */
#ifndef MISC_H
#define MISC_H 1
/*
* X internal definitions
*
*/
extern unsigned long globalSerialNumber;
extern unsigned long serverGeneration;
#include <X11/Xosdefs.h>
#include <X11/Xfuncproto.h>
#include <X11/Xmd.h>
#include <X11/X.h>
#ifndef NULL
#ifndef X_NOT_STDC_ENV
#include <stddef.h>
#else
#define NULL 0
#endif
#endif
#ifndef MAXSCREENS
#define MAXSCREENS 3
#endif
#define MAXCLIENTS 128
#define MAXDITS 1
#define MAXEXTENSIONS 128
#define MAXFORMATS 8
#define MAXVISUALS_PER_SCREEN 50
#if NeedFunctionPrototypes
typedef void *pointer;
#else
typedef unsigned char *pointer;
#endif
typedef int Bool;
typedef unsigned long PIXEL;
typedef unsigned long ATOM;
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#ifndef _XTYPEDEF_FONTPTR
typedef struct _Font *FontPtr; /* also in fonts/include/font.h */
#define _XTYPEDEF_FONTPTR
#endif
#ifndef _XTYPEDEF_CLIENTPTR
typedef struct _Client *ClientPtr; /* also in dix.h */
#define _XTYPEDEF_CLIENTPTR
#endif
#ifndef _XTYPEDEF_CALLBACKLISTPTR
typedef struct _CallbackList *CallbackListPtr; /* also in dix.h */
#define _XTYPEDEF_CALLBACKLISTPTR
#endif
typedef struct _xReq *xReqPtr;
#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */
#define NullBox ((BoxPtr)0)
#define MILLI_PER_MIN (1000 * 60)
#define MILLI_PER_SECOND (1000)
/* this next is used with None and ParentRelative to tell
PaintWin() what to use to paint the background. Also used
in the macro IS_VALID_PIXMAP */
#define USE_BACKGROUND_PIXEL 3
#define USE_BORDER_PIXEL 3
/* byte swap a 32-bit literal */
#define lswapl(x) ((((x) & 0xff) << 24) |\
(((x) & 0xff00) << 8) |\
(((x) & 0xff0000) >> 8) |\
(((x) >> 24) & 0xff))
/* byte swap a short literal */
#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))
#if !defined(AMOEBA) && !defined(__EMX__)
#ifndef abs
#define abs(a) ((a) > 0 ? (a) : -(a))
#endif
#else /* AMOEBA || __EMX__ */
/* abs() is a function, not a macro; include the file declaring
* it in case we haven't done that yet.
*/
#include <stdlib.h>
#endif /* AMOEBA */
#ifndef Fabs
#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */
#endif
#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
/* this assumes b > 0 */
#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
/*
* return the least significant bit in x which is set
*
* This works on 1's complement and 2's complement machines.
* If you care about the extra instruction on 2's complement
* machines, change to ((x) & (-(x)))
*/
#define lowbit(x) ((x) & (~(x) + 1))
#ifndef MAXSHORT
#define MAXSHORT 32767
#endif
#ifndef MINSHORT
#define MINSHORT -MAXSHORT
#endif
/* some macros to help swap requests, replies, and events */
#define LengthRestB(stuff) \
((client->req_len << 2) - sizeof(*stuff))
#define LengthRestS(stuff) \
((client->req_len << 1) - (sizeof(*stuff) >> 1))
#define LengthRestL(stuff) \
(client->req_len - (sizeof(*stuff) >> 2))
#define SwapRestS(stuff) \
SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
#define SwapRestL(stuff) \
SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
/* byte swap a 32-bit value */
#define swapl(x, n) { \
n = ((char *) (x))[0];\
((char *) (x))[0] = ((char *) (x))[3];\
((char *) (x))[3] = n;\
n = ((char *) (x))[1];\
((char *) (x))[1] = ((char *) (x))[2];\
((char *) (x))[2] = n; }
/* byte swap a short */
#define swaps(x, n) { \
n = ((char *) (x))[0];\
((char *) (x))[0] = ((char *) (x))[1];\
((char *) (x))[1] = n; }
/* copy 32-bit value from src to dst byteswapping on the way */
#define cpswapl(src, dst) { \
((char *)&(dst))[0] = ((char *) &(src))[3];\
((char *)&(dst))[1] = ((char *) &(src))[2];\
((char *)&(dst))[2] = ((char *) &(src))[1];\
((char *)&(dst))[3] = ((char *) &(src))[0]; }
/* copy short from src to dst byteswapping on the way */
#define cpswaps(src, dst) { \
((char *) &(dst))[0] = ((char *) &(src))[1];\
((char *) &(dst))[1] = ((char *) &(src))[0]; }
extern void SwapLongs(
#if NeedFunctionPrototypes
CARD32 *list,
unsigned long count
#endif
);
extern void SwapShorts(
#if NeedFunctionPrototypes
short *list,
unsigned long count
#endif
);
extern void MakePredeclaredAtoms(
#if NeedFunctionPrototypes
void
#endif
);
extern int Ones(
#if NeedFunctionPrototypes
unsigned long /*mask*/
#endif
);
typedef struct _xPoint *DDXPointPtr;
typedef struct _Box *BoxPtr;
typedef struct _xEvent *xEventPtr;
typedef struct _xRectangle *xRectanglePtr;
typedef struct _GrabRec *GrabPtr;
/* typedefs from other places - duplicated here to minimize the amount
* of unnecessary junk that one would normally have to include to get
* these symbols defined
*/
#ifndef _XTYPEDEF_CHARINFOPTR
typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */
#define _XTYPEDEF_CHARINFOPTR
#endif
#endif /* MISC_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* $XConsortium: validate.h,v 5.4 94/04/17 20:26:11 dpw Exp $ */
/*
Copyright (c) 1989 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice 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
X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
#ifndef VALIDATE_H
#define VALIDATE_H
#include "miscstruct.h"
#include "regionstr.h"
typedef enum { VTOther, VTStack, VTMove, VTUnmap, VTMap } VTKind;
/* union _Validate is now device dependent; see mivalidate.h for an example */
typedef union _Validate *ValidatePtr;
#define UnmapValData ((ValidatePtr)1)
#endif /* VALIDATE_H */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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