feat(x11): migrate to pure Xlibre + dwm/dmenu/st stack, fix fcitx5-t9 bottom bar, PM8909 PON shutdown, and remove Wayland
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
cachedir="${XDG_CACHE_HOME:-"$HOME/.cache"}"
|
||||
cache="$cachedir/dmenu_run"
|
||||
|
||||
[ ! -e "$cachedir" ] && mkdir -p "$cachedir"
|
||||
|
||||
IFS=:
|
||||
if stest -dqr -n "$cache" $PATH; then
|
||||
stest -flx $PATH | sort -u | tee "$cache"
|
||||
else
|
||||
cat "$cache"
|
||||
fi
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
dmenu_path | dmenu "$@" | ${SHELL:-"/bin/sh"} &
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Symlink
+1
@@ -0,0 +1 @@
|
||||
Xorg
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2010, Oracle and/or its affiliates.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef XPRINTF_H
|
||||
#define XPRINTF_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include "os.h"
|
||||
|
||||
#ifndef _X_RESTRICT_KYWD
|
||||
#if defined(restrict) /* assume autoconf set it correctly */ || \
|
||||
(defined(__STDC__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */
|
||||
#define _X_RESTRICT_KYWD restrict
|
||||
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */
|
||||
#define _X_RESTRICT_KYWD __restrict__
|
||||
#else
|
||||
#define _X_RESTRICT_KYWD
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* These functions provide a portable implementation of the common (but not
|
||||
* yet universal) asprintf & vasprintf routines to allocate a buffer big
|
||||
* enough to sprintf the arguments to. The XNF variants terminate the server
|
||||
* if the allocation fails.
|
||||
* The buffer allocated is returned in the pointer provided in the first
|
||||
* argument. The return value is the size of the allocated buffer, or -1
|
||||
* on failure.
|
||||
*/
|
||||
extern _X_EXPORT int /* deprecated */
|
||||
XNFasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, ...)
|
||||
_X_ATTRIBUTE_PRINTF(2, 3);
|
||||
extern _X_EXPORT int
|
||||
XNFvasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, va_list va)
|
||||
_X_ATTRIBUTE_VPRINTF(2, 0);
|
||||
|
||||
#endif /* XPRINTF_H */
|
||||
@@ -0,0 +1,82 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 CALLBACK_H
|
||||
#define CALLBACK_H
|
||||
|
||||
#include <X11/X.h> /* for GContext, Mask */
|
||||
#include <X11/Xdefs.h> /* for Bool */
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
/*
|
||||
* callback manager stuff
|
||||
*/
|
||||
|
||||
typedef struct _CallbackList *CallbackListPtr;
|
||||
|
||||
typedef void (*CallbackProcPtr) (CallbackListPtr *, void *, void *);
|
||||
|
||||
extern _X_EXPORT Bool AddCallback(CallbackListPtr *pcbl,
|
||||
CallbackProcPtr callback,
|
||||
void *data);
|
||||
|
||||
extern _X_EXPORT Bool DeleteCallback(CallbackListPtr *pcbl,
|
||||
CallbackProcPtr callback,
|
||||
void *data);
|
||||
|
||||
extern _X_EXPORT void _CallCallbacks(CallbackListPtr *pcbl,
|
||||
void *call_data);
|
||||
|
||||
static inline void
|
||||
CallCallbacks(CallbackListPtr *pcbl, void *call_data)
|
||||
{
|
||||
if (!pcbl || !*pcbl)
|
||||
return;
|
||||
_CallCallbacks(pcbl, call_data);
|
||||
}
|
||||
|
||||
#endif /* CALLBACK_H */
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 CMAP_H
|
||||
#define CMAP_H 1
|
||||
|
||||
#include <X11/Xproto.h>
|
||||
#include "screenint.h"
|
||||
#include "window.h"
|
||||
|
||||
#define DynamicClass 1
|
||||
|
||||
typedef CARD32 Pixel;
|
||||
|
||||
#endif /* CMAP_H */
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 CMAPSTRUCT_H
|
||||
#define CMAPSTRUCT_H 1
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
|
||||
/* LOCO -- a local color for a PseudoColor cell. DirectColor maps always
|
||||
* use the first value (called red) in the structure. What channel they
|
||||
* are really talking about depends on which map they are in. */
|
||||
typedef struct {
|
||||
unsigned short red, green, blue;
|
||||
} LOCO;
|
||||
|
||||
#endif /* COLORMAP_H */
|
||||
@@ -0,0 +1,724 @@
|
||||
/*
|
||||
* Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
|
||||
*
|
||||
* 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 Thomas Roell not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Thomas Roell makes no representations
|
||||
* about the suitability of this software for any purpose. It is provided
|
||||
* "as is" without express or implied warranty.
|
||||
*
|
||||
* THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THOMAS ROELL 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 (c) 1994-2003 by The XFree86 Project, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
|
||||
* and author(s) 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 copyright holder(s) and author(s).
|
||||
*/
|
||||
|
||||
#ifndef _COMPILER_H
|
||||
#define _COMPILER_H
|
||||
|
||||
#ifndef _X_EXPORT
|
||||
#include <X11/Xfuncproto.h>
|
||||
#endif
|
||||
|
||||
#include "xlibre_membarrier.h" /* backwards compat, remove in ABI-26 */
|
||||
|
||||
#if defined(__alpha__)
|
||||
|
||||
# if defined(__linux__)
|
||||
/* for Linux on Alpha, we use the LIBC _inx/_outx routines */
|
||||
/* note that the appropriate setup via "ioperm" needs to be done */
|
||||
/* *before* any inx/outx is done. */
|
||||
|
||||
_X_EXPORT void _outb(unsigned char val, unsigned long port);
|
||||
_X_EXPORT void _outw(unsigned short val, unsigned long port);
|
||||
_X_EXPORT void _outl(unsigned int val, unsigned long port);
|
||||
_X_EXPORT unsigned int _inb(unsigned long port);
|
||||
_X_EXPORT unsigned int _inw(unsigned long port);
|
||||
_X_EXPORT unsigned int _inl(unsigned long port);
|
||||
|
||||
static inline void
|
||||
outb(unsigned long port, unsigned char val)
|
||||
{
|
||||
_outb(val, port);
|
||||
}
|
||||
|
||||
static inline void
|
||||
outw(unsigned long port, unsigned short val)
|
||||
{
|
||||
_outw(val, port);
|
||||
}
|
||||
|
||||
static inline void
|
||||
outl(unsigned long port, unsigned int val)
|
||||
{
|
||||
_outl(val, port);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inb(unsigned long port)
|
||||
{
|
||||
return _inb(port);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inw(unsigned long port)
|
||||
{
|
||||
return _inw(port);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inl(unsigned long port)
|
||||
{
|
||||
return _inl(port);
|
||||
}
|
||||
|
||||
# elif (defined(__FreeBSD__) || defined(__OpenBSD__))
|
||||
|
||||
/* for FreeBSD and OpenBSD on Alpha, we use the libio (resp. libalpha) */
|
||||
/* inx/outx routines */
|
||||
/* note that the appropriate setup via "ioperm" needs to be done */
|
||||
/* *before* any inx/outx is done. */
|
||||
|
||||
_X_EXPORT void outb(unsigned int port, unsigned char val);
|
||||
_X_EXPORT void outw(unsigned int port, unsigned short val);
|
||||
_X_EXPORT void outl(unsigned int port, unsigned int val);
|
||||
_X_EXPORT unsigned char inb(unsigned int port);
|
||||
_X_EXPORT unsigned short inw(unsigned int port);
|
||||
_X_EXPORT unsigned int inl(unsigned int port);
|
||||
|
||||
# elif defined(__NetBSD__)
|
||||
|
||||
# include <machine/pio.h>
|
||||
|
||||
# endif /* various OS'es on __alpha__ */
|
||||
|
||||
static inline int MMIO_IN8(void *Base, unsigned long Offset) {
|
||||
xlibre_mem_barrier_read();
|
||||
return *(CARD8 *) ((unsigned long) Base + (Offset));
|
||||
}
|
||||
|
||||
static inline int MMIO_IN16(void *Base, unsigned long Offset) {
|
||||
xlibre_mem_barrier_read();
|
||||
return *(CARD16 *) ((unsigned long) Base + (Offset));
|
||||
}
|
||||
|
||||
static inline int MMIO_IN32(void *Base, unsigned long Offset) {
|
||||
xlibre_mem_barrier_read();
|
||||
return *(CARD32 *) ((unsigned long) Base + (Offset));
|
||||
}
|
||||
|
||||
static inline void MMIO_OUT8(void *Base, unsigned long Offset, int Value) {
|
||||
xlibre_mem_barrier_write();
|
||||
*(CARD8 *) ((unsigned long) Base + (Offset)) = Value;
|
||||
}
|
||||
|
||||
static inline void MMIO_OUT16(void *Base, unsigned long Offset, int Value) {
|
||||
xlibre_mem_barrier_write();
|
||||
*(CARD16 *) ((unsigned long) Base + (Offset)) = Value;
|
||||
}
|
||||
|
||||
static inline void MMIO_OUT32(void *Base, unsigned long Offset, int Value) {
|
||||
xlibre_mem_barrier_write();
|
||||
*(CARD32 *) ((unsigned long) Base + (Offset)) = Value;
|
||||
}
|
||||
|
||||
_X_EXPORT void xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count);
|
||||
_X_EXPORT void xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count);
|
||||
|
||||
static inline void slowbcopy_tobus(unsigned char *src, unsigned char *dst, int count) {
|
||||
xf86SlowBCopyToBus(src, dst, count);
|
||||
}
|
||||
|
||||
static inline void slowbcopy_frombus(unsigned char *src, unsigned char *dst, int count) {
|
||||
xf86SlowBCopyFromBus(src, dst, count);
|
||||
}
|
||||
|
||||
#elif defined(__amd64__) || defined(__i386__) || defined(__ia64__)
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
static inline void
|
||||
outb(unsigned short port, unsigned char val)
|
||||
{
|
||||
__asm__ __volatile__("outb %0,%1"::"a"(val), "d"(port));
|
||||
}
|
||||
|
||||
static inline void
|
||||
outw(unsigned short port, unsigned short val)
|
||||
{
|
||||
__asm__ __volatile__("outw %0,%1"::"a"(val), "d"(port));
|
||||
}
|
||||
|
||||
static inline void
|
||||
outl(unsigned short port, unsigned int val)
|
||||
{
|
||||
__asm__ __volatile__("outl %0,%1"::"a"(val), "d"(port));
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inb(unsigned short port)
|
||||
{
|
||||
unsigned char ret;
|
||||
__asm__ __volatile__("inb %1,%0":"=a"(ret):"d"(port));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inw(unsigned short port)
|
||||
{
|
||||
unsigned short ret;
|
||||
__asm__ __volatile__("inw %1,%0":"=a"(ret):"d"(port));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inl(unsigned short port)
|
||||
{
|
||||
unsigned int ret;
|
||||
__asm__ __volatile__("inl %1,%0":"=a"(ret):"d"(port));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#elif defined(__sparc__)
|
||||
|
||||
#define __XLIBRE_SPARC_ASI_PRIMAY_LE 0x88 /* just for readability */
|
||||
|
||||
static inline void
|
||||
outb(unsigned long port, unsigned char val)
|
||||
{
|
||||
__asm__ __volatile__("stba %0, [%1] %2": /* No outputs */
|
||||
:"r"(val), "r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
__asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
|
||||
}
|
||||
|
||||
static inline void
|
||||
outw(unsigned long port, unsigned short val)
|
||||
{
|
||||
__asm__ __volatile__("stha %0, [%1] %2": /* No outputs */
|
||||
:"r"(val), "r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
__asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
|
||||
}
|
||||
|
||||
static inline void
|
||||
outl(unsigned long port, unsigned int val)
|
||||
{
|
||||
__asm__ __volatile__("sta %0, [%1] %2": /* No outputs */
|
||||
:"r"(val), "r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
__asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inb(unsigned long port)
|
||||
{
|
||||
unsigned int ret;
|
||||
__asm__ __volatile__("lduba [%1] %2, %0":"=r"(ret)
|
||||
:"r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inw(unsigned long port)
|
||||
{
|
||||
unsigned int ret;
|
||||
__asm__ __volatile__("lduha [%1] %2, %0":"=r"(ret)
|
||||
:"r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inl(unsigned long port)
|
||||
{
|
||||
unsigned int ret;
|
||||
__asm__ __volatile__("lda [%1] %2, %0":"=r"(ret)
|
||||
:"r"(port), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned char
|
||||
xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
unsigned char ret;
|
||||
|
||||
__asm__ __volatile__("lduba [%1] %2, %0":"=r"(ret)
|
||||
:"r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned short
|
||||
xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
unsigned short ret;
|
||||
|
||||
__asm__ __volatile__("lduh [%1], %0":"=r"(ret)
|
||||
:"r"(addr));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned short
|
||||
xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
unsigned short ret;
|
||||
|
||||
__asm__ __volatile__("lduha [%1] %2, %0":"=r"(ret)
|
||||
:"r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
unsigned int ret;
|
||||
|
||||
__asm__ __volatile__("ld [%1], %0":"=r"(ret)
|
||||
:"r"(addr));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
unsigned int ret;
|
||||
|
||||
__asm__ __volatile__("lda [%1] %2, %0":"=r"(ret)
|
||||
:"r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned int val)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
|
||||
__asm__ __volatile__("stba %0, [%1] %2": /* No outputs */
|
||||
:"r"(val), "r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
__asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned int val)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
|
||||
__asm__ __volatile__("sth %0, [%1]": /* No outputs */
|
||||
:"r"(val), "r"(addr));
|
||||
__asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned int val)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
|
||||
__asm__ __volatile__("stha %0, [%1] %2": /* No outputs */
|
||||
:"r"(val), "r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
__asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned int val)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
|
||||
__asm__ __volatile__("st %0, [%1]": /* No outputs */
|
||||
:"r"(val), "r"(addr));
|
||||
__asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned int val)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
|
||||
__asm__ __volatile__("sta %0, [%1] %2": /* No outputs */
|
||||
:"r"(val), "r"(addr), "i"(__XLIBRE_SPARC_ASI_PRIMAY_LE));
|
||||
__asm__ __volatile__ (".word 0x8143e00a" : : : "memory");
|
||||
}
|
||||
|
||||
#undef __XLIBRE_SPARC_ASI_PRIMAY_LE
|
||||
|
||||
#elif defined(__arm32__) && !defined(__linux__)
|
||||
|
||||
extern _X_EXPORT unsigned int IOPortBase; /* Memory mapped I/O port area */
|
||||
|
||||
static inline void
|
||||
outb(unsigned long port, unsigned char val)
|
||||
{
|
||||
*(volatile unsigned char *) (((unsigned long) (port)) + IOPortBase) =
|
||||
val;
|
||||
}
|
||||
|
||||
static inline void
|
||||
outw(unsigned long port, unsigned short val)
|
||||
{
|
||||
*(volatile unsigned short *) (((unsigned long) (port)) + IOPortBase) =
|
||||
val;
|
||||
}
|
||||
|
||||
static inline void
|
||||
outl(unsigned long port, unsigned int val)
|
||||
{
|
||||
*(volatile unsigned int *) (((unsigned long) (port)) + IOPortBase) =
|
||||
val;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inb(unsigned long port)
|
||||
{
|
||||
return *(volatile unsigned char *) (((unsigned long) (port)) +
|
||||
IOPortBase);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inw(unsigned long port)
|
||||
{
|
||||
return *(volatile unsigned short *) (((unsigned long) (port)) +
|
||||
IOPortBase);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inl(unsigned long port)
|
||||
{
|
||||
return *(volatile unsigned int *) (((unsigned long) (port)) +
|
||||
IOPortBase);
|
||||
}
|
||||
|
||||
#elif defined(__mips__)
|
||||
|
||||
# if defined(__mips64)
|
||||
# define __XLIBRE_MIPS_PORT_TYPE unsigned long
|
||||
# define __XLIBRE_MIPS_PORT_ADDR(port) (((unsigned long)(port)) + IOPortBase)
|
||||
# else
|
||||
# define __XLIBRE_MIPS_PORT_TYPE unsigned short
|
||||
# define __XLIBRE_MIPS_PORT_ADDR(port) (((unsigned short)(port)) + IOPortBase)
|
||||
# endif
|
||||
|
||||
extern _X_EXPORT unsigned int IOPortBase; /* Memory mapped I/O port area */
|
||||
|
||||
static inline void outb(__XLIBRE_MIPS_PORT_TYPE port, unsigned char val) {
|
||||
*(volatile unsigned char *)(__XLIBRE_MIPS_PORT_ADDR(port)) = val;
|
||||
}
|
||||
|
||||
static inline void outw(__XLIBRE_MIPS_PORT_TYPE port, unsigned short val) {
|
||||
*(volatile unsigned short *)(__XLIBRE_MIPS_PORT_ADDR(port)) = val;
|
||||
}
|
||||
|
||||
static inline void outl(__XLIBRE_MIPS_PORT_TYPE port, unsigned int val) {
|
||||
*(volatile unsigned int *)(__XLIBRE_MIPS_PORT_ADDR(port)) = val;
|
||||
}
|
||||
|
||||
static inline unsigned int inb(__XLIBRE_MIPS_PORT_TYPE port) {
|
||||
return *(volatile unsigned char *)(__XLIBRE_MIPS_PORT_ADDR(port));
|
||||
}
|
||||
|
||||
static inline unsigned int inw(__XLIBRE_MIPS_PORT_TYPE port) {
|
||||
return *(volatile unsigned short *)(__XLIBRE_MIPS_PORT_ADDR(port));
|
||||
}
|
||||
|
||||
static inline unsigned int inl(__XLIBRE_MIPS_PORT_TYPE port) {
|
||||
return *(volatile unsigned int *)(__XLIBRE_MIPS_PORT_ADDR(port));
|
||||
}
|
||||
|
||||
# undef __XLIBRE_MIPS_PORT_TYPE
|
||||
# undef __XLIBRE_MIPS_PORT_ADDR
|
||||
|
||||
# ifdef __linux__ /* don't mess with other OSs */
|
||||
# if X_BYTE_ORDER == X_BIG_ENDIAN
|
||||
static inline unsigned int
|
||||
xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
unsigned int ret;
|
||||
|
||||
__asm__ __volatile__("lw %0, 0(%1)":"=r"(ret)
|
||||
:"r"(addr));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned int val)
|
||||
{
|
||||
unsigned long addr = ((unsigned long) base) + offset;
|
||||
|
||||
__asm__ __volatile__("sw %0, 0(%1)": /* No outputs */
|
||||
:"r"(val), "r"(addr));
|
||||
}
|
||||
# endif /* X_BYTE_ORDER == X_BIG_ENDIAN */
|
||||
# endif /* __linux__ */
|
||||
|
||||
#elif defined(__powerpc__)
|
||||
|
||||
#include <sys/mman.h>
|
||||
|
||||
extern _X_EXPORT void *ioBase;
|
||||
|
||||
static inline unsigned char
|
||||
xf86ReadMmio8(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
register unsigned char val;
|
||||
__asm__ __volatile__("lbzx %0,%1,%2\n\t" "eieio":"=r"(val)
|
||||
:"b"(base), "r"(offset),
|
||||
"m"(*((volatile unsigned char *) base + offset)));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline unsigned short
|
||||
xf86ReadMmio16Be(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
register unsigned short val;
|
||||
__asm__ __volatile__("lhzx %0,%1,%2\n\t" "eieio":"=r"(val)
|
||||
:"b"(base), "r"(offset),
|
||||
"m"(*((volatile unsigned char *) base + offset)));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline unsigned short
|
||||
xf86ReadMmio16Le(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
register unsigned short val;
|
||||
__asm__ __volatile__("lhbrx %0,%1,%2\n\t" "eieio":"=r"(val)
|
||||
:"b"(base), "r"(offset),
|
||||
"m"(*((volatile unsigned char *) base + offset)));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
xf86ReadMmio32Be(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
register unsigned int val;
|
||||
__asm__ __volatile__("lwzx %0,%1,%2\n\t" "eieio":"=r"(val)
|
||||
:"b"(base), "r"(offset),
|
||||
"m"(*((volatile unsigned char *) base + offset)));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
xf86ReadMmio32Le(__volatile__ void *base, const unsigned long offset)
|
||||
{
|
||||
register unsigned int val;
|
||||
__asm__ __volatile__("lwbrx %0,%1,%2\n\t" "eieio":"=r"(val)
|
||||
:"b"(base), "r"(offset),
|
||||
"m"(*((volatile unsigned char *) base + offset)));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio8(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned char val)
|
||||
{
|
||||
__asm__
|
||||
__volatile__("stbx %1,%2,%3\n\t":"=m"
|
||||
(*((volatile unsigned char *) base + offset))
|
||||
:"r"(val), "b"(base), "r"(offset));
|
||||
xlibre_mem_barrier_write();
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio16Le(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned short val)
|
||||
{
|
||||
__asm__
|
||||
__volatile__("sthbrx %1,%2,%3\n\t":"=m"
|
||||
(*((volatile unsigned char *) base + offset))
|
||||
:"r"(val), "b"(base), "r"(offset));
|
||||
xlibre_mem_barrier_write();
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio16Be(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned short val)
|
||||
{
|
||||
__asm__
|
||||
__volatile__("sthx %1,%2,%3\n\t":"=m"
|
||||
(*((volatile unsigned char *) base + offset))
|
||||
:"r"(val), "b"(base), "r"(offset));
|
||||
xlibre_mem_barrier_write();
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned int val)
|
||||
{
|
||||
__asm__
|
||||
__volatile__("stwbrx %1,%2,%3\n\t":"=m"
|
||||
(*((volatile unsigned char *) base + offset))
|
||||
:"r"(val), "b"(base), "r"(offset));
|
||||
xlibre_mem_barrier_write();
|
||||
}
|
||||
|
||||
static inline void
|
||||
xf86WriteMmio32Be(__volatile__ void *base, const unsigned long offset,
|
||||
const unsigned int val)
|
||||
{
|
||||
__asm__
|
||||
__volatile__("stwx %1,%2,%3\n\t":"=m"
|
||||
(*((volatile unsigned char *) base + offset))
|
||||
:"r"(val), "b"(base), "r"(offset));
|
||||
xlibre_mem_barrier_write();
|
||||
}
|
||||
|
||||
static inline void
|
||||
outb(unsigned short port, unsigned char value)
|
||||
{
|
||||
if (ioBase == MAP_FAILED)
|
||||
return;
|
||||
xf86WriteMmio8(ioBase, port, value);
|
||||
}
|
||||
|
||||
static inline void
|
||||
outw(unsigned short port, unsigned short value)
|
||||
{
|
||||
if (ioBase == MAP_FAILED)
|
||||
return;
|
||||
xf86WriteMmio16Le(ioBase, port, value);
|
||||
}
|
||||
|
||||
static inline void
|
||||
outl(unsigned short port, unsigned int value)
|
||||
{
|
||||
if (ioBase == MAP_FAILED)
|
||||
return;
|
||||
xf86WriteMmio32Le(ioBase, port, value);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inb(unsigned short port)
|
||||
{
|
||||
if (ioBase == MAP_FAILED)
|
||||
return 0;
|
||||
return xf86ReadMmio8(ioBase, port);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inw(unsigned short port)
|
||||
{
|
||||
if (ioBase == MAP_FAILED)
|
||||
return 0;
|
||||
return xf86ReadMmio16Le(ioBase, port);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
inl(unsigned short port)
|
||||
{
|
||||
if (ioBase == MAP_FAILED)
|
||||
return 0;
|
||||
return xf86ReadMmio32Le(ioBase, port);
|
||||
}
|
||||
|
||||
#endif /* arch madness */
|
||||
|
||||
/* drivers that want to prevent automatic byteswapping by MMIO_()* macros
|
||||
on PPC and SPARC should set these */
|
||||
#if !defined(MMIO_IS_BE) && \
|
||||
(defined(SPARC_MMIO_IS_BE) || defined(PPC_MMIO_IS_BE))
|
||||
#define MMIO_IS_BE
|
||||
#endif
|
||||
|
||||
#ifdef __alpha__
|
||||
#elif defined(__powerpc__) || defined(__sparc__)
|
||||
/*
|
||||
* we provide byteswapping and no byteswapping functions here
|
||||
* with byteswapping as default,
|
||||
* drivers that don't need byteswapping should define MMIO_IS_BE
|
||||
*/
|
||||
#define MMIO_IN8(base, offset) xf86ReadMmio8((base), (offset))
|
||||
#define MMIO_OUT8(base, offset, val) \
|
||||
xf86WriteMmio8((base), (offset), (CARD8)(val))
|
||||
|
||||
#if defined(MMIO_IS_BE) /* No byteswapping */
|
||||
#define MMIO_IN16(base, offset) xf86ReadMmio16Be((base), (offset))
|
||||
#define MMIO_IN32(base, offset) xf86ReadMmio32Be((base), (offset))
|
||||
#define MMIO_OUT16(base, offset, val) \
|
||||
xf86WriteMmio16Be((base), (offset), (CARD16)(val))
|
||||
#define MMIO_OUT32(base, offset, val) \
|
||||
xf86WriteMmio32Be((base), (offset), (CARD32)(val))
|
||||
#else /* byteswapping is the default */
|
||||
#define MMIO_IN16(base, offset) xf86ReadMmio16Le((base), (offset))
|
||||
#define MMIO_IN32(base, offset) xf86ReadMmio32Le((base), (offset))
|
||||
#define MMIO_OUT16(base, offset, val) \
|
||||
xf86WriteMmio16Le((base), (offset), (CARD16)(val))
|
||||
#define MMIO_OUT32(base, offset, val) \
|
||||
xf86WriteMmio32Le((base), (offset), (CARD32)(val))
|
||||
#endif
|
||||
|
||||
#else /* !__alpha__ && !__powerpc__ && !__sparc__ */
|
||||
|
||||
#define MMIO_IN8(base, offset) \
|
||||
*(volatile CARD8 *)(((CARD8*)(base)) + (offset))
|
||||
#define MMIO_IN16(base, offset) \
|
||||
*(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset))
|
||||
#define MMIO_IN32(base, offset) \
|
||||
*(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset))
|
||||
#define MMIO_OUT8(base, offset, val) \
|
||||
*(volatile CARD8 *)(((CARD8*)(base)) + (offset)) = (val)
|
||||
#define MMIO_OUT16(base, offset, val) \
|
||||
*(volatile CARD16 *)(void *)(((CARD8*)(base)) + (offset)) = (val)
|
||||
#define MMIO_OUT32(base, offset, val) \
|
||||
*(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val)
|
||||
|
||||
#endif /* __alpha__ */
|
||||
|
||||
/*
|
||||
* With Intel, the version in os-support/misc/SlowBcopy.s is used.
|
||||
* This avoids port I/O during the copy (which causes problems with
|
||||
* some hardware).
|
||||
*/
|
||||
#ifndef __alpha__
|
||||
#define slowbcopy_tobus(src,dst,count) xf86SlowBcopy((src),(dst),(count))
|
||||
#define slowbcopy_frombus(src,dst,count) xf86SlowBcopy((src),(dst),(count))
|
||||
#endif /* __alpha__ */
|
||||
|
||||
#endif /* _COMPILER_H */
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright © 2009 NVIDIA Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
#ifndef _COMPOSITEEXT_H_
|
||||
#define _COMPOSITEEXT_H_
|
||||
|
||||
#include "misc.h"
|
||||
#include "scrnintstr.h"
|
||||
|
||||
extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen,
|
||||
VisualID * vids,
|
||||
int nVisuals);
|
||||
|
||||
extern _X_EXPORT Bool compIsAlternateVisual(ScreenPtr pScreen, XID visual);
|
||||
|
||||
extern _X_EXPORT RESTYPE CompositeClientWindowType;
|
||||
|
||||
#endif /* _COMPOSITEEXT_H_ */
|
||||
@@ -0,0 +1,71 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 CURSOR_H
|
||||
#define CURSOR_H
|
||||
|
||||
#include "misc.h"
|
||||
#include "screenint.h"
|
||||
#include "window.h"
|
||||
#include "privates.h"
|
||||
|
||||
#define NullCursor ((CursorPtr)NULL)
|
||||
|
||||
/* Provide support for alpha composited cursors */
|
||||
#define ARGB_CURSOR
|
||||
|
||||
typedef struct _Cursor *CursorPtr;
|
||||
// FUN FACT: If you typedef a pointer type, like the `CursorPtr` above
|
||||
// then `const CursorPtr` or `CursorPtr const` actually means `struct _Cursor *const`, a constant pointer
|
||||
// which is probably not what you want(a pointer to constant).
|
||||
// Maybe better just keep the `*` around, or you have to typedef a separate constPtr type.
|
||||
typedef struct _Cursor const *ConstCursorPtr;
|
||||
typedef struct _CursorMetric *CursorMetricPtr;
|
||||
|
||||
extern _X_EXPORT int FreeCursor(void *pCurs,
|
||||
XID cid);
|
||||
|
||||
#endif /* CURSOR_H */
|
||||
@@ -0,0 +1,90 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 CURSORSTRUCT_H
|
||||
#define CURSORSTRUCT_H
|
||||
|
||||
#include "cursor.h"
|
||||
#include "privates.h"
|
||||
/*
|
||||
* device-independent cursor storage
|
||||
*/
|
||||
|
||||
/*
|
||||
* source and mask point directly to the bits, which are in the server-defined
|
||||
* bitmap format.
|
||||
*/
|
||||
typedef struct _CursorBits {
|
||||
unsigned char *source; /* points to bits */
|
||||
unsigned char *mask; /* points to bits */
|
||||
Bool emptyMask; /* all zeros mask */
|
||||
unsigned short width, height, xhot, yhot; /* metrics */
|
||||
int refcnt; /* can be shared */
|
||||
PrivateRec *devPrivates; /* set by pScr->RealizeCursor */
|
||||
CARD32 *argb; /* full-color alpha blended */
|
||||
} CursorBits, *CursorBitsPtr;
|
||||
|
||||
typedef struct _Cursor {
|
||||
CursorBitsPtr bits;
|
||||
unsigned short foreRed, foreGreen, foreBlue; /* device-independent color */
|
||||
unsigned short backRed, backGreen, backBlue; /* device-independent color */
|
||||
int refcnt;
|
||||
PrivateRec *devPrivates; /* set by pScr->RealizeCursor */
|
||||
XID id;
|
||||
CARD32 serialNumber;
|
||||
Atom name;
|
||||
} CursorRec;
|
||||
|
||||
typedef struct _CursorMetric {
|
||||
unsigned short width, height, xhot, yhot;
|
||||
} CursorMetricRec;
|
||||
|
||||
typedef struct {
|
||||
int x, y;
|
||||
ScreenPtr pScreen;
|
||||
} HotSpot;
|
||||
|
||||
#endif /* CURSORSTRUCT_H */
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright © 2003 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.
|
||||
*/
|
||||
#ifndef _DAMAGE_H_
|
||||
#define _DAMAGE_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
typedef struct _damage *DamagePtr;
|
||||
|
||||
typedef enum _damageReportLevel {
|
||||
DamageReportRawRegion,
|
||||
DamageReportDeltaRegion,
|
||||
DamageReportBoundingBox,
|
||||
DamageReportNonEmpty,
|
||||
DamageReportNone
|
||||
} DamageReportLevel;
|
||||
|
||||
typedef void (*DamageReportFunc) (DamagePtr pDamage, RegionPtr pRegion,
|
||||
void *closure);
|
||||
typedef void (*DamageDestroyFunc) (DamagePtr pDamage, void *closure);
|
||||
|
||||
typedef void (*DamageScreenCreateFunc) (DamagePtr);
|
||||
typedef void (*DamageScreenRegisterFunc) (DrawablePtr, DamagePtr);
|
||||
typedef void (*DamageScreenUnregisterFunc) (DrawablePtr, DamagePtr);
|
||||
typedef void (*DamageScreenDestroyFunc) (DamagePtr);
|
||||
|
||||
/* @public
|
||||
*
|
||||
* @brief Driver callbacks for getting notified on several damage calls
|
||||
*
|
||||
* The pointer to this struct can be obtained via DamageGetScreenFuncs().
|
||||
* Drivers can inject themselves here, in order to get notified on
|
||||
* DamageCreate(), DamageRegister(), DamageUnregister(), DamageDestroy().
|
||||
*
|
||||
* The fields may be assigned to NULL, if no action at all is wanted.
|
||||
* (by default assigned to default implementations)
|
||||
*
|
||||
* This should ONLY be touched by video drivers, nobody else.
|
||||
*
|
||||
* So far the only one using it is the proprietary NVidia driver.
|
||||
*/
|
||||
typedef struct _damageScreenFuncs {
|
||||
DamageScreenCreateFunc Create;
|
||||
DamageScreenRegisterFunc Register;
|
||||
DamageScreenUnregisterFunc Unregister;
|
||||
DamageScreenDestroyFunc Destroy;
|
||||
} DamageScreenFuncsRec, *DamageScreenFuncsPtr;
|
||||
|
||||
extern _X_EXPORT void miDamageCreate(DamagePtr);
|
||||
extern _X_EXPORT void miDamageRegister(DrawablePtr, DamagePtr);
|
||||
extern _X_EXPORT void miDamageUnregister(DrawablePtr, DamagePtr);
|
||||
extern _X_EXPORT void miDamageDestroy(DamagePtr);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
DamageSetup(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT DamagePtr
|
||||
DamageCreate(DamageReportFunc damageReport,
|
||||
DamageDestroyFunc damageDestroy,
|
||||
DamageReportLevel damageLevel,
|
||||
Bool isInternal, ScreenPtr pScreen, void *closure);
|
||||
|
||||
extern _X_EXPORT void
|
||||
DamageDrawInternal(ScreenPtr pScreen, Bool enable);
|
||||
|
||||
extern _X_EXPORT void
|
||||
DamageRegister(DrawablePtr pDrawable, DamagePtr pDamage);
|
||||
|
||||
extern _X_EXPORT void
|
||||
DamageUnregister(DamagePtr pDamage);
|
||||
|
||||
extern _X_EXPORT void
|
||||
DamageDestroy(DamagePtr pDamage);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
DamageSubtract(DamagePtr pDamage, const RegionPtr pRegion);
|
||||
|
||||
extern _X_EXPORT void
|
||||
DamageEmpty(DamagePtr pDamage);
|
||||
|
||||
extern _X_EXPORT RegionPtr
|
||||
DamageRegion(DamagePtr pDamage);
|
||||
|
||||
extern _X_EXPORT RegionPtr
|
||||
DamagePendingRegion(DamagePtr pDamage);
|
||||
|
||||
/* In case of rendering, call this before the submitting the commands. */
|
||||
extern _X_EXPORT void
|
||||
DamageRegionAppend(DrawablePtr pDrawable, RegionPtr pRegion);
|
||||
|
||||
/* Call this directly after the rendering operation has been submitted. */
|
||||
extern _X_EXPORT void
|
||||
DamageRegionProcessPending(DrawablePtr pDrawable);
|
||||
|
||||
/* Call this when you create a new Damage and you wish to send an initial damage message (to it). */
|
||||
extern _X_EXPORT void
|
||||
DamageReportDamage(DamagePtr pDamage, RegionPtr pDamageRegion);
|
||||
|
||||
/* Avoid using this call, it only exists for API compatibility. */
|
||||
extern _X_EXPORT void
|
||||
DamageDamageRegion(DrawablePtr pDrawable, const RegionPtr pRegion);
|
||||
|
||||
extern _X_EXPORT void
|
||||
DamageSetReportAfterOp(DamagePtr pDamage, Bool reportAfter);
|
||||
|
||||
extern _X_EXPORT DamageScreenFuncsPtr DamageGetScreenFuncs(ScreenPtr);
|
||||
|
||||
#endif /* _DAMAGE_H_ */
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright © 2003 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.
|
||||
*/
|
||||
#ifndef _DAMAGESTR_H_
|
||||
#define _DAMAGESTR_H_
|
||||
|
||||
#include "damage.h"
|
||||
#include "gcstruct.h"
|
||||
#include "privates.h"
|
||||
#include "picturestr.h"
|
||||
|
||||
typedef struct _damage {
|
||||
DamagePtr pNext;
|
||||
DamagePtr pNextWin;
|
||||
/*
|
||||
* Drawable on which this damage was inserted. Used to re-derive the list head at removal time
|
||||
* to avoid caching a pointer into a realloc()able privates array.
|
||||
*/
|
||||
DrawablePtr pListDrawable;
|
||||
RegionRec damage;
|
||||
|
||||
DamageReportLevel damageLevel;
|
||||
Bool isInternal;
|
||||
void *closure;
|
||||
Bool isWindow;
|
||||
DrawablePtr pDrawable;
|
||||
|
||||
DamageReportFunc damageReport;
|
||||
DamageDestroyFunc damageDestroy;
|
||||
|
||||
Bool reportAfter;
|
||||
RegionRec pendingDamage; /* will be flushed post submission at the latest */
|
||||
ScreenPtr pScreen;
|
||||
} DamageRec;
|
||||
|
||||
typedef struct _damageScrPriv {
|
||||
int internalLevel;
|
||||
|
||||
/*
|
||||
* For DDXen which don't provide GetScreenPixmap, this provides
|
||||
* a place to hook damage for windows on the screen
|
||||
*/
|
||||
DamagePtr pScreenDamage;
|
||||
|
||||
CopyWindowProcPtr CopyWindow;
|
||||
void *_dummy1; // required in place of a removed field for ABI compatibility
|
||||
CreateGCProcPtr CreateGC;
|
||||
void *_dummy2; // required in place of a removed field for ABI compatibility
|
||||
SetWindowPixmapProcPtr SetWindowPixmap;
|
||||
void *_dummy3; // required in place of a removed field for ABI compatibility
|
||||
CompositeProcPtr Composite;
|
||||
GlyphsProcPtr Glyphs;
|
||||
AddTrapsProcPtr AddTraps;
|
||||
|
||||
/* Table of wrappable function pointers */
|
||||
DamageScreenFuncsRec funcs;
|
||||
} DamageScrPrivRec, *DamageScrPrivPtr;
|
||||
|
||||
typedef struct _damageGCPriv {
|
||||
const GCOps *ops;
|
||||
const GCFuncs *funcs;
|
||||
} DamageGCPrivRec, *DamageGCPrivPtr;
|
||||
|
||||
/* XXX should move these into damage.c, damageScrPrivateIndex is static */
|
||||
#define damageGetScrPriv(pScr) ((DamageScrPrivPtr) \
|
||||
dixLookupPrivate(&(pScr)->devPrivates, damageScrPrivateKey))
|
||||
|
||||
#define damageScrPriv(pScr) \
|
||||
DamageScrPrivPtr pScrPriv = damageGetScrPriv((pScr))
|
||||
|
||||
#define damageGetPixPriv(pPix) \
|
||||
dixLookupPrivate(&(pPix)->devPrivates, damagePixPrivateKey)
|
||||
|
||||
#define damgeSetPixPriv(pPix,v) \
|
||||
dixSetPrivate(&(pPix)->devPrivates, damagePixPrivateKey, (v))
|
||||
|
||||
#define damagePixPriv(pPix) \
|
||||
DamagePtr pDamage = damageGetPixPriv((pPix))
|
||||
|
||||
#define damageGetGCPriv(pGC) \
|
||||
dixLookupPrivate(&(pGC)->devPrivates, damageGCPrivateKey)
|
||||
|
||||
#define damageGCPriv(pGC) \
|
||||
DamageGCPrivPtr pGCPriv = damageGetGCPriv((pGC))
|
||||
|
||||
#define damageGetWinPriv(pWin) \
|
||||
((DamagePtr)dixLookupPrivate(&(pWin)->devPrivates, damageWinPrivateKey))
|
||||
|
||||
#define damageSetWinPriv(pWin,d) \
|
||||
dixSetPrivate(&(pWin)->devPrivates, damageWinPrivateKey, d)
|
||||
|
||||
#endif /* _DAMAGESTR_H_ */
|
||||
@@ -0,0 +1,99 @@
|
||||
#ifndef _DISMODEPROC_H_
|
||||
#define _DISMODEPROC_H_
|
||||
|
||||
#include "scrnintstr.h"
|
||||
|
||||
#define MAXCLOCKS 128
|
||||
|
||||
/* These are possible return values for xf86CheckMode() and ValidMode() */
|
||||
typedef enum {
|
||||
MODE_OK = 0, /* Mode OK */
|
||||
MODE_HSYNC, /* hsync out of range */
|
||||
MODE_VSYNC, /* vsync out of range */
|
||||
MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
|
||||
MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
|
||||
MODE_BAD_WIDTH, /* requires an unsupported linepitch */
|
||||
MODE_NOMODE, /* no mode with a matching name */
|
||||
MODE_NO_INTERLACE, /* interlaced mode not supported */
|
||||
MODE_NO_DBLESCAN, /* doublescan mode not supported */
|
||||
MODE_NO_VSCAN, /* multiscan mode not supported */
|
||||
MODE_MEM, /* insufficient video memory */
|
||||
MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
|
||||
MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
|
||||
MODE_MEM_VIRT, /* insufficient video memory given virtual size */
|
||||
MODE_NOCLOCK, /* no fixed clock available */
|
||||
MODE_CLOCK_HIGH, /* clock required is too high */
|
||||
MODE_CLOCK_LOW, /* clock required is too low */
|
||||
MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
|
||||
MODE_BAD_HVALUE, /* horizontal timing was out of range */
|
||||
MODE_BAD_VVALUE, /* vertical timing was out of range */
|
||||
MODE_BAD_VSCAN, /* VScan value out of range */
|
||||
MODE_HSYNC_NARROW, /* horizontal sync too narrow */
|
||||
MODE_HSYNC_WIDE, /* horizontal sync too wide */
|
||||
MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
|
||||
MODE_HBLANK_WIDE, /* horizontal blanking too wide */
|
||||
MODE_VSYNC_NARROW, /* vertical sync too narrow */
|
||||
MODE_VSYNC_WIDE, /* vertical sync too wide */
|
||||
MODE_VBLANK_NARROW, /* vertical blanking too narrow */
|
||||
MODE_VBLANK_WIDE, /* vertical blanking too wide */
|
||||
MODE_PANEL, /* exceeds panel dimensions */
|
||||
MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
|
||||
MODE_ONE_WIDTH, /* only one width is supported */
|
||||
MODE_ONE_HEIGHT, /* only one height is supported */
|
||||
MODE_ONE_SIZE, /* only one resolution is supported */
|
||||
MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
|
||||
MODE_BANDWIDTH, /* mode requires too much memory bandwidth */
|
||||
MODE_DUPLICATE, /* mode is duplicated */
|
||||
MODE_BAD = -2, /* unspecified reason */
|
||||
MODE_ERROR = -1 /* error condition */
|
||||
} ModeStatus;
|
||||
|
||||
/* Video mode */
|
||||
typedef struct _DisplayModeRec {
|
||||
struct _DisplayModeRec *prev;
|
||||
struct _DisplayModeRec *next;
|
||||
const char *name; /* identifier for the mode */
|
||||
ModeStatus status;
|
||||
int type;
|
||||
|
||||
/* These are the values that the user sees/provides */
|
||||
int Clock; /* pixel clock freq (kHz) */
|
||||
int HDisplay; /* horizontal timing */
|
||||
int HSyncStart;
|
||||
int HSyncEnd;
|
||||
int HTotal;
|
||||
int HSkew;
|
||||
int VDisplay; /* vertical timing */
|
||||
int VSyncStart;
|
||||
int VSyncEnd;
|
||||
int VTotal;
|
||||
int VScan;
|
||||
int Flags;
|
||||
|
||||
/* These are the values the hardware uses */
|
||||
int ClockIndex;
|
||||
int SynthClock; /* Actual clock freq to
|
||||
* be programmed (kHz) */
|
||||
int CrtcHDisplay;
|
||||
int CrtcHBlankStart;
|
||||
int CrtcHSyncStart;
|
||||
int CrtcHSyncEnd;
|
||||
int CrtcHBlankEnd;
|
||||
int CrtcHTotal;
|
||||
int CrtcHSkew;
|
||||
int CrtcVDisplay;
|
||||
int CrtcVBlankStart;
|
||||
int CrtcVSyncStart;
|
||||
int CrtcVSyncEnd;
|
||||
int CrtcVBlankEnd;
|
||||
int CrtcVTotal;
|
||||
Bool CrtcHAdjusted;
|
||||
Bool CrtcVAdjusted;
|
||||
int PrivSize;
|
||||
INT32 *Private;
|
||||
int PrivFlags;
|
||||
|
||||
float HSync, VRefresh;
|
||||
} DisplayModeRec, *DisplayModePtr;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,229 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 DIX_H
|
||||
#define DIX_H
|
||||
|
||||
#include <X11/extensions/XI.h>
|
||||
|
||||
#include "xlibre_ptrtypes.h"
|
||||
|
||||
#include "callback.h"
|
||||
#include "gc.h"
|
||||
#include "window.h"
|
||||
#include "input.h"
|
||||
#include "cursor.h"
|
||||
#include "events.h"
|
||||
|
||||
#define EARLIER -1
|
||||
#define SAMETIME 0
|
||||
#define LATER 1
|
||||
|
||||
#define REQUEST(type) \
|
||||
type * stuff = (type *)client->requestBuffer;
|
||||
|
||||
/* Some platforms provide ARRAY_SIZE from a system header (e.g. illumos/Solaris
|
||||
* <sys/sysmacros.h>); don't redefine it there (-Werror). */
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0]))
|
||||
#endif
|
||||
|
||||
#define REQUEST_SIZE_MATCH(req) \
|
||||
do { \
|
||||
if ((sizeof(req) >> 2) != client->req_len) \
|
||||
return(BadLength); \
|
||||
} while (0)
|
||||
|
||||
#define REQUEST_AT_LEAST_SIZE(req) \
|
||||
do { \
|
||||
if ((sizeof(req) >> 2) > client->req_len) \
|
||||
return(BadLength); \
|
||||
} while (0)
|
||||
|
||||
#define REQUEST_AT_LEAST_EXTRA_SIZE(req, extra) \
|
||||
do { \
|
||||
if (((sizeof(req) + ((uint64_t) (extra))) >> 2) > client->req_len) \
|
||||
return(BadLength); \
|
||||
} while (0)
|
||||
|
||||
#define REQUEST_FIXED_SIZE(req, n) \
|
||||
do { \
|
||||
if ((((sizeof(req)) >> 2) > client->req_len) || \
|
||||
(((n) >> 2) >= client->req_len) || \
|
||||
((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len)) \
|
||||
return(BadLength); \
|
||||
} while (0)
|
||||
|
||||
typedef struct _TimeStamp *TimeStampPtr;
|
||||
|
||||
extern _X_EXPORT ClientPtr clients[];
|
||||
extern _X_EXPORT ClientPtr serverClient;
|
||||
extern _X_EXPORT int currentMaxClients;
|
||||
|
||||
typedef struct _TimeStamp {
|
||||
CARD32 months; /* really ~49.7 days */
|
||||
CARD32 milliseconds;
|
||||
} TimeStamp;
|
||||
|
||||
/* dispatch.c */
|
||||
extern _X_EXPORT void UpdateCurrentTime(void);
|
||||
|
||||
extern _X_EXPORT void UpdateCurrentTimeIf(void);
|
||||
|
||||
/*
|
||||
* @brief dereference a pixmap and destroy it when not used anymore
|
||||
*
|
||||
* Despite the name, this function unref's the pixmap, and only destroys it when
|
||||
* the pixmap isn't used anymore. (perhaps it should be renamed to dixUnrefPixmap())
|
||||
*
|
||||
* Note: it's also used as resource destructor callback, hence that strange args.
|
||||
* (not actually finest art, but for now a good compromise, since it's already
|
||||
* existing and exported, thus can easily be used by drivers, w/o breaking compat)
|
||||
*
|
||||
* @param pPixmap pointer to pixmap (PixmapPtr) that should be unref'ed
|
||||
* @param unused ignored, only for matching the resource destructor prototype
|
||||
*/
|
||||
_X_EXPORT int dixDestroyPixmap(void *pPixmap, XID unused);
|
||||
|
||||
/* dixutils.c */
|
||||
|
||||
extern _X_EXPORT int dixLookupWindow(WindowPtr *result,
|
||||
XID id,
|
||||
ClientPtr client, Mask access_mode);
|
||||
|
||||
extern _X_EXPORT int dixLookupDrawable(DrawablePtr *result,
|
||||
XID id,
|
||||
ClientPtr client,
|
||||
Mask type_mask, Mask access_mode);
|
||||
|
||||
extern _X_EXPORT int dixLookupFontable(FontPtr *result,
|
||||
XID id,
|
||||
ClientPtr client, Mask access_mode);
|
||||
|
||||
extern _X_EXPORT void NoopDDA(void);
|
||||
|
||||
typedef void (*ServerBlockHandlerProcPtr) (void *blockData,
|
||||
void *timeout);
|
||||
|
||||
typedef void (*ServerWakeupHandlerProcPtr) (void *blockData,
|
||||
int result);
|
||||
|
||||
extern _X_EXPORT Bool RegisterBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
|
||||
ServerWakeupHandlerProcPtr wakeupHandler,
|
||||
void *blockData);
|
||||
|
||||
extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blockHandler,
|
||||
ServerWakeupHandlerProcPtr wakeupHandler,
|
||||
void *blockData);
|
||||
|
||||
extern _X_EXPORT Bool QueueWorkProc(Bool (*function)(ClientPtr clientUnused,
|
||||
void *closure),
|
||||
ClientPtr client,
|
||||
void *closure);
|
||||
|
||||
/* atom.c */
|
||||
|
||||
extern _X_EXPORT Atom MakeAtom(const char * /*string */ ,
|
||||
unsigned /*len */ ,
|
||||
Bool /*makeit */ );
|
||||
|
||||
extern _X_EXPORT Bool ValidAtom(Atom /*atom */ );
|
||||
|
||||
extern _X_EXPORT const char *NameForAtom(Atom /*atom */ );
|
||||
|
||||
/* events.c */
|
||||
|
||||
extern _X_EXPORT void
|
||||
WriteEventsToClient(ClientPtr /*pClient */ ,
|
||||
int /*count */ ,
|
||||
xEventPtr /*events */ );
|
||||
|
||||
/*
|
||||
* ServerGrabCallback stuff
|
||||
*/
|
||||
|
||||
extern _X_EXPORT CallbackListPtr ServerGrabCallback;
|
||||
|
||||
typedef enum { SERVER_GRABBED, SERVER_UNGRABBED,
|
||||
CLIENT_PERVIOUS, CLIENT_IMPERVIOUS
|
||||
} ServerGrabState;
|
||||
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
ServerGrabState grabstate;
|
||||
} ServerGrabInfoRec;
|
||||
|
||||
/*
|
||||
* EventCallback stuff
|
||||
*/
|
||||
|
||||
extern _X_EXPORT CallbackListPtr EventCallback;
|
||||
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
xEventPtr events;
|
||||
int count;
|
||||
} EventInfoRec;
|
||||
|
||||
typedef struct {
|
||||
InternalEvent *event;
|
||||
DeviceIntPtr device;
|
||||
} DeviceEventInfoRec;
|
||||
|
||||
extern _X_EXPORT void *lastGLContext;
|
||||
|
||||
/**
|
||||
* @brief get display string for given screen
|
||||
*
|
||||
* Entry point for drivers/modules that really need to know what
|
||||
* display ID we're running on (eg. xrdp).
|
||||
*
|
||||
* @param pScreen pointer to ScreenRec to query.
|
||||
* @return pointer to string, valid as long as the pScreen is, owned by DIX.
|
||||
*/
|
||||
_X_EXPORT const char *dixGetDisplayName(ScreenPtr *pScreen);
|
||||
|
||||
#endif /* DIX_H */
|
||||
@@ -0,0 +1,54 @@
|
||||
/***********************************************************
|
||||
|
||||
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.
|
||||
|
||||
******************************************************************/
|
||||
|
||||
#ifndef DIX_ACCESS_H
|
||||
#define DIX_ACCESS_H
|
||||
|
||||
/* These are the access modes that can be passed in the last parameter
|
||||
* to several of the dix lookup functions. They were originally part
|
||||
* of the Security extension, now used by XACE.
|
||||
*
|
||||
* You can or these values together to indicate multiple modes
|
||||
* simultaneously.
|
||||
*/
|
||||
|
||||
#define DixUnknownAccess 0 /* don't know intentions */
|
||||
#define DixReadAccess (1<<0) /* inspecting the object */
|
||||
#define DixWriteAccess (1<<1) /* changing the object */
|
||||
#define DixDestroyAccess (1<<2) /* destroying the object */
|
||||
#define DixCreateAccess (1<<3) /* creating the object */
|
||||
#define DixGetAttrAccess (1<<4) /* get object attributes */
|
||||
#define DixSetAttrAccess (1<<5) /* set object attributes */
|
||||
#define DixListPropAccess (1<<6) /* list properties of object */
|
||||
#define DixGetPropAccess (1<<7) /* get properties of object */
|
||||
#define DixSetPropAccess (1<<8) /* set properties of object */
|
||||
#define DixGetFocusAccess (1<<9) /* get focus of object */
|
||||
#define DixSetFocusAccess (1<<10) /* set focus of object */
|
||||
#define DixListAccess (1<<11) /* list objects */
|
||||
#define DixAddAccess (1<<12) /* add object */
|
||||
#define DixRemoveAccess (1<<13) /* remove object */
|
||||
#define DixHideAccess (1<<14) /* hide object */
|
||||
#define DixShowAccess (1<<15) /* show object */
|
||||
#define DixBlendAccess (1<<16) /* mix contents of objects */
|
||||
#define DixGrabAccess (1<<17) /* exclusive access to object */
|
||||
#define DixFreezeAccess (1<<18) /* freeze status of object */
|
||||
#define DixForceAccess (1<<19) /* force status of object */
|
||||
#define DixInstallAccess (1<<20) /* install object */
|
||||
#define DixUninstallAccess (1<<21) /* uninstall object */
|
||||
#define DixSendAccess (1<<22) /* send to object */
|
||||
#define DixReceiveAccess (1<<23) /* receive from object */
|
||||
#define DixUseAccess (1<<24) /* use object */
|
||||
#define DixManageAccess (1<<25) /* manage object */
|
||||
#define DixDebugAccess (1<<26) /* debug object */
|
||||
#define DixBellAccess (1<<27) /* audible sound */
|
||||
#define DixPostAccess (1<<28) /* post or follow-up call */
|
||||
|
||||
#endif /* DIX_ACCESS_H */
|
||||
@@ -0,0 +1,93 @@
|
||||
/***********************************************************
|
||||
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 DIXFONT_H
|
||||
#define DIXFONT_H 1
|
||||
|
||||
#include "xlibre_ptrtypes.h"
|
||||
|
||||
#include "dix.h"
|
||||
#include <X11/fonts/font.h>
|
||||
#include <X11/fonts/fontstruct.h>
|
||||
|
||||
extern _X_EXPORT Bool SetDefaultFont(const char * /*defaultfontname */ );
|
||||
|
||||
extern _X_EXPORT int OpenFont(ClientPtr /*client */ ,
|
||||
XID /*fid */ ,
|
||||
Mask /*flags */ ,
|
||||
unsigned /*lenfname */ ,
|
||||
const char * /*pfontname */ );
|
||||
|
||||
extern _X_EXPORT int CloseFont(void *pfont,
|
||||
XID fid);
|
||||
|
||||
extern _X_EXPORT int ListFonts(ClientPtr /*client */ ,
|
||||
unsigned char * /*pattern */ ,
|
||||
unsigned int /*length */ ,
|
||||
unsigned int /*max_names */ );
|
||||
|
||||
extern _X_EXPORT int PolyText(ClientPtr /*client */ ,
|
||||
DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
unsigned char * /*pElt */ ,
|
||||
unsigned char * /*endReq */ ,
|
||||
int /*xorg */ ,
|
||||
int /*yorg */ ,
|
||||
int /*reqType */ ,
|
||||
XID /*did */ );
|
||||
|
||||
extern _X_EXPORT int ImageText(ClientPtr /*client */ ,
|
||||
DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*nChars */ ,
|
||||
unsigned char * /*data */ ,
|
||||
int /*xorg */ ,
|
||||
int /*yorg */ ,
|
||||
int /*reqType */ ,
|
||||
XID /*did */ );
|
||||
|
||||
extern _X_EXPORT int SetFontPath(ClientPtr /*client */ ,
|
||||
int /*npaths */ ,
|
||||
unsigned char * /*paths */ );
|
||||
|
||||
extern _X_EXPORT int SetDefaultFontPath(const char * /*path */ );
|
||||
|
||||
extern _X_EXPORT void DeleteClientFontStuff(ClientPtr /*client */ );
|
||||
|
||||
/* Quartz support on Mac OS X pulls in the QuickDraw
|
||||
framework whose InitFonts function conflicts here. */
|
||||
#ifdef __APPLE__
|
||||
#define InitFonts Darwin_X_InitFonts
|
||||
#endif
|
||||
extern _X_EXPORT void InitFonts(void);
|
||||
|
||||
extern _X_EXPORT void FreeFonts(void);
|
||||
|
||||
extern _X_EXPORT void GetGlyphs(FontPtr /*font */ ,
|
||||
unsigned long /*count */ ,
|
||||
unsigned char * /*chars */ ,
|
||||
FontEncoding /*fontEncoding */ ,
|
||||
unsigned long * /*glyphcount */ ,
|
||||
CharInfoPtr * /*glyphs */ );
|
||||
|
||||
#endif /* DIXFONT_H */
|
||||
@@ -0,0 +1,70 @@
|
||||
/***********************************************************
|
||||
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 DIXFONTSTRUCT_H
|
||||
#define DIXFONTSTRUCT_H
|
||||
|
||||
#include "servermd.h"
|
||||
#include "dixfont.h"
|
||||
#include <X11/fonts/fontstruct.h>
|
||||
#include <X11/Xproto.h> /* for xQueryFontReply */
|
||||
|
||||
#define FONTCHARSET(font) (font)
|
||||
#define FONTMAXBOUNDS(font,field) (font)->info.maxbounds.field
|
||||
#define FONTMINBOUNDS(font,field) (font)->info.minbounds.field
|
||||
#define TERMINALFONT(font) (font)->info.terminalFont
|
||||
#define FONTASCENT(font) (font)->info.fontAscent
|
||||
#define FONTDESCENT(font) (font)->info.fontDescent
|
||||
#define FONTGLYPHS(font) 0
|
||||
#define FONTCONSTMETRICS(font) (font)->info.constantMetrics
|
||||
#define FONTCONSTWIDTH(font) (font)->info.constantWidth
|
||||
#define FONTALLEXIST(font) (font)->info.allExist
|
||||
#define FONTFIRSTCOL(font) (font)->info.firstCol
|
||||
#define FONTLASTCOL(font) (font)->info.lastCol
|
||||
#define FONTFIRSTROW(font) (font)->info.firstRow
|
||||
#define FONTLASTROW(font) (font)->info.lastRow
|
||||
#define FONTDEFAULTCH(font) (font)->info.defaultCh
|
||||
#define FONTINKMIN(font) (&((font)->info.ink_minbounds))
|
||||
#define FONTINKMAX(font) (&((font)->info.ink_maxbounds))
|
||||
#define FONTPROPS(font) (font)->info.props
|
||||
#define FONTGLYPHBITS(base,pci) ((unsigned char *) (pci)->bits)
|
||||
#define FONTINFONPROPS(font) (font)->info.nprops
|
||||
|
||||
/* some things haven't changed names, but we'll be careful anyway */
|
||||
|
||||
#define FONTREFCNT(font) (font)->refcnt
|
||||
|
||||
/*
|
||||
* for linear char sets
|
||||
*/
|
||||
#define N1dChars(pfont) (FONTLASTCOL((pfont)) - FONTFIRSTCOL((pfont)) + 1)
|
||||
|
||||
/*
|
||||
* for 2D char sets
|
||||
*/
|
||||
#define N2dChars(pfont) (N1dChars((pfont)) * \
|
||||
(FONTLASTROW((pfont)) - FONTFIRSTROW((pfont)) + 1))
|
||||
|
||||
#define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES((pci))+3) & ~0x3)
|
||||
|
||||
#endif /* DIXFONTSTRUCT_H */
|
||||
@@ -0,0 +1,123 @@
|
||||
/***********************************************************
|
||||
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 DIXSTRUCT_H
|
||||
#define DIXSTRUCT_H
|
||||
|
||||
#include <X11/Xmd.h>
|
||||
|
||||
#include "xlibre_ptrtypes.h"
|
||||
|
||||
#include "callback.h"
|
||||
#include "dix.h"
|
||||
#include "resource.h"
|
||||
#include "cursor.h"
|
||||
#include "gc.h"
|
||||
#include "pixmap.h"
|
||||
#include "privates.h"
|
||||
|
||||
/*
|
||||
* direct-mapped hash table, used by resource manager to store
|
||||
* translation from client ids to server addresses.
|
||||
*/
|
||||
|
||||
extern _X_EXPORT CallbackListPtr ClientStateCallback;
|
||||
|
||||
typedef struct {
|
||||
ClientPtr client;
|
||||
xConnSetupPrefix *prefix;
|
||||
xConnSetup *setup;
|
||||
} NewClientInfoRec;
|
||||
|
||||
typedef void (*ReplySwapPtr) (ClientPtr /* pClient */ ,
|
||||
int /* size */ ,
|
||||
void * /* pbuf */ );
|
||||
|
||||
typedef enum { ClientStateInitial,
|
||||
ClientStateRunning,
|
||||
ClientStateRetained,
|
||||
ClientStateGone
|
||||
} ClientState;
|
||||
|
||||
struct _Client {
|
||||
void *requestBuffer;
|
||||
void *osPrivate; /* for OS layer, including scheduler */
|
||||
struct xorg_list ready; /* List of clients ready to run */
|
||||
struct xorg_list output_pending; /* List of clients with output queued */
|
||||
Mask clientAsMask;
|
||||
unsigned short index;
|
||||
unsigned char majorOp, minorOp;
|
||||
unsigned int swapped:1;
|
||||
unsigned int local:1;
|
||||
unsigned int big_requests:1; /* supports large requests */
|
||||
unsigned int clientGone:1;
|
||||
unsigned int closeDownMode:2;
|
||||
unsigned int clientState:2;
|
||||
signed char smart_priority;
|
||||
short noClientException; /* this client died or needs to be killed */
|
||||
int priority;
|
||||
ReplySwapPtr pSwapReplyFunc;
|
||||
XID errorValue;
|
||||
int sequence;
|
||||
int ignoreCount; /* count for Attend/IgnoreClient */
|
||||
int __dummy0; /* used to be numSave */
|
||||
void *__dummy1; /* used to be saveSet */
|
||||
int (**requestVector) (ClientPtr /* pClient */ );
|
||||
CARD32 req_len; /* length of current request */
|
||||
unsigned int replyBytesRemaining;
|
||||
PrivateRec *devPrivates;
|
||||
unsigned short mapNotifyMask;
|
||||
unsigned short newKeyboardNotifyMask;
|
||||
unsigned char xkbClientFlags;
|
||||
KeyCode minKC, maxKC;
|
||||
|
||||
int smart_start_tick;
|
||||
int smart_stop_tick;
|
||||
|
||||
DeviceIntPtr clientPtr;
|
||||
struct _ClientId *clientIds;
|
||||
int req_fds;
|
||||
|
||||
/* driver should never ever touch anything beyond here */
|
||||
struct xorg_list saveSets;
|
||||
};
|
||||
|
||||
extern _X_EXPORT TimeStamp currentTime;
|
||||
|
||||
extern _X_EXPORT int
|
||||
CompareTimeStamps(TimeStamp /*a */ ,
|
||||
TimeStamp /*b */ );
|
||||
|
||||
extern _X_EXPORT TimeStamp
|
||||
ClientTimeToServerTime(CARD32 /*c */ );
|
||||
|
||||
/* proc vectors */
|
||||
|
||||
extern _X_EXPORT int (*ProcVector[256]) (ClientPtr /*client */ );
|
||||
|
||||
extern _X_EXPORT int (*SwappedProcVector[256]) (ClientPtr /*client */ );
|
||||
|
||||
/* fixme: still needed by (public) dix.h */
|
||||
extern ReplySwapPtr ReplySwapVector[256];
|
||||
|
||||
#endif /* DIXSTRUCT_H */
|
||||
@@ -0,0 +1,336 @@
|
||||
/**************************************************************************
|
||||
|
||||
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sub license, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the
|
||||
next paragraph) shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Jens Owen <jens@tungstengraphics.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DRI_H_
|
||||
#define _DRI_H_
|
||||
|
||||
#include <pciaccess.h>
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "xf86dri.h"
|
||||
|
||||
/* Prototypes for DRI functions */
|
||||
|
||||
typedef int DRISyncType;
|
||||
|
||||
#define DRI_NO_SYNC 0
|
||||
#define DRI_2D_SYNC 1
|
||||
#define DRI_3D_SYNC 2
|
||||
|
||||
typedef int DRIContextType;
|
||||
|
||||
typedef struct _DRIContextPrivRec DRIContextPrivRec, *DRIContextPrivPtr;
|
||||
|
||||
typedef enum _DRIContextFlags {
|
||||
DRI_CONTEXT_2DONLY = 0x01,
|
||||
DRI_CONTEXT_PRESERVED = 0x02,
|
||||
DRI_CONTEXT_RESERVED = 0x04 /* DRI Only -- no kernel equivalent */
|
||||
} DRIContextFlags;
|
||||
|
||||
#define DRI_NO_CONTEXT 0
|
||||
#define DRI_2D_CONTEXT 1
|
||||
#define DRI_3D_CONTEXT 2
|
||||
|
||||
typedef int DRISwapMethod;
|
||||
|
||||
#define DRI_HIDE_X_CONTEXT 0
|
||||
#define DRI_SERVER_SWAP 1
|
||||
#define DRI_KERNEL_SWAP 2
|
||||
|
||||
typedef int DRIWindowRequests;
|
||||
|
||||
#define DRI_NO_WINDOWS 0
|
||||
#define DRI_3D_WINDOWS_ONLY 1
|
||||
#define DRI_ALL_WINDOWS 2
|
||||
|
||||
typedef void (*ClipNotifyPtr) (WindowPtr, int, int);
|
||||
typedef void (*AdjustFramePtr) (ScrnInfoPtr pScrn, int x, int y);
|
||||
|
||||
/*
|
||||
* These functions can be wrapped by the DRI. Each of these have
|
||||
* generic default funcs (initialized in DRICreateInfoRec) and can be
|
||||
* overridden by the driver in its [driver]DRIScreenInit function.
|
||||
*/
|
||||
typedef struct {
|
||||
ScreenWakeupHandlerProcPtr WakeupHandler;
|
||||
ScreenBlockHandlerProcPtr BlockHandler;
|
||||
WindowExposuresProcPtr WindowExposures;
|
||||
CopyWindowProcPtr CopyWindow;
|
||||
ClipNotifyProcPtr ClipNotify;
|
||||
AdjustFramePtr AdjustFrame;
|
||||
} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
|
||||
|
||||
/*
|
||||
* Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned
|
||||
* by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also
|
||||
* being used to version the XFree86-DRI protocol. Bugs #3066 and #3163
|
||||
* showed that this was inadequate. The DRIInfoRec structure is now versioned
|
||||
* by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18.
|
||||
*
|
||||
* Revision history:
|
||||
* 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION.
|
||||
* 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION.
|
||||
* 5.0.0: frameBufferPhysicalAddress changed from CARD32 to pointer.
|
||||
*/
|
||||
|
||||
#define DRIINFO_MAJOR_VERSION 5
|
||||
#define DRIINFO_MINOR_VERSION 4
|
||||
#define DRIINFO_PATCH_VERSION 0
|
||||
|
||||
typedef unsigned long long (*DRITexOffsetStartProcPtr) (PixmapPtr pPix);
|
||||
typedef void (*DRITexOffsetFinishProcPtr) (PixmapPtr pPix);
|
||||
|
||||
typedef struct {
|
||||
/* driver call back functions
|
||||
*
|
||||
* New fields should be added at the end for backwards compatibility.
|
||||
* Bump the DRIINFO patch number to indicate bugfixes.
|
||||
* Bump the DRIINFO minor number to indicate new fields.
|
||||
* Bump the DRIINFO major number to indicate binary-incompatible changes.
|
||||
*/
|
||||
Bool (*CreateContext) (ScreenPtr pScreen,
|
||||
VisualPtr visual,
|
||||
drm_context_t hHWContext,
|
||||
void *pVisualConfigPriv, DRIContextType context);
|
||||
void (*DestroyContext) (ScreenPtr pScreen,
|
||||
drm_context_t hHWContext, DRIContextType context);
|
||||
void (*SwapContext) (ScreenPtr pScreen,
|
||||
DRISyncType syncType,
|
||||
DRIContextType readContextType,
|
||||
void *readContextStore,
|
||||
DRIContextType writeContextType,
|
||||
void *writeContextStore);
|
||||
void (*InitBuffers) (WindowPtr pWin, RegionPtr prgn, CARD32 indx);
|
||||
void (*MoveBuffers) (WindowPtr pWin, xPoint ptOldOrg, RegionPtr prgnSrc, CARD32 indx);
|
||||
void (*TransitionTo3d) (ScreenPtr pScreen);
|
||||
void (*TransitionTo2d) (ScreenPtr pScreen);
|
||||
|
||||
void (*SetDrawableIndex) (WindowPtr pWin, CARD32 indx);
|
||||
Bool (*OpenFullScreen) (ScreenPtr pScreen);
|
||||
Bool (*CloseFullScreen) (ScreenPtr pScreen);
|
||||
|
||||
/* wrapped functions */
|
||||
DRIWrappedFuncsRec wrap;
|
||||
|
||||
/* device info */
|
||||
char *drmDriverName;
|
||||
char *clientDriverName;
|
||||
char *busIdString;
|
||||
int ddxDriverMajorVersion;
|
||||
int ddxDriverMinorVersion;
|
||||
int ddxDriverPatchVersion;
|
||||
void *frameBufferPhysicalAddress;
|
||||
long frameBufferSize;
|
||||
long frameBufferStride;
|
||||
long SAREASize;
|
||||
int maxDrawableTableEntry;
|
||||
int ddxDrawableTableEntry;
|
||||
long contextSize;
|
||||
DRISwapMethod driverSwapMethod;
|
||||
DRIWindowRequests bufferRequests;
|
||||
int devPrivateSize;
|
||||
void *devPrivate;
|
||||
Bool createDummyCtx;
|
||||
Bool createDummyCtxPriv;
|
||||
|
||||
/* New with DRI version 4.1.0 */
|
||||
void (*TransitionSingleToMulti3D) (ScreenPtr pScreen);
|
||||
void (*TransitionMultiToSingle3D) (ScreenPtr pScreen);
|
||||
|
||||
/* New with DRI version 5.1.0 */
|
||||
void (*ClipNotify) (ScreenPtr pScreen, WindowPtr *ppWin, int num);
|
||||
|
||||
/* New with DRI version 5.2.0 */
|
||||
Bool allocSarea;
|
||||
Bool keepFDOpen;
|
||||
|
||||
/* New with DRI version 5.3.0 */
|
||||
DRITexOffsetStartProcPtr texOffsetStart;
|
||||
DRITexOffsetFinishProcPtr texOffsetFinish;
|
||||
|
||||
/* New with DRI version 5.4.0 */
|
||||
int dontMapFrameBuffer;
|
||||
drm_handle_t hFrameBuffer; /* Handle to framebuffer, either
|
||||
* mapped by DDX driver or DRI */
|
||||
|
||||
} DRIInfoRec, *DRIInfoPtr;
|
||||
|
||||
extern _X_EXPORT Bool DRIOpenDRMMaster(ScrnInfoPtr pScrn,
|
||||
unsigned long sAreaSize,
|
||||
const char *busID,
|
||||
const char *drmDriverName);
|
||||
|
||||
extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen,
|
||||
DRIInfoPtr pDRIInfo, int *pDRMFD);
|
||||
|
||||
extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT void DRIReset(void);
|
||||
|
||||
extern _X_EXPORT Bool DRIQueryDirectRenderingCapable(ScreenPtr pScreen,
|
||||
Bool *isCapable);
|
||||
|
||||
extern _X_EXPORT Bool DRIOpenConnection(ScreenPtr pScreen,
|
||||
drm_handle_t * hSAREA,
|
||||
char **busIdString);
|
||||
|
||||
extern _X_EXPORT Bool DRIAuthConnection(ScreenPtr pScreen, drm_magic_t magic);
|
||||
|
||||
extern _X_EXPORT Bool DRICloseConnection(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT Bool DRIGetClientDriverName(ScreenPtr pScreen,
|
||||
int *ddxDriverMajorVersion,
|
||||
int *ddxDriverMinorVersion,
|
||||
int *ddxDriverPatchVersion,
|
||||
char **clientDriverName);
|
||||
|
||||
extern _X_EXPORT Bool DRICreateContext(ScreenPtr pScreen,
|
||||
VisualPtr visual,
|
||||
XID context, drm_context_t * pHWContext);
|
||||
|
||||
extern _X_EXPORT Bool DRIDestroyContext(ScreenPtr pScreen, XID context);
|
||||
|
||||
extern _X_EXPORT Bool DRIContextPrivDelete(void *pResource, XID id);
|
||||
|
||||
extern _X_EXPORT Bool DRICreateDrawable(ScreenPtr pScreen,
|
||||
ClientPtr client,
|
||||
DrawablePtr pDrawable,
|
||||
drm_drawable_t * hHWDrawable);
|
||||
|
||||
extern _X_EXPORT Bool DRIDestroyDrawable(ScreenPtr pScreen,
|
||||
ClientPtr client,
|
||||
DrawablePtr pDrawable);
|
||||
|
||||
extern _X_EXPORT Bool DRIDrawablePrivDelete(void *pResource, XID id);
|
||||
|
||||
extern _X_EXPORT Bool DRIGetDrawableInfo(ScreenPtr pScreen,
|
||||
DrawablePtr pDrawable,
|
||||
unsigned int *indx,
|
||||
unsigned int *stamp,
|
||||
int *X,
|
||||
int *Y,
|
||||
int *W,
|
||||
int *H,
|
||||
int *numClipRects,
|
||||
drm_clip_rect_t ** pClipRects,
|
||||
int *backX,
|
||||
int *backY,
|
||||
int *numBackClipRects,
|
||||
drm_clip_rect_t ** pBackClipRects);
|
||||
|
||||
extern _X_EXPORT Bool DRIGetDeviceInfo(ScreenPtr pScreen,
|
||||
drm_handle_t * hFrameBuffer,
|
||||
int *fbOrigin,
|
||||
int *fbSize,
|
||||
int *fbStride,
|
||||
int *devPrivateSize, void **pDevPrivate);
|
||||
|
||||
extern _X_EXPORT DRIInfoPtr DRICreateInfoRec(void);
|
||||
|
||||
extern _X_EXPORT void DRIDestroyInfoRec(DRIInfoPtr DRIInfo);
|
||||
|
||||
extern _X_EXPORT Bool DRIFinishScreenInit(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT void DRIWakeupHandler(void *wakeupData, int result);
|
||||
|
||||
extern _X_EXPORT void DRIBlockHandler(void *blockData, void *timeout);
|
||||
|
||||
extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, int result);
|
||||
|
||||
extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, void *timeout);
|
||||
|
||||
extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx);
|
||||
|
||||
extern _X_EXPORT void *DRIGetContextStore(DRIContextPrivPtr context);
|
||||
|
||||
extern _X_EXPORT void DRIWindowExposures(WindowPtr pWin, RegionPtr prgn);
|
||||
|
||||
extern _X_EXPORT void DRICopyWindow(WindowPtr pWin,
|
||||
xPoint ptOldOrg, RegionPtr prgnSrc);
|
||||
|
||||
extern _X_EXPORT void DRIClipNotify(WindowPtr pWin, int dx, int dy);
|
||||
|
||||
extern _X_EXPORT CARD32 DRIGetDrawableIndex(WindowPtr pWin);
|
||||
|
||||
extern _X_EXPORT void DRIPrintDrawableLock(ScreenPtr pScreen, char *msg);
|
||||
|
||||
extern _X_EXPORT void DRILock(ScreenPtr pScreen, int flags);
|
||||
|
||||
extern _X_EXPORT void DRIUnlock(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT DRIWrappedFuncsRec *DRIGetWrappedFuncs(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT void *DRIGetSAREAPrivate(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT unsigned int DRIGetDrawableStamp(ScreenPtr pScreen,
|
||||
CARD32 drawable_index);
|
||||
|
||||
extern _X_EXPORT DRIContextPrivPtr DRICreateContextPriv(ScreenPtr pScreen,
|
||||
drm_context_t *
|
||||
pHWContext,
|
||||
DRIContextFlags flags);
|
||||
|
||||
extern _X_EXPORT DRIContextPrivPtr DRICreateContextPrivFromHandle(ScreenPtr
|
||||
pScreen,
|
||||
drm_context_t
|
||||
hHWContext,
|
||||
DRIContextFlags
|
||||
flags);
|
||||
|
||||
extern _X_EXPORT Bool DRIDestroyContextPriv(DRIContextPrivPtr pDRIContextPriv);
|
||||
|
||||
extern _X_EXPORT drm_context_t DRIGetContext(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT void DRIQueryVersion(int *majorVersion,
|
||||
int *minorVersion, int *patchVersion);
|
||||
|
||||
extern _X_EXPORT void DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
|
||||
|
||||
extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen,
|
||||
int dx,
|
||||
int dy,
|
||||
int *xdir, int *ydir, RegionPtr reg);
|
||||
|
||||
extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn);
|
||||
|
||||
extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn);
|
||||
|
||||
extern _X_EXPORT drm_handle_t DRIMasterSareaHandle(ScrnInfoPtr pScrn);
|
||||
|
||||
extern _X_EXPORT void DRIGetTexOffsetFuncs(ScreenPtr pScreen,
|
||||
DRITexOffsetStartProcPtr *
|
||||
texOffsetStartFunc,
|
||||
DRITexOffsetFinishProcPtr *
|
||||
texOffsetFinishFunc);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,361 @@
|
||||
/*
|
||||
* Copyright © 2007 Red Hat, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Soft-
|
||||
* ware"), to deal in the Software without restriction, including without
|
||||
* limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, provided that the above copyright
|
||||
* notice(s) and this permission notice appear in all copies of the Soft-
|
||||
* ware and that both the above copyright notice(s) and this permission
|
||||
* notice appear in supporting documentation.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
|
||||
* ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
|
||||
* RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
|
||||
* THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
|
||||
* QUENTIAL 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 PERFOR-
|
||||
* MANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of a copyright holder shall
|
||||
* not be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in this Software without prior written authorization of
|
||||
* the copyright holder.
|
||||
*
|
||||
* Authors:
|
||||
* Kristian Høgsberg (krh@redhat.com)
|
||||
*/
|
||||
|
||||
#ifndef _DRI2_H_
|
||||
#define _DRI2_H_
|
||||
|
||||
#include <X11/extensions/dri2tokens.h>
|
||||
|
||||
#include "dix.h"
|
||||
|
||||
/* Version 2 structure (with format at the end) */
|
||||
typedef struct {
|
||||
unsigned int attachment;
|
||||
unsigned int name;
|
||||
unsigned int pitch;
|
||||
unsigned int cpp;
|
||||
unsigned int flags;
|
||||
unsigned int format;
|
||||
void *driverPrivate;
|
||||
} DRI2BufferRec, *DRI2BufferPtr;
|
||||
|
||||
typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
|
||||
typedef void (*DRI2SwapEventPtr) (ClientPtr client, void *data, int type,
|
||||
CARD64 ust, CARD64 msc, CARD32 sbc);
|
||||
|
||||
typedef DRI2BufferPtr(*DRI2CreateBuffersProcPtr) (DrawablePtr pDraw,
|
||||
unsigned int *attachments,
|
||||
int count);
|
||||
typedef void (*DRI2DestroyBuffersProcPtr) (DrawablePtr pDraw,
|
||||
DRI2BufferPtr buffers, int count);
|
||||
typedef void (*DRI2CopyRegionProcPtr) (DrawablePtr pDraw,
|
||||
RegionPtr pRegion,
|
||||
DRI2BufferPtr pDestBuffer,
|
||||
DRI2BufferPtr pSrcBuffer);
|
||||
typedef void (*DRI2WaitProcPtr) (WindowPtr pWin, unsigned int sequence);
|
||||
typedef int (*DRI2AuthMagicProcPtr) (int fd, uint32_t magic);
|
||||
typedef int (*DRI2AuthMagic2ProcPtr) (ScreenPtr pScreen, uint32_t magic);
|
||||
|
||||
/**
|
||||
* Schedule a buffer swap
|
||||
*
|
||||
* This callback is used to support glXSwapBuffers and the OML_sync_control
|
||||
* extension (see it for a description of the params).
|
||||
*
|
||||
* Drivers should queue an event for the frame count that satisfies the
|
||||
* parameters passed in. If the event is in the future (i.e. the conditions
|
||||
* aren't currently satisfied), the server may block the client at the next
|
||||
* GLX request using DRI2WaitSwap. When the event arrives, drivers should call
|
||||
* \c DRI2SwapComplete, which will handle waking the client and returning
|
||||
* the appropriate data.
|
||||
*
|
||||
* The DDX is responsible for doing a flip, exchange, or blit of the swap
|
||||
* when the corresponding event arrives. The \c DRI2CanFlip and
|
||||
* \c DRI2CanExchange functions can be used as helpers for this purpose.
|
||||
*
|
||||
* \param client client pointer (used for block/unblock)
|
||||
* \param pDraw drawable whose count we want
|
||||
* \param pDestBuffer current front buffer
|
||||
* \param pSrcBuffer current back buffer
|
||||
* \param target_msc frame count to wait for
|
||||
* \param divisor divisor for condition equation
|
||||
* \param remainder remainder for division equation
|
||||
* \param func function to call when the swap completes
|
||||
* \param data data for the callback \p func.
|
||||
*/
|
||||
typedef int (*DRI2ScheduleSwapProcPtr) (ClientPtr client,
|
||||
DrawablePtr pDraw,
|
||||
DRI2BufferPtr pDestBuffer,
|
||||
DRI2BufferPtr pSrcBuffer,
|
||||
CARD64 * target_msc,
|
||||
CARD64 divisor,
|
||||
CARD64 remainder,
|
||||
DRI2SwapEventPtr func, void *data);
|
||||
typedef DRI2BufferPtr(*DRI2CreateBufferProcPtr) (DrawablePtr pDraw,
|
||||
unsigned int attachment,
|
||||
unsigned int format);
|
||||
typedef void (*DRI2DestroyBufferProcPtr) (DrawablePtr pDraw,
|
||||
DRI2BufferPtr buffer);
|
||||
/**
|
||||
* Notifies driver when DRI2GetBuffers reuses a dri2 buffer.
|
||||
*
|
||||
* Driver may rename the dri2 buffer in this notify if it is required.
|
||||
*
|
||||
* \param pDraw drawable whose count we want
|
||||
* \param buffer buffer that will be returned to client
|
||||
*/
|
||||
typedef void (*DRI2ReuseBufferNotifyProcPtr) (DrawablePtr pDraw,
|
||||
DRI2BufferPtr buffer);
|
||||
/**
|
||||
* Get current media stamp counter values
|
||||
*
|
||||
* This callback is used to support the SGI_video_sync and OML_sync_control
|
||||
* extensions.
|
||||
*
|
||||
* Drivers should return the current frame counter and the timestamp from
|
||||
* when the returned frame count was last incremented.
|
||||
*
|
||||
* The count should correspond to the screen where the drawable is currently
|
||||
* visible. If the drawable isn't visible (e.g. redirected), the server
|
||||
* should return BadDrawable to the client, pending GLX spec updates to
|
||||
* define this behavior.
|
||||
*
|
||||
* \param pDraw drawable whose count we want
|
||||
* \param ust timestamp from when the count was last incremented.
|
||||
* \param mst current frame count
|
||||
*/
|
||||
typedef int (*DRI2GetMSCProcPtr) (DrawablePtr pDraw, CARD64 * ust,
|
||||
CARD64 * msc);
|
||||
/**
|
||||
* Schedule a frame count related wait
|
||||
*
|
||||
* This callback is used to support the SGI_video_sync and OML_sync_control
|
||||
* extensions. See those specifications for details on how to handle
|
||||
* the divisor and remainder parameters.
|
||||
*
|
||||
* Drivers should queue an event for the frame count that satisfies the
|
||||
* parameters passed in. If the event is in the future (i.e. the conditions
|
||||
* aren't currently satisfied), the driver should block the client using
|
||||
* \c DRI2BlockClient. When the event arrives, drivers should call
|
||||
* \c DRI2WaitMSCComplete, which will handle waking the client and returning
|
||||
* the appropriate data.
|
||||
*
|
||||
* \param client client pointer (used for block/unblock)
|
||||
* \param pDraw drawable whose count we want
|
||||
* \param target_msc frame count to wait for
|
||||
* \param divisor divisor for condition equation
|
||||
* \param remainder remainder for division equation
|
||||
*/
|
||||
typedef int (*DRI2ScheduleWaitMSCProcPtr) (ClientPtr client,
|
||||
DrawablePtr pDraw,
|
||||
CARD64 target_msc,
|
||||
CARD64 divisor, CARD64 remainder);
|
||||
|
||||
typedef void (*DRI2InvalidateProcPtr) (DrawablePtr pDraw, void *data, XID id);
|
||||
|
||||
/**
|
||||
* DRI2 calls this hook when ever swap_limit is going to be changed. Default
|
||||
* implementation for the hook only accepts one as swap_limit. If driver can
|
||||
* support other swap_limits it has to implement supported limits with this
|
||||
* callback.
|
||||
*
|
||||
* \param pDraw drawable whose swap_limit is going to be changed
|
||||
* \param swap_limit new swap_limit that going to be set
|
||||
* \return TRUE if limit is support, FALSE if not.
|
||||
*/
|
||||
typedef Bool (*DRI2SwapLimitValidateProcPtr) (DrawablePtr pDraw,
|
||||
int swap_limit);
|
||||
|
||||
typedef DRI2BufferPtr(*DRI2CreateBuffer2ProcPtr) (ScreenPtr pScreen,
|
||||
DrawablePtr pDraw,
|
||||
unsigned int attachment,
|
||||
unsigned int format);
|
||||
typedef void (*DRI2DestroyBuffer2ProcPtr) (ScreenPtr pScreen, DrawablePtr pDraw,
|
||||
DRI2BufferPtr buffer);
|
||||
|
||||
typedef void (*DRI2CopyRegion2ProcPtr) (ScreenPtr pScreen, DrawablePtr pDraw,
|
||||
RegionPtr pRegion,
|
||||
DRI2BufferPtr pDestBuffer,
|
||||
DRI2BufferPtr pSrcBuffer);
|
||||
|
||||
/**
|
||||
* \brief Get the value of a parameter.
|
||||
*
|
||||
* The parameter's \a value is looked up on the screen associated with
|
||||
* \a pDrawable.
|
||||
*
|
||||
* \return \c Success or error code.
|
||||
*/
|
||||
typedef int (*DRI2GetParamProcPtr) (ClientPtr client,
|
||||
DrawablePtr pDrawable,
|
||||
CARD64 param,
|
||||
BOOL *is_param_recognized,
|
||||
CARD64 *value);
|
||||
|
||||
/**
|
||||
* Version of the DRI2InfoRec structure defined in this header
|
||||
*/
|
||||
#define DRI2INFOREC_VERSION 9
|
||||
|
||||
typedef struct {
|
||||
unsigned int version; /**< Version of this struct */
|
||||
int fd;
|
||||
const char *driverName;
|
||||
const char *deviceName;
|
||||
|
||||
DRI2CreateBufferProcPtr CreateBuffer;
|
||||
DRI2DestroyBufferProcPtr DestroyBuffer;
|
||||
DRI2CopyRegionProcPtr CopyRegion;
|
||||
DRI2WaitProcPtr Wait;
|
||||
|
||||
/* added in version 4 */
|
||||
|
||||
DRI2ScheduleSwapProcPtr ScheduleSwap;
|
||||
DRI2GetMSCProcPtr GetMSC;
|
||||
DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
|
||||
|
||||
/* number of drivers in the driverNames array */
|
||||
unsigned int numDrivers;
|
||||
/* array of driver names, indexed by DRI2Driver* driver types */
|
||||
/* a name of NULL means that driver is not supported */
|
||||
const char *const *driverNames;
|
||||
|
||||
/* added in version 5 */
|
||||
|
||||
DRI2AuthMagicProcPtr AuthMagic;
|
||||
|
||||
/* added in version 6 */
|
||||
|
||||
DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify;
|
||||
DRI2SwapLimitValidateProcPtr SwapLimitValidate;
|
||||
|
||||
/* added in version 7 */
|
||||
DRI2GetParamProcPtr GetParam;
|
||||
|
||||
/* added in version 8 */
|
||||
/* AuthMagic callback which passes extra context */
|
||||
/* If this is NULL the AuthMagic callback is used */
|
||||
/* If this is non-NULL the AuthMagic callback is ignored */
|
||||
DRI2AuthMagic2ProcPtr AuthMagic2;
|
||||
|
||||
/* added in version 9 */
|
||||
DRI2CreateBuffer2ProcPtr CreateBuffer2;
|
||||
DRI2DestroyBuffer2ProcPtr DestroyBuffer2;
|
||||
DRI2CopyRegion2ProcPtr CopyRegion2;
|
||||
} DRI2InfoRec, *DRI2InfoPtr;
|
||||
|
||||
extern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info);
|
||||
|
||||
extern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT Bool DRI2HasSwapControl(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT Bool DRI2Connect(ClientPtr client, ScreenPtr pScreen,
|
||||
unsigned int driverType,
|
||||
int *fd,
|
||||
const char **driverName,
|
||||
const char **deviceName);
|
||||
|
||||
extern _X_EXPORT Bool DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic);
|
||||
|
||||
extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client,
|
||||
DrawablePtr pDraw,
|
||||
XID id,
|
||||
DRI2InvalidateProcPtr invalidate,
|
||||
void *priv);
|
||||
|
||||
extern _X_EXPORT int DRI2CreateDrawable2(ClientPtr client,
|
||||
DrawablePtr pDraw,
|
||||
XID id,
|
||||
DRI2InvalidateProcPtr invalidate,
|
||||
void *priv,
|
||||
XID *dri2_id_out);
|
||||
|
||||
extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
|
||||
int *width,
|
||||
int *height,
|
||||
unsigned int *attachments,
|
||||
int count, int *out_count);
|
||||
|
||||
extern _X_EXPORT int DRI2CopyRegion(DrawablePtr pDraw,
|
||||
RegionPtr pRegion,
|
||||
unsigned int dest, unsigned int src);
|
||||
|
||||
/**
|
||||
* Determine the major and minor version of the DRI2 extension.
|
||||
*
|
||||
* Provides a mechanism to other modules (e.g., 2D drivers) to determine the
|
||||
* version of the DRI2 extension. While it is possible to peek directly at
|
||||
* the \c XF86ModuleData from a layered module, such a module will fail to
|
||||
* load (due to an unresolved symbol) if the DRI2 extension is not loaded.
|
||||
*
|
||||
* \param major Location to store the major version of the DRI2 extension
|
||||
* \param minor Location to store the minor version of the DRI2 extension
|
||||
*
|
||||
* \note
|
||||
* This interface was added some time after the initial release of the DRI2
|
||||
* module. Layered modules that wish to use this interface must first test
|
||||
* its existence by calling \c xf86LoaderCheckSymbol.
|
||||
*/
|
||||
extern _X_EXPORT void DRI2Version(int *major, int *minor);
|
||||
|
||||
extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffersWithFormat(DrawablePtr pDraw,
|
||||
int *width,
|
||||
int *height,
|
||||
unsigned int
|
||||
*attachments,
|
||||
int count,
|
||||
int *out_count);
|
||||
|
||||
extern _X_EXPORT void DRI2SwapInterval(DrawablePtr pDrawable, int interval);
|
||||
extern _X_EXPORT Bool DRI2SwapLimit(DrawablePtr pDraw, int swap_limit);
|
||||
extern _X_EXPORT int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDrawable,
|
||||
CARD64 target_msc, CARD64 divisor,
|
||||
CARD64 remainder, CARD64 * swap_target,
|
||||
DRI2SwapEventPtr func, void *data);
|
||||
extern _X_EXPORT Bool DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable);
|
||||
|
||||
extern _X_EXPORT int DRI2GetMSC(DrawablePtr pDrawable, CARD64 * ust,
|
||||
CARD64 * msc, CARD64 * sbc);
|
||||
extern _X_EXPORT int DRI2WaitMSC(ClientPtr client, DrawablePtr pDrawable,
|
||||
CARD64 target_msc, CARD64 divisor,
|
||||
CARD64 remainder);
|
||||
extern _X_EXPORT int ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust,
|
||||
CARD64 msc, CARD64 sbc);
|
||||
extern _X_EXPORT int DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw,
|
||||
CARD64 target_sbc);
|
||||
extern _X_EXPORT Bool DRI2ThrottleClient(ClientPtr client, DrawablePtr pDraw);
|
||||
|
||||
extern _X_EXPORT Bool DRI2CanFlip(DrawablePtr pDraw);
|
||||
|
||||
extern _X_EXPORT Bool DRI2CanExchange(DrawablePtr pDraw);
|
||||
|
||||
/* Note: use *only* for MSC related waits */
|
||||
extern _X_EXPORT void DRI2BlockClient(ClientPtr client, DrawablePtr pDraw);
|
||||
|
||||
extern _X_EXPORT void DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw,
|
||||
int frame, unsigned int tv_sec,
|
||||
unsigned int tv_usec, int type,
|
||||
DRI2SwapEventPtr swap_complete,
|
||||
void *swap_data);
|
||||
extern _X_EXPORT void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw,
|
||||
int frame, unsigned int tv_sec,
|
||||
unsigned int tv_usec);
|
||||
|
||||
extern _X_EXPORT int DRI2GetParam(ClientPtr client,
|
||||
DrawablePtr pDrawable,
|
||||
CARD64 param,
|
||||
BOOL *is_param_recognized,
|
||||
CARD64 *value);
|
||||
|
||||
extern _X_EXPORT DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest);
|
||||
#endif
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright © 2013 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 the copyright holders not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. The copyright holders make no representations
|
||||
* about the suitability of this software for any purpose. It is provided "as
|
||||
* is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL THE COPYRIGHT HOLDERS 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 _DRI3_H_
|
||||
#define _DRI3_H_
|
||||
|
||||
#include <X11/extensions/dri3proto.h>
|
||||
#include <randrstr.h>
|
||||
|
||||
#define DRI3_SCREEN_INFO_VERSION 4
|
||||
|
||||
struct dri3_syncobj
|
||||
{
|
||||
XID id;
|
||||
ScreenPtr screen;
|
||||
uint32_t refcount;
|
||||
|
||||
void (*free)(struct dri3_syncobj *syncobj);
|
||||
Bool (*has_fence)(struct dri3_syncobj *syncobj, uint64_t point);
|
||||
Bool (*is_signaled)(struct dri3_syncobj *syncobj, uint64_t point);
|
||||
int (*export_fence)(struct dri3_syncobj *syncobj, uint64_t point);
|
||||
void (*import_fence)(struct dri3_syncobj *syncobj, uint64_t point, int fd);
|
||||
void (*signal)(struct dri3_syncobj *syncobj, uint64_t point);
|
||||
void (*submitted_eventfd)(struct dri3_syncobj *syncobj, uint64_t point, int efd);
|
||||
void (*signaled_eventfd)(struct dri3_syncobj *syncobj, uint64_t point, int efd);
|
||||
};
|
||||
|
||||
typedef int (*dri3_open_proc)(ScreenPtr screen,
|
||||
RRProviderPtr provider,
|
||||
int *fd);
|
||||
|
||||
typedef int (*dri3_open_client_proc)(ClientPtr client,
|
||||
ScreenPtr screen,
|
||||
RRProviderPtr provider,
|
||||
int *fd);
|
||||
|
||||
typedef PixmapPtr (*dri3_pixmap_from_fd_proc) (ScreenPtr screen,
|
||||
int fd,
|
||||
CARD16 width,
|
||||
CARD16 height,
|
||||
CARD16 stride,
|
||||
CARD8 depth,
|
||||
CARD8 bpp);
|
||||
|
||||
typedef PixmapPtr (*dri3_pixmap_from_fds_proc) (ScreenPtr screen,
|
||||
CARD8 num_fds,
|
||||
const int *fds,
|
||||
CARD16 width,
|
||||
CARD16 height,
|
||||
const CARD32 *strides,
|
||||
const CARD32 *offsets,
|
||||
CARD8 depth,
|
||||
CARD8 bpp,
|
||||
CARD64 modifier);
|
||||
|
||||
typedef int (*dri3_fd_from_pixmap_proc) (ScreenPtr screen,
|
||||
PixmapPtr pixmap,
|
||||
CARD16 *stride,
|
||||
CARD32 *size);
|
||||
|
||||
typedef int (*dri3_fds_from_pixmap_proc) (ScreenPtr screen,
|
||||
PixmapPtr pixmap,
|
||||
int *fds,
|
||||
uint32_t *strides,
|
||||
uint32_t *offsets,
|
||||
uint64_t *modifier);
|
||||
|
||||
typedef int (*dri3_get_formats_proc) (ScreenPtr screen,
|
||||
CARD32 *num_formats,
|
||||
CARD32 **formats);
|
||||
|
||||
typedef int (*dri3_get_modifiers_proc) (ScreenPtr screen,
|
||||
uint32_t format,
|
||||
uint32_t *num_modifiers,
|
||||
uint64_t **modifiers);
|
||||
|
||||
typedef int (*dri3_get_drawable_modifiers_proc) (DrawablePtr draw,
|
||||
uint32_t format,
|
||||
uint32_t *num_modifiers,
|
||||
uint64_t **modifiers);
|
||||
|
||||
typedef struct dri3_syncobj *(*dri3_import_syncobj_proc) (ClientPtr client,
|
||||
ScreenPtr screen,
|
||||
XID id,
|
||||
int fd);
|
||||
|
||||
typedef struct dri3_screen_info {
|
||||
uint32_t version;
|
||||
|
||||
dri3_open_proc open;
|
||||
dri3_pixmap_from_fd_proc pixmap_from_fd;
|
||||
dri3_fd_from_pixmap_proc fd_from_pixmap;
|
||||
|
||||
/* Version 1 */
|
||||
dri3_open_client_proc open_client;
|
||||
|
||||
/* Version 2 */
|
||||
dri3_pixmap_from_fds_proc pixmap_from_fds;
|
||||
dri3_fds_from_pixmap_proc fds_from_pixmap;
|
||||
dri3_get_formats_proc get_formats;
|
||||
dri3_get_modifiers_proc get_modifiers;
|
||||
dri3_get_drawable_modifiers_proc get_drawable_modifiers;
|
||||
|
||||
/* Version 4 */
|
||||
dri3_import_syncobj_proc import_syncobj;
|
||||
|
||||
} dri3_screen_info_rec, *dri3_screen_info_ptr;
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
dri3_screen_init(ScreenPtr screen, const dri3_screen_info_rec *info);
|
||||
|
||||
#endif /* _DRI3_H_ */
|
||||
@@ -0,0 +1,122 @@
|
||||
/**************************************************************************
|
||||
|
||||
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sub license, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the
|
||||
next paragraph) shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS 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.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Jens Owen <jens@tungstengraphics.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DRI_STRUCT_H
|
||||
#define DRI_STRUCT_H
|
||||
|
||||
#include "dri.h"
|
||||
#include "sarea.h"
|
||||
#include "xf86drm.h"
|
||||
#include "xf86Crtc.h"
|
||||
|
||||
#define DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin) ((DRIDrawablePrivPtr) \
|
||||
dixLookupPrivate(&(pWin)->devPrivates, DRIWindowPrivKey))
|
||||
#define DRI_DRAWABLE_PRIV_FROM_PIXMAP(pPix) ((DRIDrawablePrivPtr) \
|
||||
dixLookupPrivate(&(pPix)->devPrivates, DRIWindowPrivKey))
|
||||
|
||||
typedef struct _DRIDrawablePrivRec {
|
||||
drm_drawable_t hwDrawable;
|
||||
int drawableIndex;
|
||||
ScreenPtr pScreen;
|
||||
int refCount;
|
||||
int nrects;
|
||||
} DRIDrawablePrivRec, *DRIDrawablePrivPtr;
|
||||
|
||||
struct _DRIContextPrivRec {
|
||||
drm_context_t hwContext;
|
||||
ScreenPtr pScreen;
|
||||
Bool valid3D;
|
||||
DRIContextFlags flags;
|
||||
void **pContextStore;
|
||||
};
|
||||
|
||||
#define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \
|
||||
dixLookupPrivate(&screenInfo.screens[(screenIndex)]->devPrivates, \
|
||||
DRIScreenPrivKey))
|
||||
|
||||
#define DRI_ENT_PRIV(pScrn) \
|
||||
((DRIEntPrivIndex < 0) ? \
|
||||
NULL: \
|
||||
((DRIEntPrivPtr)(xf86GetEntityPrivate((pScrn)->entityList[0], \
|
||||
DRIEntPrivIndex)->ptr)))
|
||||
|
||||
typedef struct _DRIScreenPrivRec {
|
||||
Bool directRenderingSupport;
|
||||
int drmFD; /* File descriptor for /dev/video/? */
|
||||
drm_handle_t hSAREA; /* Handle to SAREA, for mapping */
|
||||
XF86DRISAREAPtr pSAREA; /* Mapped pointer to SAREA */
|
||||
drm_context_t myContext; /* DDX Driver's context */
|
||||
DRIContextPrivPtr myContextPriv; /* Pointer to server's private area */
|
||||
DRIContextPrivPtr lastPartial3DContext; /* last one partially saved */
|
||||
void **hiddenContextStore; /* hidden X context */
|
||||
void **partial3DContextStore; /* partial 3D context */
|
||||
DRIInfoPtr pDriverInfo;
|
||||
int nrWindows;
|
||||
int nrWindowsVisible;
|
||||
int nrWalked;
|
||||
drm_clip_rect_t private_buffer_rect; /* management of private buffers */
|
||||
DrawablePtr fullscreen; /* pointer to fullscreen drawable */
|
||||
drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */
|
||||
DRIWrappedFuncsRec wrap;
|
||||
void *_dummy1; // required in place of a removed field for ABI compatibility
|
||||
DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES];
|
||||
DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */
|
||||
Bool createDummyCtx;
|
||||
Bool createDummyCtxPriv;
|
||||
Bool grabbedDRILock;
|
||||
Bool drmSIGIOHandlerInstalled;
|
||||
Bool wrapped;
|
||||
Bool windowsTouched;
|
||||
int lockRefCount;
|
||||
drm_handle_t hLSAREA; /* Handle to SAREA containing lock, for mapping */
|
||||
XF86DRILSAREAPtr pLSAREA; /* Mapped pointer to SAREA containing lock */
|
||||
int *pLockRefCount;
|
||||
int *pLockingContext;
|
||||
xf86_crtc_notify_proc_ptr xf86_crtc_notify;
|
||||
} DRIScreenPrivRec, *DRIScreenPrivPtr;
|
||||
|
||||
typedef struct _DRIEntPrivRec {
|
||||
int drmFD;
|
||||
Bool drmOpened;
|
||||
Bool sAreaGrabbed;
|
||||
drm_handle_t hLSAREA;
|
||||
XF86DRILSAREAPtr pLSAREA;
|
||||
unsigned long sAreaSize;
|
||||
int lockRefCount;
|
||||
int lockingContext;
|
||||
ScreenPtr resOwner;
|
||||
Bool keepFDOpen;
|
||||
int refCount;
|
||||
} DRIEntPrivRec, *DRIEntPrivPtr;
|
||||
|
||||
#endif /* DRI_STRUCT_H */
|
||||
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* edid.h: defines to parse an EDID block
|
||||
*
|
||||
* This file contains all information to interpret a standard EDIC block
|
||||
* transmitted by a display device via DDC (Display Data Channel). So far
|
||||
* there is no information to deal with optional EDID blocks.
|
||||
* DDC is a Trademark of VESA (Video Electronics Standard Association).
|
||||
*
|
||||
* Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
|
||||
*/
|
||||
|
||||
#ifndef _EDID_H_
|
||||
#define _EDID_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#define STD_TIMINGS 8
|
||||
#define DET_TIMINGS 4
|
||||
|
||||
/* input type */
|
||||
#define DIGITAL(x) (x)
|
||||
|
||||
/* Msc stuff EDID Ver > 1.1 */
|
||||
#define PREFERRED_TIMING_MODE(x) ((x) & 0x2)
|
||||
#define GTF_SUPPORTED(x) ((x) & 0x1)
|
||||
|
||||
struct vendor {
|
||||
char name[4];
|
||||
int prod_id;
|
||||
unsigned int serial;
|
||||
int week;
|
||||
int year;
|
||||
};
|
||||
|
||||
struct edid_version {
|
||||
int version;
|
||||
int revision;
|
||||
};
|
||||
|
||||
struct disp_features {
|
||||
unsigned int input_type:1;
|
||||
unsigned int input_voltage:2;
|
||||
unsigned int input_setup:1;
|
||||
unsigned int input_sync:5;
|
||||
unsigned int input_dfp:1;
|
||||
unsigned int input_bpc:3;
|
||||
unsigned int input_interface:4;
|
||||
/* 15 bit hole */
|
||||
int hsize;
|
||||
int vsize;
|
||||
float gamma;
|
||||
unsigned int dpms:3;
|
||||
unsigned int display_type:2;
|
||||
unsigned int msc:3;
|
||||
float redx;
|
||||
float redy;
|
||||
float greenx;
|
||||
float greeny;
|
||||
float bluex;
|
||||
float bluey;
|
||||
float whitex;
|
||||
float whitey;
|
||||
};
|
||||
|
||||
struct established_timings {
|
||||
uint8_t t1;
|
||||
uint8_t t2;
|
||||
uint8_t t_manu;
|
||||
};
|
||||
|
||||
struct std_timings {
|
||||
int hsize;
|
||||
int vsize;
|
||||
int refresh;
|
||||
CARD16 id;
|
||||
};
|
||||
|
||||
struct detailed_timings {
|
||||
int clock;
|
||||
int h_active;
|
||||
int h_blanking;
|
||||
int v_active;
|
||||
int v_blanking;
|
||||
int h_sync_off;
|
||||
int h_sync_width;
|
||||
int v_sync_off;
|
||||
int v_sync_width;
|
||||
int h_size;
|
||||
int v_size;
|
||||
int h_border;
|
||||
int v_border;
|
||||
unsigned int interlaced:1;
|
||||
unsigned int stereo:2;
|
||||
unsigned int sync:2;
|
||||
unsigned int misc:2;
|
||||
unsigned int stereo_1:1;
|
||||
};
|
||||
|
||||
#define DT 0
|
||||
#define DS_SERIAL 0xFF
|
||||
#define DS_ASCII_STR 0xFE
|
||||
#define DS_NAME 0xFC
|
||||
#define DS_RANGES 0xFD
|
||||
#define DS_WHITE_P 0xFB
|
||||
#define DS_STD_TIMINGS 0xFA
|
||||
#define DS_CMD 0xF9
|
||||
#define DS_CVT 0xF8
|
||||
#define DS_EST_III 0xF7
|
||||
#define DS_DUMMY 0x10
|
||||
#define DS_UNKOWN 0x100 /* type is an int */
|
||||
#define DS_VENDOR 0x101
|
||||
#define DS_VENDOR_MAX 0x110
|
||||
|
||||
/*
|
||||
* Display range limit Descriptor of EDID version1, reversion 4
|
||||
*/
|
||||
typedef enum {
|
||||
DR_DEFAULT_GTF,
|
||||
DR_LIMITS_ONLY,
|
||||
DR_SECONDARY_GTF,
|
||||
DR_CVT_SUPPORTED = 4,
|
||||
} DR_timing_flags;
|
||||
|
||||
struct monitor_ranges {
|
||||
int min_v;
|
||||
int max_v;
|
||||
int min_h;
|
||||
int max_h;
|
||||
int max_clock; /* in mhz */
|
||||
int gtf_2nd_f;
|
||||
int gtf_2nd_c;
|
||||
int gtf_2nd_m;
|
||||
int gtf_2nd_k;
|
||||
int gtf_2nd_j;
|
||||
int max_clock_khz;
|
||||
int maxwidth; /* in pixels */
|
||||
char supported_aspect;
|
||||
char preferred_aspect;
|
||||
char supported_blanking;
|
||||
char supported_scaling;
|
||||
int preferred_refresh; /* in hz */
|
||||
DR_timing_flags display_range_timing_flags;
|
||||
};
|
||||
|
||||
struct whitePoints {
|
||||
int index;
|
||||
float white_x;
|
||||
float white_y;
|
||||
float white_gamma;
|
||||
};
|
||||
|
||||
struct cvt_timings {
|
||||
int width;
|
||||
int height;
|
||||
int rate;
|
||||
int rates;
|
||||
};
|
||||
|
||||
/*
|
||||
* Be careful when adding new sections; this structure can't grow, it's
|
||||
* embedded in the middle of xf86Monitor which is ABI. Sizes below are
|
||||
* in bytes, for ILP32 systems. If all else fails just copy the section
|
||||
* literally like serial and friends.
|
||||
*/
|
||||
struct detailed_monitor_section {
|
||||
int type;
|
||||
union {
|
||||
struct detailed_timings d_timings; /* 56 */
|
||||
uint8_t serial[13];
|
||||
uint8_t ascii_data[13];
|
||||
uint8_t name[13];
|
||||
struct monitor_ranges ranges; /* 60 */
|
||||
struct std_timings std_t[5]; /* 80 */
|
||||
struct whitePoints wp[2]; /* 32 */
|
||||
/* color management data */
|
||||
struct cvt_timings cvt[4]; /* 64 */
|
||||
uint8_t est_iii[6]; /* 6 */
|
||||
} section; /* max: 80 */
|
||||
};
|
||||
|
||||
/* flags */
|
||||
#define MONITOR_EDID_COMPLETE_RAWDATA 0x01
|
||||
/* old, don't use */
|
||||
#define EDID_COMPLETE_RAWDATA 0x01
|
||||
|
||||
/**
|
||||
* @brief The monitor_hdr_data hdr metadata struct
|
||||
* This struct mirrors Table 92 - HDR Static Metadata Data Block (HDR SMDB) structure
|
||||
*/
|
||||
struct monitor_hdr_data {
|
||||
bool hdr_valid : 1; /* static metadata v1 found, doesn't mean all fields are set */
|
||||
bool colorimetry_valid : 1; /* if colorimetry tag found */
|
||||
|
||||
bool tf_traditional_sdr : 1,
|
||||
tf_traditional_hdr : 1,
|
||||
tf_pq : 1,
|
||||
tf_hlg : 1,
|
||||
tf_4 : 1,
|
||||
tf_5 : 1;
|
||||
|
||||
unsigned int resv : 2; /* reserved bits */
|
||||
|
||||
float desired_content_min_luminance; /* in cd/m2, can be 0 */
|
||||
float desired_content_max_luminance; /* in cd/m2, can be 0 */
|
||||
float desired_content_max_frame_avg_luminance; /* in cd/m2, if unset 0 */
|
||||
|
||||
bool sm_static_metadata_type1 : 1;
|
||||
|
||||
unsigned int sm_1_7 : 7; /* reserved bits */
|
||||
|
||||
int reserved_1[4]; /* for future */
|
||||
|
||||
unsigned int colorimetry_profiles : 16;
|
||||
|
||||
int reserved_2[4]; /* for future */
|
||||
};
|
||||
|
||||
#define CTA_HDR_SMDB_TF_SDR 1
|
||||
#define CTA_HDR_SMDB_TF_HDR 2
|
||||
#define CTA_HDR_SMDB_TF_ST2084 4
|
||||
#define CTA_HDR_SMDB_TF_HLG 8
|
||||
|
||||
#define CTA_HDR_SMDB_SM_TYPE1 1
|
||||
|
||||
/* these constants are from Colorimetry Data Block (CDB) byte 3 and 4, converted into natural representation (big endian) uint16 */
|
||||
|
||||
#define is_CTA_CDB_BT2020_RGB(x) (((x) & 0x8000) == 0x8000)
|
||||
#define is_CTA_CDB_BT2020_YCC(x) (((x) & 0x4000) == 0x4000)
|
||||
#define is_CTA_CDB_BT2020_cYCC(x) (((x) & 0x2000) == 0x2000)
|
||||
#define is_CTA_CDB_opRGB(x) (((x) & 0x1000) == 0x1000)
|
||||
#define is_CTA_CDB_opYCC601(x) (((x) & 0x0800) == 0x0800)
|
||||
#define is_CTA_CDB_sYCC601(x) (((x) & 0x0400) == 0x0400)
|
||||
#define is_CTA_CDB_xvYCC709(x) (((x) & 0x0200) == 0x0200)
|
||||
#define is_CTA_CDB_xvYCC601(x) (((x) & 0x0100) == 0x0100)
|
||||
#define is_CTA_CDB_ST2113RGB(x) (((x) & 0x0080) == 0x0080)
|
||||
#define is_CTA_CDB_iCtCp(x) (((x) & 0x0040) == 0x0040)
|
||||
|
||||
/*
|
||||
* For DisplayID devices, only the scrnIndex, flags, and rawData fields
|
||||
* are meaningful. For EDID, they all are.
|
||||
*/
|
||||
typedef struct {
|
||||
int scrnIndex;
|
||||
struct vendor vendor;
|
||||
struct edid_version ver;
|
||||
struct disp_features features;
|
||||
struct established_timings timings1;
|
||||
struct std_timings timings2[8];
|
||||
struct detailed_monitor_section det_mon[4];
|
||||
unsigned long flags;
|
||||
int no_sections;
|
||||
uint8_t *rawData;
|
||||
struct monitor_hdr_data hdr;
|
||||
} xf86Monitor, *xf86MonPtr;
|
||||
|
||||
extern _X_EXPORT xf86MonPtr ConfiguredMonitor;
|
||||
|
||||
/*
|
||||
* check whether monitor supports Generalized Timing Formula
|
||||
*
|
||||
* @param monitor the monitor information structure to check
|
||||
* @return true if GTF is supported by the monitor
|
||||
*/
|
||||
_X_EXPORT bool xf86Monitor_gtf_supported(xf86MonPtr monitor);
|
||||
|
||||
#endif /* _EDID_H_ */
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright © 2009 Red Hat, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef EVENTS_H
|
||||
#define EVENTS_H
|
||||
typedef struct _DeviceEvent DeviceEvent;
|
||||
typedef struct _DeviceChangedEvent DeviceChangedEvent;
|
||||
typedef struct _TouchOwnershipEvent TouchOwnershipEvent;
|
||||
typedef struct _BarrierEvent BarrierEvent;
|
||||
typedef struct _GestureEvent GestureEvent;
|
||||
|
||||
#ifdef XFreeXDGA
|
||||
typedef struct _DGAEvent DGAEvent;
|
||||
#endif
|
||||
typedef struct _RawDeviceEvent RawDeviceEvent;
|
||||
|
||||
#ifdef XQUARTZ
|
||||
typedef struct _XQuartzEvent XQuartzEvent;
|
||||
#endif
|
||||
typedef union _InternalEvent InternalEvent;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,811 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2000 Keith Packard
|
||||
* 2004 Eric Anholt
|
||||
* 2005 Zack Rusin
|
||||
*
|
||||
* 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 copyright holders not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Copyright holders make no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
|
||||
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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.
|
||||
*/
|
||||
|
||||
/** @file
|
||||
* This is the header containing the public API of EXA for exa drivers.
|
||||
*/
|
||||
|
||||
#ifndef EXA_H
|
||||
#define EXA_H
|
||||
|
||||
#include "scrnintstr.h"
|
||||
#include "pixmapstr.h"
|
||||
#include "windowstr.h"
|
||||
#include "gcstruct.h"
|
||||
#include "picturestr.h"
|
||||
#include "fb.h"
|
||||
|
||||
#define EXA_VERSION_MAJOR 2
|
||||
#define EXA_VERSION_MINOR 6
|
||||
#define EXA_VERSION_RELEASE 0
|
||||
|
||||
typedef struct _ExaOffscreenArea ExaOffscreenArea;
|
||||
|
||||
typedef void (*ExaOffscreenSaveProc) (ScreenPtr pScreen,
|
||||
ExaOffscreenArea * area);
|
||||
|
||||
typedef enum _ExaOffscreenState {
|
||||
ExaOffscreenAvail,
|
||||
ExaOffscreenRemovable,
|
||||
ExaOffscreenLocked
|
||||
} ExaOffscreenState;
|
||||
|
||||
struct _ExaOffscreenArea {
|
||||
int base_offset; /* allocation base */
|
||||
int offset; /* aligned offset */
|
||||
int size; /* total allocation size */
|
||||
unsigned last_use;
|
||||
void *privData;
|
||||
|
||||
ExaOffscreenSaveProc save;
|
||||
|
||||
ExaOffscreenState state;
|
||||
|
||||
ExaOffscreenArea *next;
|
||||
|
||||
unsigned eviction_cost;
|
||||
|
||||
ExaOffscreenArea *prev; /* Double-linked list for defragmentation */
|
||||
int align; /* required alignment */
|
||||
};
|
||||
|
||||
/**
|
||||
* The ExaDriver structure is allocated through exaDriverAlloc(), and then
|
||||
* fllled in by drivers.
|
||||
*/
|
||||
typedef struct _ExaDriver {
|
||||
/**
|
||||
* exa_major and exa_minor should be set by the driver to the version of
|
||||
* EXA which the driver was compiled for (or configures itself at runtime
|
||||
* to support). This allows EXA to extend the structure for new features
|
||||
* without breaking ABI for drivers compiled against older versions.
|
||||
*/
|
||||
int exa_major, exa_minor;
|
||||
|
||||
/**
|
||||
* memoryBase is the address of the beginning of framebuffer memory.
|
||||
* The visible screen should be within memoryBase to memoryBase +
|
||||
* memorySize.
|
||||
*/
|
||||
CARD8 *memoryBase;
|
||||
|
||||
/**
|
||||
* offScreenBase is the offset from memoryBase of the beginning of the area
|
||||
* to be managed by EXA's linear offscreen memory manager.
|
||||
*
|
||||
* In XFree86 DDX drivers, this is probably:
|
||||
* (pScrn->displayWidth * cpp * pScrn->virtualY)
|
||||
*/
|
||||
unsigned long offScreenBase;
|
||||
|
||||
/**
|
||||
* memorySize is the length (in bytes) of framebuffer memory beginning
|
||||
* from memoryBase.
|
||||
*
|
||||
* The offscreen memory manager will manage the area beginning at
|
||||
* (memoryBase + offScreenBase), with a length of (memorySize -
|
||||
* offScreenBase)
|
||||
*
|
||||
* In XFree86 DDX drivers, this is probably (pScrn->videoRam * 1024)
|
||||
*/
|
||||
unsigned long memorySize;
|
||||
|
||||
/**
|
||||
* pixmapOffsetAlign is the byte alignment necessary for pixmap offsets
|
||||
* within framebuffer.
|
||||
*
|
||||
* Hardware typically has a required alignment of offsets, which may or may
|
||||
* not be a power of two. EXA will ensure that pixmaps managed by the
|
||||
* offscreen memory manager meet this alignment requirement.
|
||||
*/
|
||||
int pixmapOffsetAlign;
|
||||
|
||||
/**
|
||||
* pixmapPitchAlign is the byte alignment necessary for pixmap pitches
|
||||
* within the framebuffer.
|
||||
*
|
||||
* Hardware typically has a required alignment of pitches for acceleration.
|
||||
* For 3D hardware, Composite acceleration often requires that source and
|
||||
* mask pixmaps (textures) have a power-of-two pitch, which can be demanded
|
||||
* using EXA_OFFSCREEN_ALIGN_POT. These pitch requirements only apply to
|
||||
* pixmaps managed by the offscreen memory manager. Thus, it is up to the
|
||||
* driver to ensure that the visible screen has an appropriate pitch for
|
||||
* acceleration.
|
||||
*/
|
||||
int pixmapPitchAlign;
|
||||
|
||||
/**
|
||||
* The flags field is bitfield of boolean values controlling EXA's behavior.
|
||||
*
|
||||
* The flags include EXA_OFFSCREEN_PIXMAPS, EXA_OFFSCREEN_ALIGN_POT, and
|
||||
* EXA_TWO_BITBLT_DIRECTIONS.
|
||||
*/
|
||||
int flags;
|
||||
|
||||
/** @{ */
|
||||
/**
|
||||
* maxX controls the X coordinate limitation for rendering from the card.
|
||||
* The driver should never receive a request for rendering beyond maxX
|
||||
* in the X direction from the origin of a pixmap.
|
||||
*/
|
||||
int maxX;
|
||||
|
||||
/**
|
||||
* maxY controls the Y coordinate limitation for rendering from the card.
|
||||
* The driver should never receive a request for rendering beyond maxY
|
||||
* in the Y direction from the origin of a pixmap.
|
||||
*/
|
||||
int maxY;
|
||||
/** @} */
|
||||
|
||||
/* private */
|
||||
ExaOffscreenArea *offScreenAreas;
|
||||
Bool needsSync;
|
||||
int lastMarker;
|
||||
|
||||
/** @name Solid
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* PrepareSolid() sets up the driver for doing a solid fill.
|
||||
* @param pPixmap Destination pixmap
|
||||
* @param alu raster operation
|
||||
* @param planemask write mask for the fill
|
||||
* @param fg "foreground" color for the fill
|
||||
*
|
||||
* This call should set up the driver for doing a series of solid fills
|
||||
* through the Solid() call. The alu raster op is one of the GX*
|
||||
* graphics functions listed in X.h, and typically maps to a similar
|
||||
* single-byte "ROP" setting in all hardware. The planemask controls
|
||||
* which bits of the destination should be affected, and will only represent
|
||||
* the bits up to the depth of pPixmap. The fg is the pixel value of the
|
||||
* foreground color referred to in ROP descriptions.
|
||||
*
|
||||
* Note that many drivers will need to store some of the data in the driver
|
||||
* private record, for sending to the hardware with each drawing command.
|
||||
*
|
||||
* The PrepareSolid() call is required of all drivers, but it may fail for any
|
||||
* reason. Failure results in a fallback to software rendering.
|
||||
*/
|
||||
Bool (*PrepareSolid) (PixmapPtr pPixmap,
|
||||
int alu, Pixel planemask, Pixel fg);
|
||||
|
||||
/**
|
||||
* Solid() performs a solid fill set up in the last PrepareSolid() call.
|
||||
*
|
||||
* @param pPixmap destination pixmap
|
||||
* @param x1 left coordinate
|
||||
* @param y1 top coordinate
|
||||
* @param x2 right coordinate
|
||||
* @param y2 bottom coordinate
|
||||
*
|
||||
* Performs the fill set up by the last PrepareSolid() call, covering the
|
||||
* area from (x1,y1) to (x2,y2) in pPixmap. Note that the coordinates are
|
||||
* in the coordinate space of the destination pixmap, so the driver will
|
||||
* need to set up the hardware's offset and pitch for the destination
|
||||
* coordinates according to the pixmap's offset and pitch within
|
||||
* framebuffer. This likely means using exaGetPixmapOffset() and
|
||||
* exaGetPixmapPitch().
|
||||
*
|
||||
* This call is required if PrepareSolid() ever succeeds.
|
||||
*/
|
||||
void (*Solid) (PixmapPtr pPixmap, int x1, int y1, int x2, int y2);
|
||||
|
||||
/**
|
||||
* DoneSolid() finishes a set of solid fills.
|
||||
*
|
||||
* @param pPixmap destination pixmap.
|
||||
*
|
||||
* The DoneSolid() call is called at the end of a series of consecutive
|
||||
* Solid() calls following a successful PrepareSolid(). This allows drivers
|
||||
* to finish up emitting drawing commands that were buffered, or clean up
|
||||
* state from PrepareSolid().
|
||||
*
|
||||
* This call is required if PrepareSolid() ever succeeds.
|
||||
*/
|
||||
void (*DoneSolid) (PixmapPtr pPixmap);
|
||||
/** @} */
|
||||
|
||||
/** @name Copy
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* PrepareCopy() sets up the driver for doing a copy within video
|
||||
* memory.
|
||||
*
|
||||
* @param pSrcPixmap source pixmap
|
||||
* @param pDstPixmap destination pixmap
|
||||
* @param dx X copy direction
|
||||
* @param dy Y copy direction
|
||||
* @param alu raster operation
|
||||
* @param planemask write mask for the fill
|
||||
*
|
||||
* This call should set up the driver for doing a series of copies from the
|
||||
* the pSrcPixmap to the pDstPixmap. The dx flag will be positive if the
|
||||
* hardware should do the copy from the left to the right, and dy will be
|
||||
* positive if the copy should be done from the top to the bottom. This
|
||||
* is to deal with self-overlapping copies when pSrcPixmap == pDstPixmap.
|
||||
* If your hardware can only support blits that are (left to right, top to
|
||||
* bottom) or (right to left, bottom to top), then you should set
|
||||
* #EXA_TWO_BITBLT_DIRECTIONS, and EXA will break down Copy operations to
|
||||
* ones that meet those requirements. The alu raster op is one of the GX*
|
||||
* graphics functions listed in X.h, and typically maps to a similar
|
||||
* single-byte "ROP" setting in all hardware. The planemask controls which
|
||||
* bits of the destination should be affected, and will only represent the
|
||||
* bits up to the depth of pPixmap.
|
||||
*
|
||||
* Note that many drivers will need to store some of the data in the driver
|
||||
* private record, for sending to the hardware with each drawing command.
|
||||
*
|
||||
* The PrepareCopy() call is required of all drivers, but it may fail for any
|
||||
* reason. Failure results in a fallback to software rendering.
|
||||
*/
|
||||
Bool (*PrepareCopy) (PixmapPtr pSrcPixmap,
|
||||
PixmapPtr pDstPixmap,
|
||||
int dx, int dy, int alu, Pixel planemask);
|
||||
|
||||
/**
|
||||
* Copy() performs a copy set up in the last PrepareCopy call.
|
||||
*
|
||||
* @param pDstPixmap destination pixmap
|
||||
* @param srcX source X coordinate
|
||||
* @param srcY source Y coordinate
|
||||
* @param dstX destination X coordinate
|
||||
* @param dstY destination Y coordinate
|
||||
* @param width width of the rectangle to be copied
|
||||
* @param height height of the rectangle to be copied.
|
||||
*
|
||||
* Performs the copy set up by the last PrepareCopy() call, copying the
|
||||
* rectangle from (srcX, srcY) to (srcX + width, srcY + width) in the source
|
||||
* pixmap to the same-sized rectangle at (dstX, dstY) in the destination
|
||||
* pixmap. Those rectangles may overlap in memory, if
|
||||
* pSrcPixmap == pDstPixmap. Note that this call does not receive the
|
||||
* pSrcPixmap as an argument -- if it's needed in this function, it should
|
||||
* be stored in the driver private during PrepareCopy(). As with Solid(),
|
||||
* the coordinates are in the coordinate space of each pixmap, so the driver
|
||||
* will need to set up source and destination pitches and offsets from those
|
||||
* pixmaps, probably using exaGetPixmapOffset() and exaGetPixmapPitch().
|
||||
*
|
||||
* This call is required if PrepareCopy ever succeeds.
|
||||
*/
|
||||
void (*Copy) (PixmapPtr pDstPixmap,
|
||||
int srcX,
|
||||
int srcY, int dstX, int dstY, int width, int height);
|
||||
|
||||
/**
|
||||
* DoneCopy() finishes a set of copies.
|
||||
*
|
||||
* @param pPixmap destination pixmap.
|
||||
*
|
||||
* The DoneCopy() call is called at the end of a series of consecutive
|
||||
* Copy() calls following a successful PrepareCopy(). This allows drivers
|
||||
* to finish up emitting drawing commands that were buffered, or clean up
|
||||
* state from PrepareCopy().
|
||||
*
|
||||
* This call is required if PrepareCopy() ever succeeds.
|
||||
*/
|
||||
void (*DoneCopy) (PixmapPtr pDstPixmap);
|
||||
/** @} */
|
||||
|
||||
/** @name Composite
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* CheckComposite() checks to see if a composite operation could be
|
||||
* accelerated.
|
||||
*
|
||||
* @param op Render operation
|
||||
* @param pSrcPicture source Picture
|
||||
* @param pMaskPicture mask picture
|
||||
* @param pDstPicture destination Picture
|
||||
*
|
||||
* The CheckComposite() call checks if the driver could handle acceleration
|
||||
* of op with the given source, mask, and destination pictures. This allows
|
||||
* drivers to check source and destination formats, supported operations,
|
||||
* transformations, and component alpha state, and send operations it can't
|
||||
* support to software rendering early on. This avoids costly pixmap
|
||||
* migration to the wrong places when the driver can't accelerate
|
||||
* operations. Note that because migration hasn't happened, the driver
|
||||
* can't know during CheckComposite() what the offsets and pitches of the
|
||||
* pixmaps are going to be.
|
||||
*
|
||||
* See PrepareComposite() for more details on likely issues that drivers
|
||||
* will have in accelerating Composite operations.
|
||||
*
|
||||
* The CheckComposite() call is recommended if PrepareComposite() is
|
||||
* implemented, but is not required.
|
||||
*/
|
||||
Bool (*CheckComposite) (int op,
|
||||
PicturePtr pSrcPicture,
|
||||
PicturePtr pMaskPicture, PicturePtr pDstPicture);
|
||||
|
||||
/**
|
||||
* PrepareComposite() sets up the driver for doing a Composite operation
|
||||
* described in the Render extension protocol spec.
|
||||
*
|
||||
* @param op Render operation
|
||||
* @param pSrcPicture source Picture
|
||||
* @param pMaskPicture mask picture
|
||||
* @param pDstPicture destination Picture
|
||||
* @param pSrc source pixmap
|
||||
* @param pMask mask pixmap
|
||||
* @param pDst destination pixmap
|
||||
*
|
||||
* This call should set up the driver for doing a series of Composite
|
||||
* operations, as described in the Render protocol spec, with the given
|
||||
* pSrcPicture, pMaskPicture, and pDstPicture. The pSrc, pMask, and
|
||||
* pDst are the pixmaps containing the pixel data, and should be used for
|
||||
* setting the offset and pitch used for the coordinate spaces for each of
|
||||
* the Pictures.
|
||||
*
|
||||
* Notes on interpreting Picture structures:
|
||||
* - The Picture structures will always have a valid pDrawable.
|
||||
* - The Picture structures will never have alphaMap set.
|
||||
* - The mask Picture (and therefore pMask) may be NULL, in which case the
|
||||
* operation is simply src OP dst instead of src IN mask OP dst, and
|
||||
* mask coordinates should be ignored.
|
||||
* - pMarkPicture may have componentAlpha set, which greatly changes
|
||||
* the behavior of the Composite operation. componentAlpha has no effect
|
||||
* when set on pSrcPicture or pDstPicture.
|
||||
* - The source and mask Pictures may have a transformation set
|
||||
* (Picture->transform != NULL), which means that the source coordinates
|
||||
* should be transformed by that transformation, resulting in scaling,
|
||||
* rotation, etc. The PictureTransformPoint() call can transform
|
||||
* coordinates for you. Transforms have no effect on Pictures when used
|
||||
* as a destination.
|
||||
* - The source and mask pictures may have a filter set. PictFilterNearest
|
||||
* and PictFilterBilinear are defined in the Render protocol, but others
|
||||
* may be encountered, and must be handled correctly (usually by
|
||||
* PrepareComposite failing, and falling back to software). Filters have
|
||||
* no effect on Pictures when used as a destination.
|
||||
* - The source and mask Pictures may have repeating set, which must be
|
||||
* respected. Many chipsets will be unable to support repeating on
|
||||
* pixmaps that have a width or height that is not a power of two.
|
||||
*
|
||||
* If your hardware can't support source pictures (textures) with
|
||||
* non-power-of-two pitches, you should set #EXA_OFFSCREEN_ALIGN_POT.
|
||||
*
|
||||
* Note that many drivers will need to store some of the data in the driver
|
||||
* private record, for sending to the hardware with each drawing command.
|
||||
*
|
||||
* The PrepareComposite() call is not required. However, it is highly
|
||||
* recommended for performance of antialiased font rendering and performance
|
||||
* of cairo applications. Failure results in a fallback to software
|
||||
* rendering.
|
||||
*/
|
||||
Bool (*PrepareComposite) (int op,
|
||||
PicturePtr pSrcPicture,
|
||||
PicturePtr pMaskPicture,
|
||||
PicturePtr pDstPicture,
|
||||
PixmapPtr pSrc, PixmapPtr pMask, PixmapPtr pDst);
|
||||
|
||||
/**
|
||||
* Composite() performs a Composite operation set up in the last
|
||||
* PrepareComposite() call.
|
||||
*
|
||||
* @param pDstPixmap destination pixmap
|
||||
* @param srcX source X coordinate
|
||||
* @param srcY source Y coordinate
|
||||
* @param maskX source X coordinate
|
||||
* @param maskY source Y coordinate
|
||||
* @param dstX destination X coordinate
|
||||
* @param dstY destination Y coordinate
|
||||
* @param width destination rectangle width
|
||||
* @param height destination rectangle height
|
||||
*
|
||||
* Performs the Composite operation set up by the last PrepareComposite()
|
||||
* call, to the rectangle from (dstX, dstY) to (dstX + width, dstY + height)
|
||||
* in the destination Pixmap. Note that if a transformation was set on
|
||||
* the source or mask Pictures, the source rectangles may not be the same
|
||||
* size as the destination rectangles and filtering. Getting the coordinate
|
||||
* transformation right at the subpixel level can be tricky, and rendercheck
|
||||
* can test this for you.
|
||||
*
|
||||
* This call is required if PrepareComposite() ever succeeds.
|
||||
*/
|
||||
void (*Composite) (PixmapPtr pDst,
|
||||
int srcX,
|
||||
int srcY,
|
||||
int maskX,
|
||||
int maskY, int dstX, int dstY, int width, int height);
|
||||
|
||||
/**
|
||||
* DoneComposite() finishes a set of Composite operations.
|
||||
*
|
||||
* @param pPixmap destination pixmap.
|
||||
*
|
||||
* The DoneComposite() call is called at the end of a series of consecutive
|
||||
* Composite() calls following a successful PrepareComposite(). This allows
|
||||
* drivers to finish up emitting drawing commands that were buffered, or
|
||||
* clean up state from PrepareComposite().
|
||||
*
|
||||
* This call is required if PrepareComposite() ever succeeds.
|
||||
*/
|
||||
void (*DoneComposite) (PixmapPtr pDst);
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* UploadToScreen() loads a rectangle of data from src into pDst.
|
||||
*
|
||||
* @param pDst destination pixmap
|
||||
* @param x destination X coordinate.
|
||||
* @param y destination Y coordinate
|
||||
* @param width width of the rectangle to be copied
|
||||
* @param height height of the rectangle to be copied
|
||||
* @param src pointer to the beginning of the source data
|
||||
* @param src_pitch pitch (in bytes) of the lines of source data.
|
||||
*
|
||||
* UploadToScreen() copies data in system memory beginning at src (with
|
||||
* pitch src_pitch) into the destination pixmap from (x, y) to
|
||||
* (x + width, y + height). This is typically done with hostdata uploads,
|
||||
* where the CPU sets up a blit command on the hardware with instructions
|
||||
* that the blit data will be fed through some sort of aperture on the card.
|
||||
*
|
||||
* If UploadToScreen() is performed asynchronously, it is up to the driver
|
||||
* to call exaMarkSync(). This is in contrast to most other acceleration
|
||||
* calls in EXA.
|
||||
*
|
||||
* UploadToScreen() can aid in pixmap migration, but is most important for
|
||||
* the performance of exaGlyphs() (antialiased font drawing) by allowing
|
||||
* pipelining of data uploads, avoiding a sync of the card after each glyph.
|
||||
*
|
||||
* @return TRUE if the driver successfully uploaded the data. FALSE
|
||||
* indicates that EXA should fall back to doing the upload in software.
|
||||
*
|
||||
* UploadToScreen() is not required, but is recommended if Composite
|
||||
* acceleration is supported.
|
||||
*/
|
||||
Bool (*UploadToScreen) (PixmapPtr pDst,
|
||||
int x,
|
||||
int y, int w, int h, char *src, int src_pitch);
|
||||
|
||||
/**
|
||||
* UploadToScratch() is no longer used and will be removed next time the EXA
|
||||
* major version needs to be bumped.
|
||||
*/
|
||||
Bool (*UploadToScratch) (PixmapPtr pSrc, PixmapPtr pDst);
|
||||
|
||||
/**
|
||||
* DownloadFromScreen() loads a rectangle of data from pSrc into dst
|
||||
*
|
||||
* @param pSrc source pixmap
|
||||
* @param x source X coordinate.
|
||||
* @param y source Y coordinate
|
||||
* @param width width of the rectangle to be copied
|
||||
* @param height height of the rectangle to be copied
|
||||
* @param dst pointer to the beginning of the destination data
|
||||
* @param dst_pitch pitch (in bytes) of the lines of destination data.
|
||||
*
|
||||
* DownloadFromScreen() copies data from offscreen memory in pSrc from
|
||||
* (x, y) to (x + width, y + height), to system memory starting at
|
||||
* dst (with pitch dst_pitch). This would usually be done
|
||||
* using scatter-gather DMA, supported by a DRM call, or by blitting to AGP
|
||||
* and then synchronously reading from AGP. Because the implementation
|
||||
* might be synchronous, EXA leaves it up to the driver to call
|
||||
* exaMarkSync() if DownloadFromScreen() was asynchronous. This is in
|
||||
* contrast to most other acceleration calls in EXA.
|
||||
*
|
||||
* DownloadFromScreen() can aid in the largest bottleneck in pixmap
|
||||
* migration, which is the read from framebuffer when evicting pixmaps from
|
||||
* framebuffer memory. Thus, it is highly recommended, even though
|
||||
* implementations are typically complicated.
|
||||
*
|
||||
* @return TRUE if the driver successfully downloaded the data. FALSE
|
||||
* indicates that EXA should fall back to doing the download in software.
|
||||
*
|
||||
* DownloadFromScreen() is not required, but is highly recommended.
|
||||
*/
|
||||
Bool (*DownloadFromScreen) (PixmapPtr pSrc,
|
||||
int x, int y,
|
||||
int w, int h, char *dst, int dst_pitch);
|
||||
|
||||
/**
|
||||
* MarkSync() requests that the driver mark a synchronization point,
|
||||
* returning an driver-defined integer marker which could be requested for
|
||||
* synchronization to later in WaitMarker(). This might be used in the
|
||||
* future to avoid waiting for full hardware stalls before accessing pixmap
|
||||
* data with the CPU, but is not important in the current incarnation of
|
||||
* EXA.
|
||||
*
|
||||
* Note that drivers should call exaMarkSync() when they have done some
|
||||
* acceleration, rather than their own MarkSync() handler, as otherwise EXA
|
||||
* will be unaware of the driver's acceleration and not sync to it during
|
||||
* fallbacks.
|
||||
*
|
||||
* MarkSync() is optional.
|
||||
*/
|
||||
int (*MarkSync) (ScreenPtr pScreen);
|
||||
|
||||
/**
|
||||
* WaitMarker() waits for all rendering before the given marker to have
|
||||
* completed. If the driver does not implement MarkSync(), marker is
|
||||
* meaningless, and all rendering by the hardware should be completed before
|
||||
* WaitMarker() returns.
|
||||
*
|
||||
* Note that drivers should call exaWaitSync() to wait for all acceleration
|
||||
* to finish, as otherwise EXA will be unaware of the driver having
|
||||
* synchronized, resulting in excessive WaitMarker() calls.
|
||||
*
|
||||
* WaitMarker() is required of all drivers.
|
||||
*/
|
||||
void (*WaitMarker) (ScreenPtr pScreen, int marker);
|
||||
|
||||
/** @{ */
|
||||
/**
|
||||
* PrepareAccess() is called before CPU access to an offscreen pixmap.
|
||||
*
|
||||
* @param pPix the pixmap being accessed
|
||||
* @param index the index of the pixmap being accessed.
|
||||
*
|
||||
* PrepareAccess() will be called before CPU access to an offscreen pixmap.
|
||||
* This can be used to set up hardware surfaces for byteswapping or
|
||||
* untiling, or to adjust the pixmap's devPrivate.ptr for the purpose of
|
||||
* making CPU access use a different aperture.
|
||||
*
|
||||
* The index is one of #EXA_PREPARE_DEST, #EXA_PREPARE_SRC,
|
||||
* #EXA_PREPARE_MASK, #EXA_PREPARE_AUX_DEST, #EXA_PREPARE_AUX_SRC, or
|
||||
* #EXA_PREPARE_AUX_MASK. Since only up to #EXA_NUM_PREPARE_INDICES pixmaps
|
||||
* will have PrepareAccess() called on them per operation, drivers can have
|
||||
* a small, statically-allocated space to maintain state for PrepareAccess()
|
||||
* and FinishAccess() in. Note that PrepareAccess() is only called once per
|
||||
* pixmap and operation, regardless of whether the pixmap is used as a
|
||||
* destination and/or source, and the index may not reflect the usage.
|
||||
*
|
||||
* PrepareAccess() may fail. An example might be the case of hardware that
|
||||
* can set up 1 or 2 surfaces for CPU access, but not 3. If PrepareAccess()
|
||||
* fails, EXA will migrate the pixmap to system memory.
|
||||
* DownloadFromScreen() must be implemented and must not fail if a driver
|
||||
* wishes to fail in PrepareAccess(). PrepareAccess() must not fail when
|
||||
* pPix is the visible screen, because the visible screen can not be
|
||||
* migrated.
|
||||
*
|
||||
* @return TRUE if PrepareAccess() successfully prepared the pixmap for CPU
|
||||
* drawing.
|
||||
* @return FALSE if PrepareAccess() is unsuccessful and EXA should use
|
||||
* DownloadFromScreen() to mitigate the pixmap out.
|
||||
*/
|
||||
Bool (*PrepareAccess) (PixmapPtr pPix, int index);
|
||||
|
||||
/**
|
||||
* FinishAccess() is called after CPU access to an offscreen pixmap.
|
||||
*
|
||||
* @param pPix the pixmap being accessed
|
||||
* @param index the index of the pixmap being accessed.
|
||||
*
|
||||
* FinishAccess() will be called after finishing CPU access of an offscreen
|
||||
* pixmap set up by PrepareAccess(). Note that the FinishAccess() will not be
|
||||
* called if PrepareAccess() failed and the pixmap was migrated out.
|
||||
*/
|
||||
void (*FinishAccess) (PixmapPtr pPix, int index);
|
||||
|
||||
/**
|
||||
* PixmapIsOffscreen() is an optional driver replacement to
|
||||
* exaPixmapHasGpuCopy(). Set to NULL if you want the standard behaviour
|
||||
* of exaPixmapHasGpuCopy().
|
||||
*
|
||||
* @param pPix the pixmap
|
||||
* @return TRUE if the given drawable is in framebuffer memory.
|
||||
*
|
||||
* exaPixmapHasGpuCopy() is used to determine if a pixmap is in offscreen
|
||||
* memory, meaning that acceleration could probably be done to it, and that it
|
||||
* will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it
|
||||
* with the CPU.
|
||||
*
|
||||
*
|
||||
*/
|
||||
Bool (*PixmapIsOffscreen) (PixmapPtr pPix);
|
||||
|
||||
/** @name PrepareAccess() and FinishAccess() indices
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* EXA_PREPARE_DEST is the index for a pixmap that may be drawn to or
|
||||
* read from.
|
||||
*/
|
||||
#define EXA_PREPARE_DEST 0
|
||||
/**
|
||||
* EXA_PREPARE_SRC is the index for a pixmap that may be read from
|
||||
*/
|
||||
#define EXA_PREPARE_SRC 1
|
||||
/**
|
||||
* EXA_PREPARE_SRC is the index for a second pixmap that may be read
|
||||
* from.
|
||||
*/
|
||||
#define EXA_PREPARE_MASK 2
|
||||
/**
|
||||
* EXA_PREPARE_AUX* are additional indices for other purposes, e.g.
|
||||
* separate alpha maps with Composite operations.
|
||||
*/
|
||||
#define EXA_PREPARE_AUX_DEST 3
|
||||
#define EXA_PREPARE_AUX_SRC 4
|
||||
#define EXA_PREPARE_AUX_MASK 5
|
||||
#define EXA_NUM_PREPARE_INDICES 6
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* maxPitchPixels controls the pitch limitation for rendering from
|
||||
* the card.
|
||||
* The driver should never receive a request for rendering a pixmap
|
||||
* that has a pitch (in pixels) beyond maxPitchPixels.
|
||||
*
|
||||
* Setting this field is optional -- if your hardware doesn't have
|
||||
* a pitch limitation in pixels, don't set this. If neither this value
|
||||
* nor maxPitchBytes is set, then maxPitchPixels is set to maxX.
|
||||
* If set, it must not be smaller than maxX.
|
||||
*
|
||||
* @sa maxPitchBytes
|
||||
*/
|
||||
int maxPitchPixels;
|
||||
|
||||
/**
|
||||
* maxPitchBytes controls the pitch limitation for rendering from
|
||||
* the card.
|
||||
* The driver should never receive a request for rendering a pixmap
|
||||
* that has a pitch (in bytes) beyond maxPitchBytes.
|
||||
*
|
||||
* Setting this field is optional -- if your hardware doesn't have
|
||||
* a pitch limitation in bytes, don't set this.
|
||||
* If set, it must not be smaller than maxX * 4.
|
||||
* There's no default value for maxPitchBytes.
|
||||
*
|
||||
* @sa maxPitchPixels
|
||||
*/
|
||||
int maxPitchBytes;
|
||||
|
||||
/* Hooks to allow driver to its own pixmap memory management */
|
||||
void *(*CreatePixmap) (ScreenPtr pScreen, int size, int align);
|
||||
void (*DestroyPixmap) (ScreenPtr pScreen, void *driverPriv);
|
||||
/**
|
||||
* Returning a pixmap with non-NULL devPrivate.ptr implies a pixmap which is
|
||||
* not offscreen, which will never be accelerated and Prepare/FinishAccess won't
|
||||
* be called.
|
||||
*/
|
||||
Bool (*ModifyPixmapHeader) (PixmapPtr pPixmap, int width, int height,
|
||||
int depth, int bitsPerPixel, int devKind,
|
||||
void *pPixData);
|
||||
|
||||
/* hooks for drivers with tiling support:
|
||||
* driver MUST fill out new_fb_pitch with valid pitch of pixmap
|
||||
*/
|
||||
void *(*CreatePixmap2) (ScreenPtr pScreen, int width, int height,
|
||||
int depth, int usage_hint, int bitsPerPixel,
|
||||
int *new_fb_pitch);
|
||||
/** @} */
|
||||
Bool (*SharePixmapBacking)(PixmapPtr pPixmap, ScreenPtr secondary, void **handle_p);
|
||||
|
||||
Bool (*SetSharedPixmapBacking)(PixmapPtr pPixmap, void *handle);
|
||||
|
||||
} ExaDriverRec, *ExaDriverPtr;
|
||||
|
||||
/** @name EXA driver flags
|
||||
* @{
|
||||
*/
|
||||
/**
|
||||
* EXA_OFFSCREEN_PIXMAPS indicates to EXA that the driver can support
|
||||
* offscreen pixmaps.
|
||||
*/
|
||||
#define EXA_OFFSCREEN_PIXMAPS (1 << 0)
|
||||
|
||||
/**
|
||||
* EXA_OFFSCREEN_ALIGN_POT indicates to EXA that the driver needs pixmaps
|
||||
* to have a power-of-two pitch.
|
||||
*/
|
||||
#define EXA_OFFSCREEN_ALIGN_POT (1 << 1)
|
||||
|
||||
/**
|
||||
* EXA_TWO_BITBLT_DIRECTIONS indicates to EXA that the driver can only
|
||||
* support copies that are (left-to-right, top-to-bottom) or
|
||||
* (right-to-left, bottom-to-top).
|
||||
*/
|
||||
#define EXA_TWO_BITBLT_DIRECTIONS (1 << 2)
|
||||
|
||||
/**
|
||||
* EXA_HANDLES_PIXMAPS indicates to EXA that the driver can handle
|
||||
* all pixmap addressing and migration.
|
||||
*/
|
||||
#define EXA_HANDLES_PIXMAPS (1 << 3)
|
||||
|
||||
/**
|
||||
* EXA_SUPPORTS_PREPARE_AUX indicates to EXA that the driver can handle the
|
||||
* EXA_PREPARE_AUX* indices in the Prepare/FinishAccess hooks. If there are no
|
||||
* such hooks, this flag has no effect.
|
||||
*/
|
||||
#define EXA_SUPPORTS_PREPARE_AUX (1 << 4)
|
||||
|
||||
/**
|
||||
* EXA_SUPPORTS_OFFSCREEN_OVERLAPS indicates to EXA that the driver Copy hooks
|
||||
* can handle the source and destination occupying overlapping offscreen memory
|
||||
* areas. This allows the offscreen memory defragmentation code to defragment
|
||||
* areas where the defragmented position overlaps the fragmented position.
|
||||
*
|
||||
* Typically this is supported by traditional 2D engines but not by 3D engines.
|
||||
*/
|
||||
#define EXA_SUPPORTS_OFFSCREEN_OVERLAPS (1 << 5)
|
||||
|
||||
/**
|
||||
* EXA_MIXED_PIXMAPS will hide unacceleratable pixmaps from drivers and manage the
|
||||
* problem known software fallbacks like trapezoids. This only migrates pixmaps one way
|
||||
* into a driver pixmap and then pins it.
|
||||
*/
|
||||
#define EXA_MIXED_PIXMAPS (1 << 6)
|
||||
|
||||
/** @} */
|
||||
|
||||
/* in exa.c */
|
||||
extern _X_EXPORT ExaDriverPtr exaDriverAlloc(void);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo);
|
||||
|
||||
extern _X_EXPORT void
|
||||
exaDriverFini(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT void
|
||||
exaMarkSync(ScreenPtr pScreen);
|
||||
extern _X_EXPORT void
|
||||
exaWaitSync(ScreenPtr pScreen);
|
||||
|
||||
extern _X_EXPORT unsigned long
|
||||
exaGetPixmapOffset(PixmapPtr pPix);
|
||||
|
||||
extern _X_EXPORT unsigned long
|
||||
exaGetPixmapPitch(PixmapPtr pPix);
|
||||
|
||||
extern _X_EXPORT void *exaGetPixmapDriverPrivate(PixmapPtr p);
|
||||
|
||||
/* in exa_offscreen.c */
|
||||
extern _X_EXPORT ExaOffscreenArea *exaOffscreenAlloc(ScreenPtr pScreen,
|
||||
int size, int align,
|
||||
Bool locked,
|
||||
ExaOffscreenSaveProc save,
|
||||
void *privData);
|
||||
|
||||
extern _X_EXPORT ExaOffscreenArea *exaOffscreenFree(ScreenPtr pScreen,
|
||||
ExaOffscreenArea * area);
|
||||
|
||||
extern _X_EXPORT void
|
||||
exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
exaDrawableIsOffscreen(DrawablePtr pDrawable);
|
||||
|
||||
/* in exa.c */
|
||||
extern _X_EXPORT void
|
||||
exaMoveInPixmap(PixmapPtr pPixmap);
|
||||
|
||||
/* in exa_unaccel.c */
|
||||
extern _X_EXPORT CARD32
|
||||
exaGetPixmapFirstPixel(PixmapPtr pPixmap);
|
||||
|
||||
/**
|
||||
* Returns TRUE if the given planemask covers all the significant bits in the
|
||||
* pixel values for pDrawable.
|
||||
*/
|
||||
#define EXA_PM_IS_SOLID(_pDrawable, _pm) \
|
||||
(((_pm) & FbFullMask((_pDrawable)->depth)) == \
|
||||
FbFullMask((_pDrawable)->depth))
|
||||
|
||||
#endif /* EXA_H */
|
||||
@@ -0,0 +1,125 @@
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
||||
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 the above listed
|
||||
copyright holder(s) not be used in advertising or publicity pertaining
|
||||
to distribution of the software without specific, written prior
|
||||
permission.
|
||||
|
||||
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
|
||||
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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.
|
||||
|
||||
********************************************************/
|
||||
|
||||
/********************************************************************
|
||||
* Interface of 'exevents.c'
|
||||
*/
|
||||
|
||||
#ifndef EXEVENTS_H
|
||||
#define EXEVENTS_H
|
||||
|
||||
#include <X11/extensions/XIproto.h>
|
||||
#include "inputstr.h"
|
||||
|
||||
/***************************************************************
|
||||
* Interface available to drivers *
|
||||
***************************************************************/
|
||||
|
||||
/**
|
||||
* Scroll flags for ::SetScrollValuator.
|
||||
*/
|
||||
enum ScrollFlags {
|
||||
SCROLL_FLAG_NONE = 0,
|
||||
/**
|
||||
* Do not emulate legacy button events for valuator events on this axis.
|
||||
*/
|
||||
SCROLL_FLAG_DONT_EMULATE = (1 << 1),
|
||||
/**
|
||||
* This axis is the preferred axis for valuator emulation for this axis'
|
||||
* scroll type.
|
||||
*/
|
||||
SCROLL_FLAG_PREFERRED = (1 << 2)
|
||||
};
|
||||
|
||||
extern _X_EXPORT int InitProximityClassDeviceStruct(DeviceIntPtr /* dev */ );
|
||||
|
||||
extern _X_EXPORT Bool InitValuatorAxisStruct(DeviceIntPtr /* dev */ ,
|
||||
int /* axnum */ ,
|
||||
Atom /* label */ ,
|
||||
int /* minval */ ,
|
||||
int /* maxval */ ,
|
||||
int /* resolution */ ,
|
||||
int /* min_res */ ,
|
||||
int /* max_res */ ,
|
||||
int /* mode */ );
|
||||
|
||||
extern _X_EXPORT Bool SetScrollValuator(DeviceIntPtr /* dev */ ,
|
||||
int /* axnum */ ,
|
||||
enum ScrollType /* type */ ,
|
||||
double /* increment */ ,
|
||||
int /* flags */ );
|
||||
|
||||
extern _X_EXPORT int XIDeleteDeviceProperty(DeviceIntPtr /* device */ ,
|
||||
Atom /* property */ ,
|
||||
Bool /* fromClient */
|
||||
);
|
||||
|
||||
extern _X_EXPORT int XIChangeDeviceProperty(DeviceIntPtr /* dev */ ,
|
||||
Atom /* property */ ,
|
||||
Atom /* type */ ,
|
||||
int /* format */ ,
|
||||
int /* mode */ ,
|
||||
unsigned long /* len */ ,
|
||||
const void * /* value */ ,
|
||||
Bool /* sendevent */
|
||||
);
|
||||
|
||||
extern _X_EXPORT int XIGetDeviceProperty(DeviceIntPtr /* dev */ ,
|
||||
Atom /* property */ ,
|
||||
XIPropertyValuePtr * /* value */
|
||||
);
|
||||
|
||||
extern _X_EXPORT int XISetDevicePropertyDeletable(DeviceIntPtr /* dev */ ,
|
||||
Atom /* property */ ,
|
||||
Bool /* deletable */
|
||||
);
|
||||
|
||||
extern _X_EXPORT long XIRegisterPropertyHandler(DeviceIntPtr dev,
|
||||
int (*SetProperty) (DeviceIntPtr
|
||||
dev,
|
||||
Atom
|
||||
property,
|
||||
XIPropertyValuePtr
|
||||
prop,
|
||||
BOOL
|
||||
checkonly),
|
||||
int (*GetProperty) (DeviceIntPtr
|
||||
dev,
|
||||
Atom
|
||||
property),
|
||||
int (*DeleteProperty)
|
||||
(DeviceIntPtr dev,
|
||||
Atom property)
|
||||
);
|
||||
|
||||
extern _X_EXPORT Atom XIGetKnownProperty(const char *name);
|
||||
|
||||
extern _X_EXPORT DeviceIntPtr XIGetDevice(xEvent *ev);
|
||||
|
||||
/****************************************************************************
|
||||
* End of driver interface *
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* EXEVENTS_H */
|
||||
@@ -0,0 +1,104 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 (c) 1997-2003 by The XFree86 Project, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
|
||||
* and author(s) 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 copyright holder(s) and author(s).
|
||||
*/
|
||||
|
||||
#ifndef EXTENSION_H
|
||||
#define EXTENSION_H
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include "xlibre_ptrtypes.h"
|
||||
#include "dixstruct.h"
|
||||
|
||||
typedef void (*InitExtension) (void);
|
||||
|
||||
typedef struct {
|
||||
InitExtension initFunc;
|
||||
const char *name;
|
||||
Bool *disablePtr;
|
||||
} ExtensionModule;
|
||||
|
||||
extern _X_EXPORT unsigned short StandardMinorOpcode(ClientPtr /*client */ );
|
||||
|
||||
extern _X_EXPORT Bool EnableDisableExtension(const char *name, Bool enable);
|
||||
|
||||
extern _X_EXPORT void EnableDisableExtensionError(const char *name,
|
||||
Bool enable);
|
||||
|
||||
extern _X_EXPORT void InitExtensions(int argc, char **argv);
|
||||
|
||||
extern _X_EXPORT void CloseDownExtensions(void);
|
||||
|
||||
extern _X_EXPORT void LoadExtensionList(const ExtensionModule ext[],
|
||||
int listSize, Bool external);
|
||||
|
||||
#endif /* EXTENSION_H */
|
||||
@@ -0,0 +1,68 @@
|
||||
/************************************************************
|
||||
|
||||
Copyright 1996 by Thomas E. Dickey <dickey@clark.net>
|
||||
|
||||
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 the above listed
|
||||
copyright holder(s) not be used in advertising or publicity pertaining
|
||||
to distribution of the software without specific, written prior
|
||||
permission.
|
||||
|
||||
THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
|
||||
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) 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 (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is furnished to do
|
||||
* so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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, FIT-
|
||||
* NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* XFREE86 PROJECT 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 XFree86 Project 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 XFree86 Project.
|
||||
*/
|
||||
|
||||
#ifndef EXTINIT_H
|
||||
#define EXTINIT_H
|
||||
|
||||
#include "extnsionst.h"
|
||||
|
||||
/* required by: libglx */
|
||||
extern _X_EXPORT Bool noCompositeExtension;
|
||||
|
||||
/* required by: several video drivers (eg. vmware, sis and nvidia proprietary) */
|
||||
#ifdef XINERAMA
|
||||
extern _X_EXPORT Bool noPanoramiXExtension;
|
||||
#endif /* XINERAMA */
|
||||
|
||||
#if defined(XV)
|
||||
extern _X_EXPORT Bool noXvExtension;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,98 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 EXTENSIONSTRUCT_H
|
||||
#define EXTENSIONSTRUCT_H
|
||||
|
||||
#include "xlibre_ptrtypes.h"
|
||||
#include "extension.h"
|
||||
#include "privates.h"
|
||||
|
||||
typedef struct _ExtensionEntry {
|
||||
int index;
|
||||
void (*CloseDown) ( /* called at server shutdown */
|
||||
struct _ExtensionEntry * /* extension */ );
|
||||
const char *name; /* extension name */
|
||||
int base; /* base request number */
|
||||
int eventBase;
|
||||
int eventLast;
|
||||
int errorBase;
|
||||
int errorLast;
|
||||
void *extPrivate;
|
||||
unsigned short (*MinorOpcode) ( /* called for errors */
|
||||
ClientPtr /* client */ );
|
||||
PrivateRec *devPrivates;
|
||||
} ExtensionEntry;
|
||||
|
||||
/*
|
||||
* The arguments may be different for extension event swapping functions.
|
||||
* Deal with this by casting when initializing the event's EventSwapVector[]
|
||||
* entries.
|
||||
*/
|
||||
typedef void (*EventSwapPtr) (xEvent *, xEvent *);
|
||||
|
||||
extern _X_EXPORT EventSwapPtr EventSwapVector[128];
|
||||
|
||||
extern _X_EXPORT void
|
||||
NotImplemented( /* FIXME: this may move to another file... */
|
||||
xEvent *, xEvent *) _X_NORETURN;
|
||||
|
||||
extern _X_EXPORT ExtensionEntry *
|
||||
AddExtension(const char * /*name */ ,
|
||||
int /*NumEvents */ ,
|
||||
int /*NumErrors */ ,
|
||||
int (* /*MainProc */ )(ClientPtr /*client */ ),
|
||||
int (* /*SwappedMainProc */ )(ClientPtr /*client */ ),
|
||||
void (* /*CloseDownProc */ )(ExtensionEntry * /*extension */ ),
|
||||
unsigned short (* /*MinorOpcodeProc */ )(ClientPtr /*client */ )
|
||||
);
|
||||
|
||||
extern _X_EXPORT ExtensionEntry *
|
||||
CheckExtension(const char *extname);
|
||||
extern _X_EXPORT ExtensionEntry *
|
||||
GetExtensionEntry(int major);
|
||||
|
||||
#endif /* EXTENSIONSTRUCT_H */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
||||
|
||||
#ifndef _FBDEVHW_H_
|
||||
#define _FBDEVHW_H_
|
||||
|
||||
#include "xf86str.h"
|
||||
|
||||
#define FBDEVHW_PACKED_PIXELS 0 /* Packed Pixels */
|
||||
#define FBDEVHW_INTERLEAVED_PLANES 2 /* Interleaved planes */
|
||||
#define FBDEVHW_TEXT 3 /* Text/attributes */
|
||||
#define FBDEVHW_VGA_PLANES 4 /* EGA/VGA planes */
|
||||
|
||||
extern _X_EXPORT Bool fbdevHWProbe(struct pci_device *pPci, const char *device,
|
||||
char **namep);
|
||||
extern _X_EXPORT Bool fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci,
|
||||
const char *device);
|
||||
|
||||
extern _X_EXPORT char *fbdevHWGetName(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT int fbdevHWGetDepth(ScrnInfoPtr pScrn, int *fbbpp);
|
||||
extern _X_EXPORT int fbdevHWGetLineLength(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT int fbdevHWGetType(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT int fbdevHWGetVidmem(ScrnInfoPtr pScrn);
|
||||
|
||||
extern _X_EXPORT void *fbdevHWMapVidmem(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT int fbdevHWLinearOffset(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT Bool fbdevHWUnmapVidmem(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT void *fbdevHWMapMMIO(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT Bool fbdevHWUnmapMMIO(ScrnInfoPtr pScrn);
|
||||
|
||||
extern _X_EXPORT void fbdevHWSetVideoModes(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT void fbdevHWUseBuildinMode(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT Bool fbdevHWModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode);
|
||||
extern _X_EXPORT void fbdevHWSave(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT void fbdevHWRestore(ScrnInfoPtr pScrn);
|
||||
|
||||
extern _X_EXPORT void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors,
|
||||
int *indices, LOCO * colors,
|
||||
VisualPtr pVisual);
|
||||
|
||||
extern _X_EXPORT ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode,
|
||||
Bool verbose, int flags);
|
||||
extern _X_EXPORT Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode);
|
||||
extern _X_EXPORT void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y);
|
||||
extern _X_EXPORT Bool fbdevHWEnterVT(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT void fbdevHWLeaveVT(ScrnInfoPtr pScrn);
|
||||
extern _X_EXPORT void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags);
|
||||
|
||||
extern _X_EXPORT Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode);
|
||||
|
||||
extern _X_EXPORT xf86SwitchModeProc *fbdevHWSwitchModeWeak(void);
|
||||
extern _X_EXPORT xf86AdjustFrameProc *fbdevHWAdjustFrameWeak(void);
|
||||
extern _X_EXPORT xf86LeaveVTProc *fbdevHWLeaveVTWeak(void);
|
||||
extern _X_EXPORT xf86ValidModeProc *fbdevHWValidModeWeak(void);
|
||||
extern _X_EXPORT xf86DPMSSetProc *fbdevHWDPMSSetWeak(void);
|
||||
extern _X_EXPORT xf86LoadPaletteProc *fbdevHWLoadPaletteWeak(void);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
*
|
||||
* Copyright © 2000 SuSE, Inc.
|
||||
*
|
||||
* 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 SuSE not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. SuSE makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
||||
* 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.
|
||||
*
|
||||
* Author: Keith Packard, SuSE, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _FBOVERLAY_H_
|
||||
#define _FBOVERLAY_H_
|
||||
|
||||
#include "privates.h"
|
||||
|
||||
extern _X_EXPORT DevPrivateKey fbOverlayGetScreenPrivateKey(void);
|
||||
|
||||
#ifndef FB_OVERLAY_MAX
|
||||
#define FB_OVERLAY_MAX 2
|
||||
#endif
|
||||
|
||||
typedef void (*fbOverlayPaintKeyProc) (DrawablePtr, RegionPtr, CARD32, int);
|
||||
|
||||
typedef struct _fbOverlayLayer {
|
||||
union {
|
||||
struct {
|
||||
void *pbits;
|
||||
int width;
|
||||
int depth;
|
||||
} init;
|
||||
struct {
|
||||
PixmapPtr pixmap;
|
||||
RegionRec region;
|
||||
} run;
|
||||
} u;
|
||||
CARD32 key; /* special pixel value */
|
||||
} FbOverlayLayer;
|
||||
|
||||
typedef struct _fbOverlayScrPriv {
|
||||
int nlayers;
|
||||
fbOverlayPaintKeyProc PaintKey;
|
||||
miCopyProc CopyWindow;
|
||||
FbOverlayLayer layer[FB_OVERLAY_MAX];
|
||||
} FbOverlayScrPrivRec, *FbOverlayScrPrivPtr;
|
||||
|
||||
#define fbOverlayGetScrPriv(s) \
|
||||
dixLookupPrivate(&(s)->devPrivates, fbOverlayGetScreenPrivateKey())
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
|
||||
fbOverlayFinishScreenInit(ScreenPtr pScreen,
|
||||
void *pbits1,
|
||||
void *pbits2,
|
||||
int xsize,
|
||||
int ysize,
|
||||
int dpix,
|
||||
int dpiy,
|
||||
int width1,
|
||||
int width2,
|
||||
int bpp1, int bpp2, int depth1, int depth2);
|
||||
|
||||
#endif /* _FBOVERLAY_H_ */
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
*
|
||||
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
#ifndef _FBPICT_H_
|
||||
#define _FBPICT_H_
|
||||
|
||||
#include "fb.h"
|
||||
|
||||
/* fbpict.c */
|
||||
extern _X_EXPORT void
|
||||
fbComposite(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
|
||||
|
||||
/* fbtrap.c */
|
||||
|
||||
extern _X_EXPORT void
|
||||
fbAddTraps(PicturePtr pPicture,
|
||||
INT16 xOff, INT16 yOff, int ntrap, xTrap * traps);
|
||||
|
||||
#endif /* _FBPICT_H_ */
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright © 1998 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.
|
||||
*/
|
||||
|
||||
#ifndef _FBROP_H_
|
||||
#define _FBROP_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
typedef struct _mergeRopBits {
|
||||
FbBits ca1, cx1, ca2, cx2;
|
||||
} FbMergeRopRec, *FbMergeRopPtr;
|
||||
|
||||
extern _X_EXPORT const FbMergeRopRec FbMergeRopBits[16];
|
||||
|
||||
#define FbDeclareMergeRop() FbBits _ca1, _cx1, _ca2, _cx2;
|
||||
#define FbDeclarePrebuiltMergeRop() FbBits _cca, _ccx;
|
||||
|
||||
#define FbInitializeMergeRop(alu,pm) {\
|
||||
const FbMergeRopRec *_bits; \
|
||||
_bits = &FbMergeRopBits[(alu)]; \
|
||||
_ca1 = _bits->ca1 & (pm); \
|
||||
_cx1 = _bits->cx1 | ~(pm); \
|
||||
_ca2 = _bits->ca2 & (pm); \
|
||||
_cx2 = _bits->cx2 & (pm); \
|
||||
}
|
||||
|
||||
#define FbDestInvarientRop(alu,pm) ((pm) == FB_ALLONES && \
|
||||
(((alu) >> 1 & 5) == ((alu) & 5)))
|
||||
|
||||
#define FbDestInvarientMergeRop() (_ca1 == 0 && _cx1 == 0)
|
||||
|
||||
/* AND has higher precedence than XOR */
|
||||
|
||||
#define FbDoMergeRop(src, dst) \
|
||||
(((dst) & (((src) & _ca1) ^ _cx1)) ^ (((src) & _ca2) ^ _cx2))
|
||||
|
||||
#define FbDoDestInvarientMergeRop(src) (((src) & _ca2) ^ _cx2)
|
||||
|
||||
#define FbDoMaskMergeRop(src, dst, mask) \
|
||||
(((dst) & ((((src) & _ca1) ^ _cx1) | ~(mask))) ^ ((((src) & _ca2) ^ _cx2) & (mask)))
|
||||
|
||||
#define FbDoLeftMaskByteMergeRop(dst, src, lb, l) { \
|
||||
FbBits __xor = ((src) & _ca2) ^ _cx2; \
|
||||
FbDoLeftMaskByteRRop((dst),(lb),(l),((src) & _ca1) ^ _cx1,__xor); \
|
||||
}
|
||||
|
||||
#define FbDoRightMaskByteMergeRop(dst, src, rb, r) { \
|
||||
FbBits __xor = ((src) & _ca2) ^ _cx2; \
|
||||
FbDoRightMaskByteRRop((dst),(rb),(r),((src) & _ca1) ^ _cx1,__xor); \
|
||||
}
|
||||
|
||||
#define FbDoRRop(dst, and, xor) (((dst) & (and)) ^ (xor))
|
||||
|
||||
#define FbDoMaskRRop(dst, and, xor, mask) \
|
||||
(((dst) & ((and) | ~(mask))) ^ ((xor) & (mask)))
|
||||
|
||||
/*
|
||||
* Take a single bit (0 or 1) and generate a full mask
|
||||
*/
|
||||
#define fbFillFromBit(b,t) (~((t) ((b) & 1)-1))
|
||||
|
||||
#define fbXorT(rop,fg,pm,t) ((((fg) & fbFillFromBit((rop) >> 1,t)) | \
|
||||
(~(fg) & fbFillFromBit((rop) >> 3,t))) & (pm))
|
||||
|
||||
#define fbAndT(rop,fg,pm,t) ((((fg) & fbFillFromBit ((rop) ^ ((rop)>>1),t)) | \
|
||||
(~(fg) & fbFillFromBit(((rop)>>2) ^ ((rop)>>3),t))) | \
|
||||
~(pm))
|
||||
|
||||
#define fbXor(rop,fg,pm) fbXorT((rop),(fg),(pm),FbBits)
|
||||
|
||||
#define fbAnd(rop,fg,pm) fbAndT((rop),(fg),(pm),FbBits)
|
||||
|
||||
#define fbXorStip(rop,fg,pm) fbXorT((rop),(fg),(pm),FbStip)
|
||||
|
||||
#define fbAndStip(rop,fg,pm) fbAndT((rop),(fg),(pm),FbStip)
|
||||
|
||||
/*
|
||||
* Stippling operations;
|
||||
*/
|
||||
|
||||
#define FbStippleRRop(dst, b, fa, fx, ba, bx) \
|
||||
(FbDoRRop((dst), (fa), (fx)) & (b)) | (FbDoRRop((dst), (ba), (bx)) & ~(b))
|
||||
|
||||
#define FbStippleRRopMask(dst, b, fa, fx, ba, bx, m) \
|
||||
(FbDoMaskRRop((dst), (fa), (fx), (m)) & (b)) | (FbDoMaskRRop((dst), (ba), (bx), (m)) & ~(b))
|
||||
|
||||
#define FbDoLeftMaskByteStippleRRop(dst, b, fa, fx, ba, bx, lb, l) { \
|
||||
FbBits __xor = ((fx) & (b)) | ((bx) & ~(b)); \
|
||||
FbDoLeftMaskByteRRop((dst), (lb), (l), ((fa) & (b)) | ((ba) & ~(b)), __xor); \
|
||||
}
|
||||
|
||||
#define FbDoRightMaskByteStippleRRop(dst, b, fa, fx, ba, bx, rb, r) { \
|
||||
FbBits __xor = ((fx) & (b)) | ((bx) & ~(b)); \
|
||||
FbDoRightMaskByteRRop((dst), (rb), (r), ((fa) & (b)) | ((ba) & ~(b)), __xor); \
|
||||
}
|
||||
|
||||
#define FbOpaqueStipple(b, fg, bg) (((fg) & (b)) | ((bg) & ~(b)))
|
||||
|
||||
/*
|
||||
* Compute rop for using tile code for 1-bit dest stipples; modifies
|
||||
* existing rop to flip depending on pixel values
|
||||
*/
|
||||
#define FbStipple1RopPick(alu,b) (((alu) >> (2 - (((b) & 1) << 1))) & 3)
|
||||
|
||||
#define FbOpaqueStipple1Rop(alu,fg,bg) (FbStipple1RopPick((alu),(fg)) | \
|
||||
(FbStipple1RopPick((alu),(bg)) << 2))
|
||||
|
||||
#define FbStipple1Rop(alu,fg) (FbStipple1RopPick((alu),(fg)) | 4)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
/* SPDX-License-Identifier: X11 OR MIT OR AGPL-3.0-or-later
|
||||
*
|
||||
* Copyright © 2024 Enrico Weigelt, metux IT consult <info@metux.net>
|
||||
*
|
||||
* @brief: defines needed for SetNotifyFd() as well as ospoll
|
||||
*/
|
||||
#ifndef _XSERVER_INCLUDE_FDNOTIFY_H
|
||||
#define _XSERVER_INCLUDE_FDNOTIFY_H
|
||||
|
||||
#define X_NOTIFY_NONE 0x0
|
||||
#define X_NOTIFY_READ 0x1
|
||||
#define X_NOTIFY_WRITE 0x2
|
||||
#define X_NOTIFY_ERROR 0x4 /* don't need to select for, always reported */
|
||||
|
||||
#endif /* _XSERVER_INCLUDE_FDNOTIFY_H */
|
||||
@@ -0,0 +1,218 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000-2003 by The XFree86 Project, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s)
|
||||
* and author(s) 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 copyright holder(s) and author(s).
|
||||
*/
|
||||
|
||||
/*
|
||||
This header file contains listings of STANDARD guids for video formats.
|
||||
Please do not place non-registered, or incomplete entries in this file.
|
||||
A list of some popular fourcc's are at: http://www.webartz.com/fourcc/
|
||||
For an explanation of fourcc <-> guid mappings see RFC2361.
|
||||
*/
|
||||
|
||||
#ifndef _XF86_FOURCC_H_
|
||||
#define _XF86_FOURCC_H_ 1
|
||||
|
||||
#define FOURCC_YUY2 0x32595559
|
||||
#define XVIMAGE_YUY2 \
|
||||
{ \
|
||||
FOURCC_YUY2, \
|
||||
XvYUV, \
|
||||
LSBFirst, \
|
||||
{'Y','U','Y','2', \
|
||||
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
16, \
|
||||
XvPacked, \
|
||||
1, \
|
||||
0, 0, 0, 0, \
|
||||
8, 8, 8, \
|
||||
1, 2, 2, \
|
||||
1, 1, 1, \
|
||||
{'Y','U','Y','V', \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
XvTopToBottom \
|
||||
}
|
||||
|
||||
#define FOURCC_YV12 0x32315659
|
||||
#define XVIMAGE_YV12 \
|
||||
{ \
|
||||
FOURCC_YV12, \
|
||||
XvYUV, \
|
||||
LSBFirst, \
|
||||
{'Y','V','1','2', \
|
||||
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
12, \
|
||||
XvPlanar, \
|
||||
3, \
|
||||
0, 0, 0, 0, \
|
||||
8, 8, 8, \
|
||||
1, 2, 2, \
|
||||
1, 2, 2, \
|
||||
{'Y','V','U', \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
XvTopToBottom \
|
||||
}
|
||||
|
||||
#define FOURCC_I420 0x30323449
|
||||
#define XVIMAGE_I420 \
|
||||
{ \
|
||||
FOURCC_I420, \
|
||||
XvYUV, \
|
||||
LSBFirst, \
|
||||
{'I','4','2','0', \
|
||||
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
12, \
|
||||
XvPlanar, \
|
||||
3, \
|
||||
0, 0, 0, 0, \
|
||||
8, 8, 8, \
|
||||
1, 2, 2, \
|
||||
1, 2, 2, \
|
||||
{'Y','U','V', \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
XvTopToBottom \
|
||||
}
|
||||
|
||||
#define FOURCC_UYVY 0x59565955
|
||||
#define XVIMAGE_UYVY \
|
||||
{ \
|
||||
FOURCC_UYVY, \
|
||||
XvYUV, \
|
||||
LSBFirst, \
|
||||
{'U','Y','V','Y', \
|
||||
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
16, \
|
||||
XvPacked, \
|
||||
1, \
|
||||
0, 0, 0, 0, \
|
||||
8, 8, 8, \
|
||||
1, 2, 2, \
|
||||
1, 1, 1, \
|
||||
{'U','Y','V','Y', \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
XvTopToBottom \
|
||||
}
|
||||
|
||||
#define FOURCC_IA44 0x34344149
|
||||
#define XVIMAGE_IA44 \
|
||||
{ \
|
||||
FOURCC_IA44, \
|
||||
XvYUV, \
|
||||
LSBFirst, \
|
||||
{'I','A','4','4', \
|
||||
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
8, \
|
||||
XvPacked, \
|
||||
1, \
|
||||
0, 0, 0, 0, \
|
||||
8, 8, 8, \
|
||||
1, 1, 1, \
|
||||
1, 1, 1, \
|
||||
{'A','I', \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
XvTopToBottom \
|
||||
}
|
||||
|
||||
#define FOURCC_AI44 0x34344941
|
||||
#define XVIMAGE_AI44 \
|
||||
{ \
|
||||
FOURCC_AI44, \
|
||||
XvYUV, \
|
||||
LSBFirst, \
|
||||
{'A','I','4','4', \
|
||||
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
8, \
|
||||
XvPacked, \
|
||||
1, \
|
||||
0, 0, 0, 0, \
|
||||
8, 8, 8, \
|
||||
1, 1, 1, \
|
||||
1, 1, 1, \
|
||||
{'I','A', \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
XvTopToBottom \
|
||||
}
|
||||
|
||||
#define FOURCC_NV12 0x3231564e
|
||||
#define XVIMAGE_NV12 \
|
||||
{ \
|
||||
FOURCC_NV12, \
|
||||
XvYUV, \
|
||||
LSBFirst, \
|
||||
{'N','V','1','2', \
|
||||
0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
12, \
|
||||
XvPlanar, \
|
||||
2, \
|
||||
0, 0, 0, 0, \
|
||||
8, 8, 8, \
|
||||
1, 2, 2, \
|
||||
1, 2, 2, \
|
||||
{'Y','U','V', \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
XvTopToBottom \
|
||||
}
|
||||
|
||||
#define FOURCC_RGBA32 0x41424752
|
||||
#define XVIMAGE_RGB32 \
|
||||
{ \
|
||||
FOURCC_RGBA32, \
|
||||
XvRGB, \
|
||||
LSBFirst, \
|
||||
{'R','A','2','4', \
|
||||
0x00, 0x00, 0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
32, \
|
||||
XvPacked, \
|
||||
1, \
|
||||
32, 0xff0000, 0xff00, 0xff, \
|
||||
0, 0, 0, \
|
||||
0, 0, 0, \
|
||||
0, 0, 0, \
|
||||
{0,0,0,0, \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
0 \
|
||||
}
|
||||
|
||||
#define FOURCC_RGB565 0x36314752
|
||||
#define XVIMAGE_RGB565 \
|
||||
{ \
|
||||
FOURCC_RGB565, \
|
||||
XvRGB, \
|
||||
LSBFirst, \
|
||||
{'R','G','1','6', \
|
||||
0x00, 0x00, 0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
|
||||
16, \
|
||||
XvPacked, \
|
||||
1, \
|
||||
16, 0xf800, 0x7e0, 0x1f, \
|
||||
0, 0, 0, \
|
||||
0, 0, 0, \
|
||||
0, 0, 0, \
|
||||
{0,0,0,0, \
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, \
|
||||
0 \
|
||||
}
|
||||
#endif /* _XF86_FOURCC_H_ */
|
||||
@@ -0,0 +1,96 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 GC_H
|
||||
#define GC_H
|
||||
|
||||
#include <X11/X.h> /* for GContext, Mask */
|
||||
#include <X11/Xdefs.h> /* for Bool */
|
||||
#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 GC_CHANGE_SERIAL_BIT (((unsigned long)1)<<31)
|
||||
|
||||
#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 _X_EXPORT void ValidateGC(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ );
|
||||
|
||||
typedef union {
|
||||
CARD32 val;
|
||||
void *ptr;
|
||||
} ChangeGCVal, *ChangeGCValPtr;
|
||||
|
||||
extern _X_EXPORT int ChangeGC(ClientPtr /*client */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
BITS32 /*mask */ ,
|
||||
ChangeGCValPtr /*pCGCV */ );
|
||||
|
||||
extern _X_EXPORT GCPtr GetScratchGC(unsigned /*depth */ ,
|
||||
ScreenPtr /*pScreen */ );
|
||||
|
||||
extern _X_EXPORT void FreeScratchGC(GCPtr /*pGC */ );
|
||||
|
||||
#endif /* GC_H */
|
||||
@@ -0,0 +1,286 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 GCSTRUCT_H
|
||||
#define GCSTRUCT_H
|
||||
|
||||
#include <X11/Xprotostr.h>
|
||||
|
||||
#include "gc.h"
|
||||
#include "pixmap.h"
|
||||
#include "regionstr.h"
|
||||
#include "screenint.h"
|
||||
#include "privates.h"
|
||||
|
||||
#ifndef _XTYPEDEF_CHARINFOPTR
|
||||
typedef struct _CharInfo *CharInfoPtr; /* also in fonts/include/font.h */
|
||||
#define _XTYPEDEF_CHARINFOPTR
|
||||
#endif
|
||||
|
||||
/*
|
||||
* functions which modify the state of the GC
|
||||
*/
|
||||
|
||||
typedef struct _GCFuncs {
|
||||
void (*ValidateGC) (GCPtr /*pGC */ ,
|
||||
unsigned long /*stateChanges */ ,
|
||||
DrawablePtr /*pDrawable */ );
|
||||
|
||||
void (*ChangeGC) (GCPtr /*pGC */ ,
|
||||
unsigned long /*mask */ );
|
||||
|
||||
void (*CopyGC) (GCPtr /*pGCSrc */ ,
|
||||
unsigned long /*mask */ ,
|
||||
GCPtr /*pGCDst */ );
|
||||
|
||||
void (*DestroyGC) (GCPtr /*pGC */ );
|
||||
|
||||
void (*ChangeClip) (GCPtr pGC,
|
||||
int type,
|
||||
void *pvalue,
|
||||
int nrects);
|
||||
|
||||
void (*DestroyClip) (GCPtr /*pGC */ );
|
||||
|
||||
void (*CopyClip) (GCPtr /*pgcDst */ ,
|
||||
GCPtr /*pgcSrc */ );
|
||||
} GCFuncs;
|
||||
|
||||
/*
|
||||
* graphics operations invoked through a GC
|
||||
*/
|
||||
|
||||
typedef struct _GCOps {
|
||||
void (*FillSpans) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*nInit */ ,
|
||||
DDXPointPtr /*pptInit */ ,
|
||||
int * /*pwidthInit */ ,
|
||||
int /*fSorted */ );
|
||||
|
||||
void (*SetSpans) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
char * /*psrc */ ,
|
||||
DDXPointPtr /*ppt */ ,
|
||||
int * /*pwidth */ ,
|
||||
int /*nspans */ ,
|
||||
int /*fSorted */ );
|
||||
|
||||
void (*PutImage) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*depth */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*w */ ,
|
||||
int /*h */ ,
|
||||
int /*leftPad */ ,
|
||||
int /*format */ ,
|
||||
char * /*pBits */ );
|
||||
|
||||
RegionPtr (*CopyArea) (DrawablePtr /*pSrc */ ,
|
||||
DrawablePtr /*pDst */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*srcx */ ,
|
||||
int /*srcy */ ,
|
||||
int /*w */ ,
|
||||
int /*h */ ,
|
||||
int /*dstx */ ,
|
||||
int /*dsty */ );
|
||||
|
||||
RegionPtr (*CopyPlane) (DrawablePtr /*pSrcDrawable */ ,
|
||||
DrawablePtr /*pDstDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*srcx */ ,
|
||||
int /*srcy */ ,
|
||||
int /*width */ ,
|
||||
int /*height */ ,
|
||||
int /*dstx */ ,
|
||||
int /*dsty */ ,
|
||||
unsigned long /*bitPlane */ );
|
||||
void (*PolyPoint) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*mode */ ,
|
||||
int /*npt */ ,
|
||||
DDXPointPtr /*pptInit */ );
|
||||
|
||||
void (*Polylines) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*mode */ ,
|
||||
int /*npt */ ,
|
||||
DDXPointPtr /*pptInit */ );
|
||||
|
||||
void (*PolySegment) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*nseg */ ,
|
||||
xSegment * /*pSegs */ );
|
||||
|
||||
void (*PolyRectangle) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*nrects */ ,
|
||||
xRectangle * /*pRects */ );
|
||||
|
||||
void (*PolyArc) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*narcs */ ,
|
||||
xArc * /*parcs */ );
|
||||
|
||||
void (*FillPolygon) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*shape */ ,
|
||||
int /*mode */ ,
|
||||
int /*count */ ,
|
||||
DDXPointPtr /*pPts */ );
|
||||
|
||||
void (*PolyFillRect) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*nrectFill */ ,
|
||||
xRectangle * /*prectInit */ );
|
||||
|
||||
void (*PolyFillArc) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*narcs */ ,
|
||||
xArc * /*parcs */ );
|
||||
|
||||
int (*PolyText8) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*count */ ,
|
||||
char * /*chars */ );
|
||||
|
||||
int (*PolyText16) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*count */ ,
|
||||
unsigned short * /*chars */ );
|
||||
|
||||
void (*ImageText8) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*count */ ,
|
||||
char * /*chars */ );
|
||||
|
||||
void (*ImageText16) (DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*count */ ,
|
||||
unsigned short * /*chars */ );
|
||||
|
||||
void (*ImageGlyphBlt) (DrawablePtr pDrawable,
|
||||
GCPtr pGC,
|
||||
int x,
|
||||
int y,
|
||||
unsigned int nglyph,
|
||||
CharInfoPtr *ppci,
|
||||
void *pglyphBase);
|
||||
|
||||
void (*PolyGlyphBlt) (DrawablePtr pDrawable,
|
||||
GCPtr pGC,
|
||||
int x,
|
||||
int y,
|
||||
unsigned int nglyph,
|
||||
CharInfoPtr *ppci,
|
||||
void *pglyphBase);
|
||||
|
||||
void (*PushPixels) (GCPtr /*pGC */ ,
|
||||
PixmapPtr /*pBitMap */ ,
|
||||
DrawablePtr /*pDst */ ,
|
||||
int /*w */ ,
|
||||
int /*h */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ );
|
||||
} GCOps;
|
||||
|
||||
/* there is padding in the bit fields because the Sun compiler doesn't
|
||||
* force alignment to 32-bit boundaries. losers.
|
||||
*/
|
||||
typedef struct _GC {
|
||||
ScreenPtr pScreen;
|
||||
unsigned char depth;
|
||||
unsigned char alu;
|
||||
unsigned short lineWidth;
|
||||
unsigned short dashOffset;
|
||||
unsigned short numInDashList;
|
||||
unsigned char *dash;
|
||||
unsigned int lineStyle:2;
|
||||
unsigned int capStyle:2;
|
||||
unsigned int joinStyle:2;
|
||||
unsigned int fillStyle:2;
|
||||
unsigned int fillRule:1;
|
||||
unsigned int arcMode:1;
|
||||
unsigned int subWindowMode:1;
|
||||
unsigned int graphicsExposures:1;
|
||||
unsigned int miTranslate:1; /* should mi things translate? */
|
||||
unsigned int tileIsPixel:1; /* tile is solid pixel */
|
||||
unsigned int fExpose:1; /* Call exposure handling */
|
||||
unsigned int freeCompClip:1; /* Free composite clip */
|
||||
unsigned int scratch_inuse:1; /* is this GC in a pool for reuse? */
|
||||
unsigned int unused:15; /* see comment above */
|
||||
unsigned int planemask;
|
||||
unsigned int fgPixel;
|
||||
unsigned int bgPixel;
|
||||
/*
|
||||
* alas -- both tile and stipple must be here as they
|
||||
* are independently specifiable
|
||||
*/
|
||||
PixUnion tile;
|
||||
PixmapPtr stipple;
|
||||
xPoint patOrg; /* origin for (tile, stipple) */
|
||||
xPoint clipOrg;
|
||||
struct _Font *font;
|
||||
RegionPtr clientClip;
|
||||
unsigned int stateChanges; /* masked with GC_<kind> */
|
||||
unsigned int serialNumber;
|
||||
const GCFuncs *funcs;
|
||||
const GCOps *ops;
|
||||
PrivateRec *devPrivates;
|
||||
RegionPtr pCompositeClip;
|
||||
} GCRec;
|
||||
|
||||
#endif /* GCSTRUCT_H */
|
||||
@@ -0,0 +1,427 @@
|
||||
/*
|
||||
* Copyright © 2008 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Eric Anholt <eric@anholt.net>
|
||||
* Zhigang Gong <zhigang.gong@linux.intel.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef GLAMOR_H
|
||||
#define GLAMOR_H
|
||||
|
||||
#include <scrnintstr.h>
|
||||
#include <pixmapstr.h>
|
||||
#include <gcstruct.h>
|
||||
#include <picturestr.h>
|
||||
#include <fb.h>
|
||||
#ifdef GLAMOR_FOR_XORG
|
||||
#include <xf86xv.h>
|
||||
#endif
|
||||
|
||||
struct glamor_context;
|
||||
struct gbm_bo;
|
||||
struct gbm_device;
|
||||
|
||||
/*
|
||||
* glamor_pixmap_type : glamor pixmap's type.
|
||||
* @MEMORY: pixmap is in memory.
|
||||
* @TEXTURE_DRM: pixmap is in a texture created from a DRM buffer.
|
||||
* @SEPARATE_TEXTURE: The texture is created from a DRM buffer, but
|
||||
* the format is incompatible, so this type of pixmap
|
||||
* will never fallback to DDX layer.
|
||||
* @DRM_ONLY: pixmap is in a external DRM buffer.
|
||||
* @TEXTURE_ONLY: pixmap is in an internal texture.
|
||||
*/
|
||||
typedef enum glamor_pixmap_type {
|
||||
GLAMOR_MEMORY = 0, /* Newly calloc()ed pixmaps are memory. */
|
||||
GLAMOR_TEXTURE_DRM,
|
||||
GLAMOR_DRM_ONLY,
|
||||
GLAMOR_TEXTURE_ONLY,
|
||||
} glamor_pixmap_type_t;
|
||||
|
||||
typedef Bool (*GetDrawableModifiersFuncPtr) (DrawablePtr draw,
|
||||
uint32_t format,
|
||||
uint32_t *num_modifiers,
|
||||
uint64_t **modifiers);
|
||||
|
||||
#define GLAMOR_EGL_EXTERNAL_BUFFER 3
|
||||
#define GLAMOR_USE_EGL_SCREEN (1 << 0)
|
||||
#define GLAMOR_NO_DRI3 (1 << 1)
|
||||
#define GLAMOR_NO_RENDER_ACCEL (1 << 2)
|
||||
#define GLAMOR_VALID_FLAGS (GLAMOR_USE_EGL_SCREEN \
|
||||
| GLAMOR_NO_DRI3 \
|
||||
| GLAMOR_NO_RENDER_ACCEL)
|
||||
|
||||
/* until we need geometry shaders GL3.1 should suffice. */
|
||||
#define GLAMOR_GL_CORE_VER_MAJOR 3
|
||||
#define GLAMOR_GL_CORE_VER_MINOR 1
|
||||
|
||||
/* @glamor_init: Initialize glamor internal data structure.
|
||||
*
|
||||
* @screen: Current screen pointer.
|
||||
* @flags: Please refer the flags description above.
|
||||
*
|
||||
* @GLAMOR_USE_EGL_SCREEN:
|
||||
* If you are using EGL layer, then please set this bit
|
||||
* on, otherwise, clear it.
|
||||
*
|
||||
* @GLAMOR_NO_DRI3
|
||||
* Disable the built-in DRI3 support
|
||||
*
|
||||
* This function initializes necessary internal data structure
|
||||
* for glamor. And before calling into this function, the OpenGL
|
||||
* environment should be ready. Should be called before any real
|
||||
* glamor rendering or texture allocation functions. And should
|
||||
* be called after the DDX's screen initialization or at the last
|
||||
* step of the DDX's screen initialization.
|
||||
*/
|
||||
extern _X_EXPORT Bool glamor_init(ScreenPtr screen, unsigned int flags);
|
||||
extern _X_EXPORT void glamor_fini(ScreenPtr screen);
|
||||
|
||||
/* Returns is the initialized gl context is gles
|
||||
* Must not be called before glamor_init
|
||||
*/
|
||||
extern _X_EXPORT Bool glamor_is_gles(ScreenPtr screen);
|
||||
|
||||
/* This function is used to free the glamor private screen's
|
||||
* resources. If the DDX driver is not set GLAMOR_USE_SCREEN,
|
||||
* then, DDX need to call this function at proper stage, if
|
||||
* it is the xorg DDX driver,then it should be called at free
|
||||
* screen stage not the close screen stage. The reason is after
|
||||
* call to this function, the xorg DDX may need to destroy the
|
||||
* screen pixmap which must be a glamor pixmap and requires
|
||||
* the internal data structure still exist at that time.
|
||||
* Otherwise, the glamor internal structure will not be freed.*/
|
||||
|
||||
extern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap);
|
||||
|
||||
extern _X_EXPORT void glamor_clear_pixmap(PixmapPtr pixmap);
|
||||
|
||||
extern _X_EXPORT void glamor_block_handler(ScreenPtr screen);
|
||||
|
||||
extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h,
|
||||
int depth, unsigned int usage);
|
||||
|
||||
/* needed by Xrdp module */
|
||||
#define GLAMOR_CREATE_PIXMAP_CPU 0x100
|
||||
#define GLAMOR_CREATE_PIXMAP_FIXUP 0x101
|
||||
#define GLAMOR_CREATE_FBO_NO_FBO 0x103
|
||||
#define GLAMOR_CREATE_NO_LARGE 0x105
|
||||
#define GLAMOR_CREATE_PIXMAP_NO_TEXTURE 0x106
|
||||
#define GLAMOR_CREATE_FORMAT_CBCR 0x107
|
||||
|
||||
/* @glamor_egl_exchange_buffers: Exchange the underlying buffers(KHR image,fbo).
|
||||
*
|
||||
* @front: front pixmap.
|
||||
* @back: back pixmap.
|
||||
*
|
||||
* Used by the DRI2 page flip. This function will exchange the KHR images and
|
||||
* fbos of the two pixmaps.
|
||||
* */
|
||||
extern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front,
|
||||
PixmapPtr back);
|
||||
|
||||
extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen);
|
||||
|
||||
/* @glamor_supports_pixmap_import_export: Returns whether
|
||||
* glamor_fds_from_pixmap(), glamor_name_from_pixmap(), and
|
||||
* glamor_pixmap_from_fds() are supported.
|
||||
*
|
||||
* @screen: Current screen pointer.
|
||||
*
|
||||
* To have DRI3 support enabled, glamor and glamor_egl need to be
|
||||
* initialized. glamor also has to be compiled with gbm support.
|
||||
*
|
||||
* The EGL layer needs to have the following extensions working:
|
||||
*
|
||||
* .EGL_KHR_surfaceless_context
|
||||
* */
|
||||
extern _X_EXPORT Bool glamor_supports_pixmap_import_export(ScreenPtr screen);
|
||||
|
||||
/* @glamor_fds_from_pixmap: Get a dma-buf fd from a pixmap.
|
||||
*
|
||||
* @screen: Current screen pointer.
|
||||
* @pixmap: The pixmap from which we want the fd.
|
||||
* @fds, @strides, @offsets: Pointers to fill info of each plane.
|
||||
* @modifier: Pointer to fill the modifier of the buffer.
|
||||
*
|
||||
* the pixmap and the buffer associated by the fds will share the same
|
||||
* content. The caller is responsible to close the returned file descriptors.
|
||||
* Returns the number of planes, -1 on error.
|
||||
*
|
||||
* Currently just exported for Xrdp's virtual driver - real HW drivers
|
||||
* usually shouldn't need this.
|
||||
* */
|
||||
_X_EXPORT int glamor_fds_from_pixmap(ScreenPtr screen,
|
||||
PixmapPtr pixmap,
|
||||
int *fds,
|
||||
uint32_t *strides,
|
||||
uint32_t *offsets,
|
||||
uint64_t *modifier);
|
||||
|
||||
/* @glamor_fd_from_pixmap: Get a dma-buf fd from a pixmap.
|
||||
*
|
||||
* @screen: Current screen pointer.
|
||||
* @pixmap: The pixmap from which we want the fd.
|
||||
* @stride, @size: Pointers to fill the stride and size of the
|
||||
* buffer associated to the fd.
|
||||
*
|
||||
* the pixmap and the buffer associated by the fd will share the same
|
||||
* content.
|
||||
* Returns the fd on success, -1 on error.
|
||||
* */
|
||||
extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen,
|
||||
PixmapPtr pixmap,
|
||||
CARD16 *stride, CARD32 *size);
|
||||
|
||||
/* @glamor_shareable_fd_from_pixmap: Get a dma-buf fd suitable for sharing
|
||||
* with other GPUs from a pixmap.
|
||||
*
|
||||
* @screen: Current screen pointer.
|
||||
* @pixmap: The pixmap from which we want the fd.
|
||||
* @stride, @size: Pointers to fill the stride and size of the
|
||||
* buffer associated to the fd.
|
||||
*
|
||||
* The returned fd will point to a buffer which is suitable for sharing
|
||||
* across GPUs (not using GPU specific tiling).
|
||||
* The pixmap and the buffer associated by the fd will share the same
|
||||
* content.
|
||||
* The pixmap's stride may be modified by this function.
|
||||
* Returns the fd on success, -1 on error.
|
||||
* */
|
||||
extern _X_EXPORT int glamor_shareable_fd_from_pixmap(ScreenPtr screen,
|
||||
PixmapPtr pixmap,
|
||||
CARD16 *stride,
|
||||
CARD32 *size);
|
||||
|
||||
/**
|
||||
* @glamor_name_from_pixmap: Gets a gem name from a pixmap.
|
||||
*
|
||||
* @pixmap: The pixmap from which we want the gem name.
|
||||
*
|
||||
* the pixmap and the buffer associated by the gem name will share the
|
||||
* same content. This function can be used by the DDX to support DRI2,
|
||||
* and needs the same set of buffer export GL extensions as DRI3
|
||||
* support.
|
||||
*
|
||||
* Returns the name on success, -1 on error.
|
||||
* */
|
||||
extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap,
|
||||
CARD16 *stride, CARD32 *size);
|
||||
|
||||
/* @glamor_gbm_bo_from_pixmap: Get a GBM bo from a pixmap.
|
||||
*
|
||||
* @screen: Current screen pointer.
|
||||
* @pixmap: The pixmap from which we want the fd.
|
||||
* @stride, @size: Pointers to fill the stride and size of the
|
||||
* buffer associated to the fd.
|
||||
*
|
||||
* the pixmap and the buffer represented by the gbm_bo will share the same
|
||||
* content.
|
||||
*
|
||||
* Returns the gbm_bo on success, NULL on error.
|
||||
* */
|
||||
extern _X_EXPORT struct gbm_bo *glamor_gbm_bo_from_pixmap(ScreenPtr screen,
|
||||
PixmapPtr pixmap);
|
||||
|
||||
/* @glamor_pixmap_from_fds: Creates a pixmap to wrap a dma-buf fds.
|
||||
*
|
||||
* @screen: Current screen pointer.
|
||||
* @num_fds: Number of fds to import
|
||||
* @fds: The dma-buf fds to import.
|
||||
* @width: The width of the buffers.
|
||||
* @height: The height of the buffers.
|
||||
* @stride: The stride of the buffers.
|
||||
* @depth: The depth of the buffers.
|
||||
* @bpp: The bpp of the buffers.
|
||||
* @modifier: The modifier of the buffers.
|
||||
*
|
||||
* Returns a valid pixmap if the import succeeded, else NULL.
|
||||
*
|
||||
* Currently just exported for Xrdp's virtual driver - real HW drivers
|
||||
* usually shouldn't need this.
|
||||
* */
|
||||
_X_EXPORT PixmapPtr glamor_pixmap_from_fds(ScreenPtr screen,
|
||||
CARD8 num_fds,
|
||||
const int *fds,
|
||||
CARD16 width,
|
||||
CARD16 height,
|
||||
const CARD32 *strides,
|
||||
const CARD32 *offsets,
|
||||
CARD8 depth,
|
||||
CARD8 bpp,
|
||||
uint64_t modifier);
|
||||
|
||||
/* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd.
|
||||
*
|
||||
* @screen: Current screen pointer.
|
||||
* @fd: The dma-buf fd to import.
|
||||
* @width: The width of the buffer.
|
||||
* @height: The height of the buffer.
|
||||
* @stride: The stride of the buffer.
|
||||
* @depth: The depth of the buffer.
|
||||
* @bpp: The bpp of the buffer.
|
||||
*
|
||||
* Returns a valid pixmap if the import succeeded, else NULL.
|
||||
* */
|
||||
extern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen,
|
||||
int fd,
|
||||
CARD16 width,
|
||||
CARD16 height,
|
||||
CARD16 stride,
|
||||
CARD8 depth,
|
||||
CARD8 bpp);
|
||||
|
||||
/* @glamor_back_pixmap_from_fd: Backs an existing pixmap with a dma-buf fd.
|
||||
*
|
||||
* @pixmap: Pixmap to change backing for
|
||||
* @fd: The dma-buf fd to import.
|
||||
* @width: The width of the buffer.
|
||||
* @height: The height of the buffer.
|
||||
* @stride: The stride of the buffer.
|
||||
* @depth: The depth of the buffer.
|
||||
* @bpp: The number of bpp of the buffer.
|
||||
*
|
||||
* Returns TRUE if successful, FALSE on failure.
|
||||
* */
|
||||
extern _X_EXPORT Bool glamor_back_pixmap_from_fd(PixmapPtr pixmap,
|
||||
int fd,
|
||||
CARD16 width,
|
||||
CARD16 height,
|
||||
CARD16 stride,
|
||||
CARD8 depth,
|
||||
CARD8 bpp);
|
||||
|
||||
/* for xorgrdp */
|
||||
_X_EXPORT Bool glamor_get_formats(ScreenPtr screen,
|
||||
CARD32 *num_formats,
|
||||
CARD32 **formats);
|
||||
|
||||
/* for xorgrdp */
|
||||
_X_EXPORT Bool glamor_get_modifiers(ScreenPtr screen,
|
||||
uint32_t format,
|
||||
uint32_t *num_modifiers,
|
||||
uint64_t **modifiers);
|
||||
|
||||
/* for xorgrdp */
|
||||
_X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw,
|
||||
uint32_t format,
|
||||
uint32_t *num_modifiers,
|
||||
uint64_t **modifiers);
|
||||
|
||||
extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen,
|
||||
GetDrawableModifiersFuncPtr func);
|
||||
|
||||
|
||||
#define GLAMOR_EGL_MODULE_NAME "glamoregl"
|
||||
|
||||
/* @glamor_egl_init: Initialize EGL environment.
|
||||
*
|
||||
* @scrn: Current screen info pointer.
|
||||
* @fd: Current drm fd.
|
||||
*
|
||||
* This function creates and initializes EGL contexts.
|
||||
* Should be called from DDX's preInit function.
|
||||
* Return TRUE if success, otherwise return FALSE.
|
||||
* */
|
||||
extern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd);
|
||||
|
||||
enum {
|
||||
GLAMOR_EGL_CAP_NONE = 0,
|
||||
GLAMOR_EGL_CAP_DRI3 = 1 << 0,
|
||||
GLAMOR_EGL_CAP_DRI3_IMPORT = 1 << 1,
|
||||
GLAMOR_EGL_CAP_DRI3_EXPORT = 1 << 2,
|
||||
GLAMOR_EGL_CAP_DRI3_SYNCOBJ = 1 << 3,
|
||||
GLAMOR_EGL_CAP_TEXTURE_GBM_BO = 1 << 4,
|
||||
};
|
||||
|
||||
#define GLAMOR_EGL_DEFAULT_CAPS (GLAMOR_EGL_CAP_DRI3 | GLAMOR_EGL_CAP_DRI3_IMPORT | GLAMOR_EGL_CAP_DRI3_EXPORT | GLAMOR_EGL_CAP_TEXTURE_GBM_BO)
|
||||
|
||||
/* @glamor_egl_init2: Initialize EGL environment.
|
||||
*
|
||||
* @scrn: Current screen info pointer.
|
||||
* @fd: Current drm fd.
|
||||
* @caps: Some capabilities that glamor can have
|
||||
*
|
||||
* This function creates and initializes EGL contexts.
|
||||
* Should be called from DDX's preInit function.
|
||||
* Return TRUE if success, otherwise return FALSE.
|
||||
*
|
||||
* Unlike glamor_egl_init, this function returns true
|
||||
* even if some capabilities are missing.
|
||||
*
|
||||
* If caps is not NULL, it is set to a bitmask
|
||||
* describing what glamor capabilites are available.
|
||||
* */
|
||||
extern _X_EXPORT Bool glamor_egl_init2(ScrnInfoPtr scrn, int fd, int *caps, int flags);
|
||||
|
||||
extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen);
|
||||
|
||||
/*
|
||||
* @glamor_egl_create_textured_pixmap: Try to create a textured pixmap from
|
||||
* a BO handle.
|
||||
*
|
||||
* @pixmap: The pixmap need to be processed.
|
||||
* @handle: The BO's handle attached to this pixmap at DDX layer.
|
||||
* @stride: Stride in bytes for this pixmap.
|
||||
*
|
||||
* This function try to create a texture from the handle and attach
|
||||
* the texture to the pixmap , thus glamor can render to this pixmap
|
||||
* as well. Return true if successful, otherwise return FALSE.
|
||||
*/
|
||||
extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap,
|
||||
int handle, int stride);
|
||||
|
||||
/*
|
||||
* @glamor_egl_create_textured_pixmap_from_bo: Try to create a textured pixmap
|
||||
* from a gbm_bo.
|
||||
*
|
||||
* @pixmap: The pixmap need to be processed.
|
||||
* @bo: a pointer on a gbm_bo structure attached to this pixmap at DDX layer.
|
||||
*
|
||||
* This function is similar to glamor_egl_create_textured_pixmap.
|
||||
*/
|
||||
extern _X_EXPORT Bool
|
||||
glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
|
||||
struct gbm_bo *bo,
|
||||
Bool used_modifiers);
|
||||
|
||||
extern _X_EXPORT const char *glamor_egl_get_driver_name(ScreenPtr screen);
|
||||
|
||||
|
||||
extern _X_EXPORT int glamor_create_gc(GCPtr gc);
|
||||
|
||||
extern _X_EXPORT void glamor_validate_gc(GCPtr gc, unsigned long changes,
|
||||
DrawablePtr drawable);
|
||||
|
||||
#define HAS_GLAMOR_DESTROY_GC 1
|
||||
|
||||
extern _X_EXPORT void glamor_finish(ScreenPtr screen);
|
||||
#define HAS_GLAMOR_TEXT 1
|
||||
|
||||
#ifdef GLAMOR_FOR_XORG
|
||||
extern _X_EXPORT XF86VideoAdaptorPtr glamor_xv_init(ScreenPtr pScreen,
|
||||
int num_texture_ports);
|
||||
#endif
|
||||
|
||||
#endif /* GLAMOR_H */
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef _XSERV_GLOBAL_H_
|
||||
#define _XSERV_GLOBAL_H_
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
/* Global X server variables that are visible to mi, dix, os, and ddx */
|
||||
|
||||
extern _X_EXPORT const char *defaultFontPath;
|
||||
extern _X_EXPORT int monitorResolution;
|
||||
extern _X_EXPORT int defaultColorVisualClass;
|
||||
|
||||
#endif /* !_XSERV_GLOBAL_H_ */
|
||||
@@ -0,0 +1,320 @@
|
||||
/*
|
||||
* Copyright (c) 2016, NVIDIA CORPORATION.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and/or associated documentation files (the
|
||||
* "Materials"), to deal in the Materials without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
* permit persons to whom the Materials are furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* unaltered in all copies or substantial portions of the Materials.
|
||||
* Any additions, deletions, or changes to the original source files
|
||||
* must be clearly indicated in accompanying documentation.
|
||||
*
|
||||
* If only executable code is distributed, then the accompanying
|
||||
* documentation must state that "this software is based in part on the
|
||||
* work of the Khronos Group."
|
||||
*
|
||||
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* Defines the interface between the libglvnd server module and a vendor
|
||||
* library.
|
||||
*
|
||||
* Each screen may have one vendor library assigned to it. The GLVND module
|
||||
* will examine each GLX request to determine which screen it goes to, and then
|
||||
* it will forward that request to whichever vendor is assigned to that screen.
|
||||
*
|
||||
* Each vendor library is represented by an opaque __GLXServerVendor handle.
|
||||
* Display drivers are responsible for creating handles for its GLX
|
||||
* implementations, and assigning those handles to each screen.
|
||||
*
|
||||
* The GLVND module keeps a list of callbacks, which are called from
|
||||
* InitExtensions. Drivers should use that callback to assign a vendor
|
||||
* handle to whichever screens they support.
|
||||
*
|
||||
* Additional notes about dispatching:
|
||||
* - If a request has one or more GLXContextTag values, then the dispatch stub
|
||||
* must ensure that all of the tags belong to the vendor that it forwards the
|
||||
* request to. Otherwise, if a vendor library tries to look up the private
|
||||
* data for the tag, it could get the data from another vendor and crash.
|
||||
* - Following from the last point, if a request takes a GLXContextTag value,
|
||||
* then the dispatch stub should use the tag to select a vendor. If the
|
||||
* request takes two or more tags, then the vendor must ensure that they all
|
||||
* map to the same vendor.
|
||||
*/
|
||||
|
||||
#ifndef GLXVENDORABI_H
|
||||
#define GLXVENDORABI_H
|
||||
|
||||
#include "xlibre_ptrtypes.h"
|
||||
|
||||
#include <scrnintstr.h>
|
||||
#include <extnsionst.h>
|
||||
#include <GL/glxproto.h>
|
||||
|
||||
/*!
|
||||
* Current version of the ABI.
|
||||
*
|
||||
* This version number contains a major number in the high-order 16 bits, and
|
||||
* a minor version number in the low-order 16 bits.
|
||||
*
|
||||
* The major version number is incremented when an interface change will break
|
||||
* backwards compatibility with existing vendor libraries. The minor version
|
||||
* number is incremented when there's a change but existing vendor libraries
|
||||
* will still work.
|
||||
*/
|
||||
#define GLXSERVER_VENDOR_ABI_MAJOR_VERSION 0
|
||||
#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 1
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* An opaque pointer representing a vendor library.
|
||||
*/
|
||||
typedef struct GlxServerVendorRec GlxServerVendor;
|
||||
|
||||
typedef int (* GlxServerDispatchProc) (ClientPtr client);
|
||||
|
||||
typedef struct GlxServerImportsRec GlxServerImports;
|
||||
|
||||
/**
|
||||
* Functions exported by libglvnd to the vendor library.
|
||||
*/
|
||||
typedef struct GlxServerExportsRec {
|
||||
int majorVersion;
|
||||
int minorVersion;
|
||||
|
||||
/**
|
||||
* This callback is called during each server generation when the GLX
|
||||
* extension is initialized.
|
||||
*
|
||||
* Drivers may create a __GLXServerVendor handle at any time, but may only
|
||||
* assign a vendor to a screen from this callback.
|
||||
*
|
||||
* The callback is called with the ExtensionEntry pointer for the GLX
|
||||
* extension.
|
||||
*/
|
||||
CallbackListPtr *extensionInitCallback;
|
||||
|
||||
/**
|
||||
* Allocates and zeroes a __GLXserverImports structure.
|
||||
*
|
||||
* Future versions of the GLVND interface may add optional members to the
|
||||
* end of the __GLXserverImports struct. Letting the GLVND layer allocate
|
||||
* the __GLXserverImports struct allows backward compatibility with
|
||||
* existing drivers.
|
||||
*/
|
||||
GlxServerImports * (* allocateServerImports) (void);
|
||||
|
||||
/**
|
||||
* Frees a __GLXserverImports structure that was allocated with
|
||||
* \c allocateServerImports.
|
||||
*/
|
||||
void (* freeServerImports) (GlxServerImports *imports);
|
||||
|
||||
/**
|
||||
* Creates a new vendor library handle.
|
||||
*/
|
||||
GlxServerVendor * (* createVendor) (const GlxServerImports *imports);
|
||||
|
||||
/**
|
||||
* Destroys a vendor library handle.
|
||||
*
|
||||
* This function may not be called while the vendor handle is assigned to a
|
||||
* screen, but it may be called from the __GLXserverImports::extensionCloseDown
|
||||
* callback.
|
||||
*/
|
||||
void (* destroyVendor) (GlxServerVendor *vendor);
|
||||
|
||||
/**
|
||||
* Sets the vendor library to use for a screen.
|
||||
*
|
||||
* This function should be called from the screen's CreateScreenResources
|
||||
* callback.
|
||||
*/
|
||||
Bool (* setScreenVendor) (ScreenPtr screen, GlxServerVendor *vendor);
|
||||
|
||||
|
||||
/**
|
||||
* Adds an entry to the XID map.
|
||||
*
|
||||
* This mapping is used to dispatch requests based on an XID.
|
||||
*
|
||||
* Client-generated XID's (contexts, drawables, etc) must be added to the
|
||||
* map by the dispatch stub.
|
||||
*
|
||||
* XID's that are generated in the server should be added by the vendor
|
||||
* library.
|
||||
*
|
||||
* Vendor libraries are responsible for keeping track of any additional
|
||||
* data they need for the XID's.
|
||||
*
|
||||
* Note that adding GLXFBConfig ID's appears to be unnecessary -- every GLX
|
||||
* request I can find that takes a GLXFBConfig also takes a screen number.
|
||||
*
|
||||
* \param id The XID to add to the map. The XID must not already be in the
|
||||
* map.
|
||||
* \param vendor The vendor library to associate with \p id.
|
||||
* \return True on success, or False on failure.
|
||||
*/
|
||||
Bool (* addXIDMap) (XID id, GlxServerVendor *vendor);
|
||||
|
||||
/**
|
||||
* Returns the vendor and data for an XID, as added with \c addXIDMap.
|
||||
*
|
||||
* If \p id wasn't added with \c addXIDMap (for example, if it's a regular
|
||||
* X window), then libglvnd will try to look it up as a drawable and return
|
||||
* the vendor for whatever screen it's on.
|
||||
*
|
||||
* \param id The XID to look up.
|
||||
* \return The vendor that owns the XID, or \c NULL if no matching vendor
|
||||
* was found.
|
||||
*/
|
||||
GlxServerVendor * (* getXIDMap) (XID id);
|
||||
|
||||
/**
|
||||
* Removes an entry from the XID map.
|
||||
*/
|
||||
void (* removeXIDMap) (XID id);
|
||||
|
||||
/**
|
||||
* Looks up a context tag.
|
||||
*
|
||||
* Context tags are created and managed by libglvnd to ensure that they're
|
||||
* unique between vendors.
|
||||
*
|
||||
* \param client The client connection.
|
||||
* \param tag The context tag.
|
||||
* \return The vendor that owns the context tag, or \c NULL if the context
|
||||
* tag is invalid.
|
||||
*/
|
||||
GlxServerVendor * (* getContextTag)(ClientPtr client, GLXContextTag tag);
|
||||
|
||||
/**
|
||||
* Assigns a pointer to vendor-private data for a context tag.
|
||||
*
|
||||
* Since the tag values are assigned by GLVND, vendors can use this
|
||||
* function to store any private data they need for a context tag.
|
||||
*
|
||||
* \param client The client connection.
|
||||
* \param tag The context tag.
|
||||
* \param data An arbitrary pointer value.
|
||||
*/
|
||||
Bool (* setContextTagPrivate)(ClientPtr client, GLXContextTag tag, void *data);
|
||||
|
||||
/**
|
||||
* Returns the private data pointer that was assigned from
|
||||
* setContextTagPrivate.
|
||||
*
|
||||
* This function is safe to use in __GLXserverImports::makeCurrent to look
|
||||
* up the old context private pointer.
|
||||
*
|
||||
* However, this function is not safe to use from a ClientStateCallback,
|
||||
* because GLVND may have already deleted the tag by that point.
|
||||
*/
|
||||
void * (* getContextTagPrivate)(ClientPtr client, GLXContextTag tag);
|
||||
|
||||
GlxServerVendor * (* getVendorForScreen) (ClientPtr client, ScreenPtr screen);
|
||||
|
||||
/**
|
||||
* Forwards a request to a vendor library.
|
||||
*
|
||||
* \param vendor The vendor to send the request to.
|
||||
* \param client The client.
|
||||
*/
|
||||
int (* forwardRequest) (GlxServerVendor *vendor, ClientPtr client);
|
||||
|
||||
/**
|
||||
* Sets the vendor library to use for a screen for a specific client.
|
||||
*
|
||||
* This function changes which vendor should handle GLX requests for a
|
||||
* screen. Unlike \c setScreenVendor, this function can be called at any
|
||||
* time, and only applies to requests from a single client.
|
||||
*
|
||||
* This function is available in GLXVND version 0.1 or later.
|
||||
*/
|
||||
Bool (* setClientScreenVendor) (ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor);
|
||||
} GlxServerExports;
|
||||
|
||||
extern _X_EXPORT const GlxServerExports glxServer;
|
||||
|
||||
/**
|
||||
* Functions exported by the vendor library to libglvnd.
|
||||
*/
|
||||
struct GlxServerImportsRec {
|
||||
/**
|
||||
* Called on a server reset.
|
||||
*
|
||||
* This is called from the extension's CloseDown callback.
|
||||
*
|
||||
* Note that this is called after freeing all of GLVND's per-screen data,
|
||||
* so the callback may destroy any vendor handles.
|
||||
*
|
||||
* If the server is exiting, then GLVND will free any remaining vendor
|
||||
* handles after calling the extensionCloseDown callbacks.
|
||||
*/
|
||||
void (* extensionCloseDown) (const ExtensionEntry *extEntry);
|
||||
|
||||
/**
|
||||
* Handles a GLX request.
|
||||
*/
|
||||
int (* handleRequest) (ClientPtr client);
|
||||
|
||||
/**
|
||||
* Returns a dispatch function for a request.
|
||||
*
|
||||
* \param minorOpcode The minor opcode of the request.
|
||||
* \param vendorCode The vendor opcode, if \p minorOpcode
|
||||
* is \c X_GLXVendorPrivate or \c X_GLXVendorPrivateWithReply.
|
||||
* \return A dispatch function, or NULL if the vendor doesn't support this
|
||||
* request.
|
||||
*/
|
||||
GlxServerDispatchProc (* getDispatchAddress) (CARD8 minorOpcode, CARD32 vendorCode);
|
||||
|
||||
/**
|
||||
* Handles a MakeCurrent request.
|
||||
*
|
||||
* This function is called to handle any MakeCurrent request. The vendor
|
||||
* library should deal with changing the current context. After the vendor
|
||||
* returns GLVND will send the reply.
|
||||
*
|
||||
* In addition, GLVND will call this function with any current contexts
|
||||
* when a client disconnects.
|
||||
*
|
||||
* To ensure that context tags are unique, libglvnd will select a context
|
||||
* tag and pass it to the vendor library.
|
||||
*
|
||||
* The vendor can use \c __GLXserverExports::getContextTagPrivate to look
|
||||
* up the private data pointer for \p oldContextTag.
|
||||
*
|
||||
* Likewise, the vendor can use \c __GLXserverExports::setContextTagPrivate
|
||||
* to assign a private data pointer to \p newContextTag.
|
||||
*/
|
||||
int (* makeCurrent) (ClientPtr client,
|
||||
GLXContextTag oldContextTag,
|
||||
XID drawable,
|
||||
XID readdrawable,
|
||||
XID context,
|
||||
GLXContextTag newContextTag);
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // GLXVENDORABI_H
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
*
|
||||
* Copyright © 2000 SuSE, Inc.
|
||||
*
|
||||
* 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 SuSE not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. SuSE makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
||||
* 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.
|
||||
*
|
||||
* Author: Keith Packard, SuSE, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _GLYPHSTR_H_
|
||||
#define _GLYPHSTR_H_
|
||||
|
||||
#include <X11/extensions/renderproto.h>
|
||||
|
||||
#include "picture.h"
|
||||
#include "screenint.h"
|
||||
|
||||
#define GlyphFormat1 0
|
||||
#define GlyphFormat4 1
|
||||
#define GlyphFormat8 2
|
||||
#define GlyphFormat16 3
|
||||
#define GlyphFormat32 4
|
||||
#define GlyphFormatNum 5
|
||||
|
||||
typedef struct _Glyph {
|
||||
CARD32 refcnt;
|
||||
PrivateRec *devPrivates;
|
||||
unsigned char sha1[20];
|
||||
CARD32 size; /* info + bitmap */
|
||||
xGlyphInfo info;
|
||||
/* per-screen pixmaps follow */
|
||||
} GlyphRec, *GlyphPtr;
|
||||
|
||||
typedef struct _GlyphList {
|
||||
INT16 xOff;
|
||||
INT16 yOff;
|
||||
CARD8 len;
|
||||
PictFormatPtr format;
|
||||
} GlyphListRec, *GlyphListPtr;
|
||||
|
||||
#define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 1 /* used for api compat */
|
||||
extern _X_EXPORT PicturePtr
|
||||
GetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen);
|
||||
extern _X_EXPORT void
|
||||
SetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen, PicturePtr picture);
|
||||
|
||||
#endif /* _GLYPHSTR_H_ */
|
||||
@@ -0,0 +1,6 @@
|
||||
#ifndef __I2C_DEF_H__
|
||||
#define __I2C_DEF_H__
|
||||
|
||||
#include "xf86i2c.h"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,581 @@
|
||||
/************************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 INPUT_H
|
||||
#define INPUT_H
|
||||
|
||||
#include "xlibre_ptrtypes.h"
|
||||
|
||||
#include "misc.h"
|
||||
#include "screenint.h"
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <stdint.h>
|
||||
#include "window.h" /* for WindowPtr */
|
||||
#include "xkbrules.h"
|
||||
#include "events.h"
|
||||
#include "list.h"
|
||||
#include "os.h"
|
||||
#include <X11/extensions/XI2.h>
|
||||
|
||||
#define DEFAULT_KEYBOARD_CLICK 0
|
||||
#define DEFAULT_BELL 50
|
||||
#define DEFAULT_BELL_PITCH 400
|
||||
#define DEFAULT_BELL_DURATION 100
|
||||
#define DEFAULT_AUTOREPEAT TRUE
|
||||
#define DEFAULT_AUTOREPEATS {\
|
||||
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\
|
||||
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
|
||||
|
||||
#define DEFAULT_LEDS 0x0 /* all off */
|
||||
#define DEFAULT_LEDS_MASK 0xffffffff /* 32 */
|
||||
#define DEFAULT_INT_RESOLUTION 1000
|
||||
#define DEFAULT_INT_MIN_VALUE 0
|
||||
#define DEFAULT_INT_MAX_VALUE 100
|
||||
#define DEFAULT_INT_DISPLAYED 0
|
||||
|
||||
#define DEFAULT_PTR_NUMERATOR 2
|
||||
#define DEFAULT_PTR_DENOMINATOR 1
|
||||
#define DEFAULT_PTR_THRESHOLD 4
|
||||
|
||||
#define DEVICE_INIT 0
|
||||
#define DEVICE_ON 1
|
||||
#define DEVICE_OFF 2
|
||||
#define DEVICE_CLOSE 3
|
||||
#define DEVICE_ABORT 4
|
||||
|
||||
#define POINTER_RELATIVE (1 << 1)
|
||||
#define POINTER_ABSOLUTE (1 << 2)
|
||||
#define POINTER_ACCELERATE (1 << 3)
|
||||
#define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */
|
||||
#define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */
|
||||
#define POINTER_EMULATED (1 << 6) /* Event was emulated from another event */
|
||||
#define POINTER_DESKTOP (1 << 7) /* Data in desktop coordinates */
|
||||
#define POINTER_RAWONLY (1 << 8) /* Only generate RawEvents */
|
||||
|
||||
/* GetTouchEvent flags */
|
||||
#define TOUCH_ACCEPT (1 << 0)
|
||||
#define TOUCH_REJECT (1 << 1)
|
||||
#define TOUCH_PENDING_END (1 << 2)
|
||||
#define TOUCH_CLIENT_ID (1 << 3) /* touch ID is the client-visible id */
|
||||
#define TOUCH_REPLAYING (1 << 4) /* event is being replayed */
|
||||
#define TOUCH_POINTER_EMULATED (1 << 5) /* touch event may be pointer emulated */
|
||||
#define TOUCH_END (1 << 6) /* really end this touch now */
|
||||
|
||||
/* GetGestureEvent flags */
|
||||
#define GESTURE_CANCELLED (1 << 0)
|
||||
|
||||
/*int constants for pointer acceleration schemes*/
|
||||
#define PtrAccelNoOp 0
|
||||
#define PtrAccelPredictable 1
|
||||
#define PtrAccelLightweight 2
|
||||
#define PtrAccelDefault PtrAccelPredictable
|
||||
|
||||
#define MAX_VALUATORS 36
|
||||
/* Maximum number of valuators, divided by six, rounded up, to get number
|
||||
* of events. */
|
||||
#define MAX_VALUATOR_EVENTS 6
|
||||
#define MAX_BUTTONS 256 /* completely arbitrarily chosen */
|
||||
|
||||
#define NO_AXIS_LIMITS -1
|
||||
|
||||
#define MAP_LENGTH MAX_BUTTONS
|
||||
#define DOWN_LENGTH (MAX_BUTTONS/8) /* 256/8 => number of bytes to hold 256 bits */
|
||||
#define NullGrab ((GrabPtr)NULL)
|
||||
#define PointerRootWin ((WindowPtr)PointerRoot)
|
||||
#define NoneWin ((WindowPtr)None)
|
||||
#define NullDevice ((DevicePtr)NULL)
|
||||
|
||||
#ifndef FollowKeyboard
|
||||
#define FollowKeyboard 3
|
||||
#endif
|
||||
#ifndef FollowKeyboardWin
|
||||
#define FollowKeyboardWin ((WindowPtr) FollowKeyboard)
|
||||
#endif
|
||||
#ifndef RevertToFollowKeyboard
|
||||
#define RevertToFollowKeyboard 3
|
||||
#endif
|
||||
|
||||
enum InputLevel {
|
||||
CORE = 1,
|
||||
XI = 2,
|
||||
XI2 = 3,
|
||||
};
|
||||
|
||||
typedef unsigned long Leds;
|
||||
typedef struct _OtherClients *OtherClientsPtr;
|
||||
typedef struct _InputClients *InputClientsPtr;
|
||||
typedef struct _ValuatorClassRec *ValuatorClassPtr;
|
||||
typedef struct _ClassesRec *ClassesPtr;
|
||||
typedef struct _SpriteRec *SpritePtr;
|
||||
typedef struct _TouchClassRec *TouchClassPtr;
|
||||
typedef struct _GestureClassRec *GestureClassPtr;
|
||||
typedef struct _TouchPointInfo *TouchPointInfoPtr;
|
||||
typedef struct _GestureInfo *GestureInfoPtr;
|
||||
typedef struct _DDXTouchPointInfo *DDXTouchPointInfoPtr;
|
||||
typedef union _GrabMask GrabMask;
|
||||
|
||||
typedef struct _ValuatorMask ValuatorMask;
|
||||
|
||||
/* The DIX stores incoming input events in this list */
|
||||
extern InternalEvent *InputEventList;
|
||||
|
||||
typedef int (*DeviceProc) (DeviceIntPtr /*device */ ,
|
||||
int /*what */ );
|
||||
|
||||
typedef void (*ProcessInputProc) (InternalEvent * /*event */ ,
|
||||
DeviceIntPtr /*device */ );
|
||||
|
||||
typedef Bool (*DeviceHandleProc) (DeviceIntPtr /*device */ ,
|
||||
void * /*data */
|
||||
);
|
||||
|
||||
typedef void (*DeviceUnwrapProc) (DeviceIntPtr /*device */ ,
|
||||
DeviceHandleProc /*proc */ ,
|
||||
void * /*data */
|
||||
);
|
||||
|
||||
/* pointer acceleration handling */
|
||||
typedef void (*PointerAccelSchemeProc) (DeviceIntPtr /*device */ ,
|
||||
ValuatorMask * /*valuators */ ,
|
||||
CARD32 /*evtime */ );
|
||||
|
||||
typedef void (*DeviceCallbackProc) (DeviceIntPtr /*pDev */ );
|
||||
|
||||
struct _ValuatorAccelerationRec;
|
||||
typedef Bool (*PointerAccelSchemeInitProc) (DeviceIntPtr /*dev */ ,
|
||||
struct _ValuatorAccelerationRec *
|
||||
/*protoScheme */ );
|
||||
|
||||
typedef void (*DeviceSendEventsProc) (DeviceIntPtr /*dev */ ,
|
||||
int /* event type */ ,
|
||||
int /* detail, buttons or keycode */ ,
|
||||
int /* flags */ ,
|
||||
const ValuatorMask * /* valuators */ );
|
||||
|
||||
typedef struct _DeviceRec {
|
||||
void *devicePrivate;
|
||||
ProcessInputProc processInputProc; /* current */
|
||||
ProcessInputProc realInputProc; /* deliver */
|
||||
ProcessInputProc enqueueInputProc; /* enqueue */
|
||||
Bool on; /* used by DDX to keep state */
|
||||
} DeviceRec, *DevicePtr;
|
||||
|
||||
typedef struct {
|
||||
int click, bell, bell_pitch, bell_duration;
|
||||
Bool autoRepeat;
|
||||
unsigned char autoRepeats[32];
|
||||
Leds leds;
|
||||
unsigned char id;
|
||||
} KeybdCtrl;
|
||||
|
||||
typedef struct {
|
||||
KeySym *map;
|
||||
KeyCode minKeyCode, maxKeyCode;
|
||||
int mapWidth;
|
||||
} KeySymsRec, *KeySymsPtr;
|
||||
|
||||
typedef struct {
|
||||
int num, den, threshold;
|
||||
unsigned char id;
|
||||
} PtrCtrl;
|
||||
|
||||
typedef struct {
|
||||
int resolution, min_value, max_value;
|
||||
int integer_displayed;
|
||||
unsigned char id;
|
||||
} IntegerCtrl;
|
||||
|
||||
typedef struct {
|
||||
int max_symbols, num_symbols_supported;
|
||||
int num_symbols_displayed;
|
||||
KeySym *symbols_supported;
|
||||
KeySym *symbols_displayed;
|
||||
unsigned char id;
|
||||
} StringCtrl;
|
||||
|
||||
typedef struct {
|
||||
int percent, pitch, duration;
|
||||
unsigned char id;
|
||||
} BellCtrl;
|
||||
|
||||
typedef struct {
|
||||
Leds led_values;
|
||||
Mask led_mask;
|
||||
unsigned char id;
|
||||
} LedCtrl;
|
||||
|
||||
extern _X_EXPORT KeybdCtrl defaultKeyboardControl;
|
||||
extern _X_EXPORT PtrCtrl defaultPointerControl;
|
||||
|
||||
typedef struct _InputOption InputOption;
|
||||
typedef struct _XI2Mask XI2Mask;
|
||||
|
||||
typedef struct _InputAttributes {
|
||||
char *product;
|
||||
char *vendor;
|
||||
char *device;
|
||||
char *pnp_id;
|
||||
char *usb_id;
|
||||
char **tags; /* null-terminated */
|
||||
uint32_t flags;
|
||||
} InputAttributes;
|
||||
|
||||
#define ATTR_KEYBOARD (1<<0)
|
||||
#define ATTR_POINTER (1<<1)
|
||||
#define ATTR_JOYSTICK (1<<2)
|
||||
#define ATTR_TABLET (1<<3)
|
||||
#define ATTR_TOUCHPAD (1<<4)
|
||||
#define ATTR_TOUCHSCREEN (1<<5)
|
||||
#define ATTR_KEY (1<<6)
|
||||
#define ATTR_TABLET_PAD (1<<7)
|
||||
|
||||
/* Key/Button has been run through all input processing and events sent to clients. */
|
||||
#define KEY_PROCESSED 1
|
||||
#define BUTTON_PROCESSED 1
|
||||
/* Key/Button has not been fully processed, no events have been sent. */
|
||||
#define KEY_POSTED 2
|
||||
#define BUTTON_POSTED 2
|
||||
|
||||
extern _X_EXPORT void set_key_down(DeviceIntPtr pDev, int key_code, int type);
|
||||
extern _X_EXPORT void set_key_up(DeviceIntPtr pDev, int key_code, int type);
|
||||
extern _X_EXPORT int key_is_down(DeviceIntPtr pDev, int key_code, int type);
|
||||
extern _X_EXPORT void set_button_down(DeviceIntPtr pDev, int button, int type);
|
||||
extern _X_EXPORT void set_button_up(DeviceIntPtr pDev, int button, int type);
|
||||
extern _X_EXPORT int button_is_down(DeviceIntPtr pDev, int button, int type);
|
||||
|
||||
extern _X_EXPORT DeviceIntPtr AddInputDevice(ClientPtr /*client */ ,
|
||||
DeviceProc /*deviceProc */ ,
|
||||
Bool /*autoStart */ );
|
||||
|
||||
extern _X_EXPORT Bool EnableDevice(DeviceIntPtr /*device */ ,
|
||||
BOOL /* sendevent */ );
|
||||
|
||||
extern _X_EXPORT Bool ActivateDevice(DeviceIntPtr /*device */ ,
|
||||
BOOL /* sendevent */ );
|
||||
|
||||
extern _X_EXPORT Bool DisableDevice(DeviceIntPtr /*device */ ,
|
||||
BOOL /* sendevent */ );
|
||||
|
||||
extern _X_EXPORT int RemoveDevice(DeviceIntPtr /*dev */ ,
|
||||
BOOL /* sendevent */ );
|
||||
|
||||
extern _X_EXPORT int NumMotionEvents(void);
|
||||
|
||||
extern _X_EXPORT int dixLookupDevice(DeviceIntPtr * /* dev */ ,
|
||||
int /* id */ ,
|
||||
ClientPtr /* client */ ,
|
||||
Mask /* access_mode */ );
|
||||
|
||||
extern _X_EXPORT void QueryMinMaxKeyCodes(KeyCode * /*minCode */ ,
|
||||
KeyCode * /*maxCode */ );
|
||||
|
||||
extern _X_EXPORT Bool InitButtonClassDeviceStruct(DeviceIntPtr /*device */ ,
|
||||
int /*numButtons */ ,
|
||||
Atom * /* labels */ ,
|
||||
CARD8 * /*map */ );
|
||||
|
||||
extern _X_EXPORT Bool InitValuatorClassDeviceStruct(DeviceIntPtr /*device */ ,
|
||||
int /*numAxes */ ,
|
||||
Atom * /* labels */ ,
|
||||
int /*numMotionEvents */ ,
|
||||
int /*mode */ );
|
||||
|
||||
extern _X_EXPORT Bool InitPointerAccelerationScheme(DeviceIntPtr /*dev */ ,
|
||||
int /*scheme */ );
|
||||
|
||||
extern _X_EXPORT Bool InitFocusClassDeviceStruct(DeviceIntPtr /*device */ );
|
||||
|
||||
extern _X_EXPORT Bool InitTouchClassDeviceStruct(DeviceIntPtr /*device */ ,
|
||||
unsigned int /*max_touches */ ,
|
||||
unsigned int /*mode */ ,
|
||||
unsigned int /*numAxes */ );
|
||||
|
||||
extern _X_EXPORT Bool InitGestureClassDeviceStruct(DeviceIntPtr device,
|
||||
unsigned int max_touches);
|
||||
|
||||
typedef void (*BellProcPtr) (int percent,
|
||||
DeviceIntPtr device,
|
||||
void *ctrl,
|
||||
int feedbackClass);
|
||||
|
||||
typedef void (*KbdCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
||||
KeybdCtrl * /*ctrl */ );
|
||||
|
||||
typedef void (*PtrCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
||||
PtrCtrl * /*ctrl */ );
|
||||
|
||||
extern _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(DeviceIntPtr /*device */
|
||||
,
|
||||
PtrCtrlProcPtr
|
||||
/*controlProc */ );
|
||||
|
||||
typedef void (*StringCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
||||
StringCtrl * /*ctrl */ );
|
||||
|
||||
extern _X_EXPORT Bool InitStringFeedbackClassDeviceStruct(DeviceIntPtr
|
||||
/*device */ ,
|
||||
StringCtrlProcPtr
|
||||
/*controlProc */ ,
|
||||
int /*max_symbols */ ,
|
||||
int
|
||||
/*num_symbols_supported */
|
||||
,
|
||||
KeySym * /*symbols */
|
||||
);
|
||||
|
||||
typedef void (*BellCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
||||
BellCtrl * /*ctrl */ );
|
||||
|
||||
extern _X_EXPORT Bool InitBellFeedbackClassDeviceStruct(DeviceIntPtr /*device */
|
||||
,
|
||||
BellProcPtr
|
||||
/*bellProc */ ,
|
||||
BellCtrlProcPtr
|
||||
/*controlProc */ );
|
||||
|
||||
typedef void (*LedCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
||||
LedCtrl * /*ctrl */ );
|
||||
|
||||
extern _X_EXPORT Bool InitLedFeedbackClassDeviceStruct(DeviceIntPtr /*device */
|
||||
,
|
||||
LedCtrlProcPtr
|
||||
/*controlProc */ );
|
||||
|
||||
typedef void (*IntegerCtrlProcPtr) (DeviceIntPtr /*device */ ,
|
||||
IntegerCtrl * /*ctrl */ );
|
||||
|
||||
extern _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct(DeviceIntPtr
|
||||
/*device */ ,
|
||||
IntegerCtrlProcPtr
|
||||
/*controlProc */ );
|
||||
|
||||
extern _X_EXPORT Bool InitPointerDeviceStruct(DevicePtr /*device */ ,
|
||||
CARD8 * /*map */ ,
|
||||
int /*numButtons */ ,
|
||||
Atom * /* btn_labels */ ,
|
||||
PtrCtrlProcPtr /*controlProc */ ,
|
||||
int /*numMotionEvents */ ,
|
||||
int /*numAxes */ ,
|
||||
Atom * /* axes_labels */ );
|
||||
|
||||
extern _X_EXPORT Bool InitKeyboardDeviceStruct(DeviceIntPtr /*device */ ,
|
||||
XkbRMLVOSet * /*rmlvo */ ,
|
||||
BellProcPtr /*bellProc */ ,
|
||||
KbdCtrlProcPtr /*controlProc */
|
||||
);
|
||||
|
||||
extern _X_EXPORT Bool InitKeyboardDeviceStructFromString(DeviceIntPtr dev,
|
||||
const char *keymap,
|
||||
int keymap_length,
|
||||
BellProcPtr bell_func,
|
||||
KbdCtrlProcPtr ctrl_func);
|
||||
|
||||
extern _X_EXPORT void ProcessInputEvents(void);
|
||||
|
||||
extern _X_EXPORT void InitInput(int /*argc */ ,
|
||||
char ** /*argv */ );
|
||||
extern _X_EXPORT void CloseInput(void);
|
||||
|
||||
extern _X_EXPORT int GetMaximumEventsNum(void);
|
||||
|
||||
extern _X_EXPORT InternalEvent *InitEventList(int num_events);
|
||||
extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events);
|
||||
|
||||
extern _X_EXPORT int GetPointerEvents(InternalEvent *events,
|
||||
DeviceIntPtr pDev,
|
||||
int type,
|
||||
int buttons,
|
||||
int flags, const ValuatorMask *mask);
|
||||
|
||||
extern _X_EXPORT void QueuePointerEvents(DeviceIntPtr pDev,
|
||||
int type,
|
||||
int buttons,
|
||||
int flags, const ValuatorMask *mask);
|
||||
|
||||
extern _X_EXPORT int GetKeyboardEvents(InternalEvent *events,
|
||||
DeviceIntPtr pDev,
|
||||
int type,
|
||||
int key_code);
|
||||
|
||||
extern _X_EXPORT void QueueKeyboardEvents(DeviceIntPtr pDev,
|
||||
int type,
|
||||
int key_code);
|
||||
|
||||
extern _X_EXPORT int GetProximityEvents(InternalEvent *events,
|
||||
DeviceIntPtr pDev,
|
||||
int type, const ValuatorMask *mask);
|
||||
|
||||
extern _X_EXPORT void QueueProximityEvents(DeviceIntPtr pDev,
|
||||
int type, const ValuatorMask *mask);
|
||||
|
||||
extern _X_EXPORT int GetMotionHistorySize(void);
|
||||
|
||||
extern _X_EXPORT void AllocateMotionHistory(DeviceIntPtr pDev);
|
||||
|
||||
extern _X_EXPORT int GetMotionHistory(DeviceIntPtr pDev,
|
||||
xTimecoord ** buff,
|
||||
unsigned long start,
|
||||
unsigned long stop,
|
||||
ScreenPtr pScreen, BOOL core);
|
||||
|
||||
extern _X_EXPORT DeviceIntPtr GetPairedDevice(DeviceIntPtr kbd);
|
||||
extern _X_EXPORT DeviceIntPtr GetMaster(DeviceIntPtr dev, int type);
|
||||
|
||||
extern _X_EXPORT int AllocDevicePair(ClientPtr client,
|
||||
const char *name,
|
||||
DeviceIntPtr *ptr,
|
||||
DeviceIntPtr *keybd,
|
||||
DeviceProc ptr_proc,
|
||||
DeviceProc keybd_proc, Bool master);
|
||||
|
||||
/* Helper functions. */
|
||||
extern _X_EXPORT int generate_modkeymap(ClientPtr client, DeviceIntPtr dev,
|
||||
KeyCode **modkeymap,
|
||||
int *max_keys_per_mod);
|
||||
|
||||
enum TouchListenerState {
|
||||
TOUCH_LISTENER_AWAITING_BEGIN = 0, /**< Waiting for a TouchBegin event */
|
||||
TOUCH_LISTENER_AWAITING_OWNER, /**< Waiting for a TouchOwnership event */
|
||||
TOUCH_LISTENER_EARLY_ACCEPT, /**< Waiting for ownership, has already
|
||||
accepted */
|
||||
TOUCH_LISTENER_IS_OWNER, /**< Is the current owner, hasn't
|
||||
accepted */
|
||||
TOUCH_LISTENER_HAS_ACCEPTED, /**< Is the current owner, has accepted */
|
||||
TOUCH_LISTENER_HAS_END, /**< Has already received the end event */
|
||||
};
|
||||
|
||||
enum TouchListenerType {
|
||||
TOUCH_LISTENER_GRAB,
|
||||
TOUCH_LISTENER_POINTER_GRAB,
|
||||
TOUCH_LISTENER_REGULAR,
|
||||
TOUCH_LISTENER_POINTER_REGULAR,
|
||||
};
|
||||
|
||||
enum GestureListenerType {
|
||||
GESTURE_LISTENER_GRAB,
|
||||
GESTURE_LISTENER_NONGESTURE_GRAB,
|
||||
GESTURE_LISTENER_REGULAR
|
||||
};
|
||||
|
||||
extern _X_EXPORT InputAttributes *DuplicateInputAttributes(InputAttributes *
|
||||
attrs);
|
||||
|
||||
extern _X_EXPORT void FreeInputAttributes(InputAttributes * attrs);
|
||||
|
||||
/* Implemented by the DDX. */
|
||||
extern _X_EXPORT int NewInputDeviceRequest(InputOption *options,
|
||||
InputAttributes * attrs,
|
||||
DeviceIntPtr *dev);
|
||||
extern _X_EXPORT void DeleteInputDeviceRequest(DeviceIntPtr dev);
|
||||
extern _X_EXPORT void RemoveInputDeviceTraces(const char *config_info);
|
||||
extern _X_EXPORT void DDXRingBell(int volume, int pitch, int duration);
|
||||
extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
|
||||
extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
|
||||
extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
|
||||
int first_valuator,
|
||||
int num_valuators,
|
||||
const int *valuators);
|
||||
extern _X_EXPORT void valuator_mask_set(ValuatorMask *mask, int valuator,
|
||||
int data);
|
||||
extern _X_EXPORT void valuator_mask_set_double(ValuatorMask *mask, int valuator,
|
||||
double data);
|
||||
extern _X_EXPORT void valuator_mask_zero(ValuatorMask *mask);
|
||||
extern _X_EXPORT int valuator_mask_size(const ValuatorMask *mask);
|
||||
extern _X_EXPORT int valuator_mask_isset(const ValuatorMask *mask, int bit);
|
||||
extern _X_EXPORT void valuator_mask_unset(ValuatorMask *mask, int bit);
|
||||
extern _X_EXPORT int valuator_mask_num_valuators(const ValuatorMask *mask);
|
||||
extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
|
||||
const ValuatorMask *src);
|
||||
extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
|
||||
extern _X_EXPORT double valuator_mask_get_double(const ValuatorMask *mask,
|
||||
int valnum);
|
||||
extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask,
|
||||
int valnum, int *val);
|
||||
extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask,
|
||||
int valnum, double *val);
|
||||
extern _X_EXPORT Bool valuator_mask_has_unaccelerated(const ValuatorMask *mask);
|
||||
extern _X_EXPORT void valuator_mask_set_unaccelerated(ValuatorMask *mask,
|
||||
int valuator,
|
||||
double accel,
|
||||
double unaccel);
|
||||
extern _X_EXPORT void valuator_mask_set_absolute_unaccelerated(ValuatorMask *mask,
|
||||
int valuator,
|
||||
int absolute,
|
||||
double unaccel);
|
||||
extern _X_EXPORT double valuator_mask_get_accelerated(const ValuatorMask *mask,
|
||||
int valuator);
|
||||
extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask,
|
||||
int valuator);
|
||||
extern _X_EXPORT Bool valuator_mask_fetch_unaccelerated(const ValuatorMask *mask,
|
||||
int valuator,
|
||||
double *accel,
|
||||
double *unaccel);
|
||||
/* InputOption handling interface */
|
||||
extern _X_EXPORT InputOption *input_option_new(InputOption *list,
|
||||
const char *key,
|
||||
const char *value);
|
||||
extern _X_EXPORT void input_option_free_list(InputOption **opt);
|
||||
extern _X_EXPORT InputOption *input_option_free_element(InputOption *opt,
|
||||
const char *key);
|
||||
extern _X_EXPORT InputOption *input_option_find(InputOption *list,
|
||||
const char *key);
|
||||
extern _X_EXPORT const char *input_option_get_key(const InputOption *opt);
|
||||
extern _X_EXPORT const char *input_option_get_value(const InputOption *opt);
|
||||
extern _X_EXPORT void input_option_set_key(InputOption *opt, const char *key);
|
||||
extern _X_EXPORT void input_option_set_value(InputOption *opt,
|
||||
const char *value);
|
||||
|
||||
extern _X_EXPORT void input_lock(void);
|
||||
extern _X_EXPORT void input_unlock(void);
|
||||
extern _X_EXPORT void input_force_unlock(void);
|
||||
extern _X_EXPORT int in_input_thread(void);
|
||||
|
||||
extern _X_EXPORT Bool InputThreadEnable;
|
||||
|
||||
#endif /* INPUT_H */
|
||||
@@ -0,0 +1,672 @@
|
||||
/************************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 INPUTSTRUCT_H
|
||||
#define INPUTSTRUCT_H
|
||||
|
||||
#include <X11/extensions/XI2proto.h>
|
||||
|
||||
#include <pixman.h>
|
||||
#include "input.h"
|
||||
#include "window.h"
|
||||
#include "dixstruct.h"
|
||||
#include "cursorstr.h"
|
||||
#include "privates.h"
|
||||
|
||||
#define BitIsOn(ptr, bit) (!!(((const BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7))))
|
||||
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7)))
|
||||
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7)))
|
||||
|
||||
#define EMASKSIZE (MAXDEVICES + 2)
|
||||
|
||||
/* This is the last XI2 event supported by the server. If you add
|
||||
* events to the protocol, the server will not support these events until
|
||||
* this number here is bumped.
|
||||
*/
|
||||
#define XI2LASTEVENT XI_GestureSwipeEnd
|
||||
#define XI2MASKSIZE ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */
|
||||
|
||||
/**
|
||||
* Scroll types for ::SetScrollValuator and the scroll type in the
|
||||
* ::ScrollInfoPtr.
|
||||
*/
|
||||
enum ScrollType {
|
||||
SCROLL_TYPE_NONE = 0, /**< Not a scrolling valuator */
|
||||
SCROLL_TYPE_VERTICAL = 8,
|
||||
SCROLL_TYPE_HORIZONTAL = 9,
|
||||
};
|
||||
|
||||
/**
|
||||
* This struct stores the core event mask for each client except the client
|
||||
* that created the window.
|
||||
*
|
||||
* Each window that has events selected from other clients has at least one of
|
||||
* these masks. If multiple clients selected for events on the same window,
|
||||
* these masks are in a linked list.
|
||||
*
|
||||
* The event mask for the client that created the window is stored in
|
||||
* win->eventMask instead.
|
||||
*
|
||||
* The resource id is simply a fake client ID to associate this mask with a
|
||||
* client.
|
||||
*
|
||||
* Kludge: OtherClients and InputClients must be compatible, see code.
|
||||
*/
|
||||
typedef struct _OtherClients {
|
||||
OtherClientsPtr next; /**< Pointer to the next mask */
|
||||
XID resource; /**< id for putting into resource manager */
|
||||
Mask mask; /**< Core event mask */
|
||||
} OtherClients;
|
||||
|
||||
/**
|
||||
* This struct stores the XI event mask for each client.
|
||||
*
|
||||
* Each window that has events selected has at least one of these masks. If
|
||||
* multiple client selected for events on the same window, these masks are in
|
||||
* a linked list.
|
||||
*/
|
||||
typedef struct _InputClients {
|
||||
InputClientsPtr next; /**< Pointer to the next mask */
|
||||
XID resource; /**< id for putting into resource manager */
|
||||
Mask mask[EMASKSIZE]; /**< Actual XI event mask, deviceid is index */
|
||||
/** XI2 event masks. One per device, each bit is a mask of (1 << type) */
|
||||
struct _XI2Mask *xi2mask;
|
||||
} InputClients;
|
||||
|
||||
/**
|
||||
* Combined XI event masks from all devices.
|
||||
*
|
||||
* This is the XI equivalent of the deliverableEvents, eventMask and
|
||||
* dontPropagate mask of the WindowRec (or WindowOptRec).
|
||||
*
|
||||
* A window that has an XI client selecting for events has exactly one
|
||||
* OtherInputMasks struct and exactly one InputClients struct hanging off
|
||||
* inputClients. Each further client appends to the inputClients list.
|
||||
* Each Mask field is per-device, with the device id as the index.
|
||||
* Exception: for non-device events (Presence events), the MAXDEVICES
|
||||
* deviceid is used.
|
||||
*/
|
||||
typedef struct _OtherInputMasks {
|
||||
/**
|
||||
* Bitwise OR of all masks by all clients and the window's parent's masks.
|
||||
*/
|
||||
Mask deliverableEvents[EMASKSIZE];
|
||||
/**
|
||||
* Bitwise OR of all masks by all clients on this window.
|
||||
*/
|
||||
Mask inputEvents[EMASKSIZE];
|
||||
/** The do-not-propagate masks for each device. */
|
||||
Mask dontPropagateMask[EMASKSIZE];
|
||||
/** The clients that selected for events */
|
||||
InputClientsPtr inputClients;
|
||||
/* XI2 event masks. One per device, each bit is a mask of (1 << type) */
|
||||
struct _XI2Mask *xi2mask;
|
||||
} OtherInputMasks;
|
||||
|
||||
/*
|
||||
* The following structure gets used for both active and passive grabs. For
|
||||
* active grabs some of the fields (e.g. modifiers) are not used. However,
|
||||
* that is not much waste since there aren't many active grabs (one per
|
||||
* keyboard/pointer device) going at once in the server.
|
||||
*/
|
||||
|
||||
typedef struct _DetailRec { /* Grab details may be bit masks */
|
||||
unsigned int exact;
|
||||
Mask *pMask;
|
||||
} DetailRec;
|
||||
|
||||
union _GrabMask {
|
||||
Mask core;
|
||||
Mask xi;
|
||||
struct _XI2Mask *xi2mask;
|
||||
};
|
||||
|
||||
/**
|
||||
* Central struct for device grabs.
|
||||
* The same struct is used for both core grabs and device grabs, with
|
||||
* different fields being set.
|
||||
* If the grab is a core grab (GrabPointer/GrabKeyboard), then the eventMask
|
||||
* is a combination of standard event masks (i.e. PointerMotionMask |
|
||||
* ButtonPressMask).
|
||||
* If the grab is a device grab (GrabDevice), then the eventMask is a
|
||||
* combination of event masks for a given XI event type (see SetEventInfo).
|
||||
*
|
||||
* If the grab is a result of a ButtonPress, then eventMask is the core mask
|
||||
* and deviceMask is set to the XI event mask for the grab.
|
||||
*/
|
||||
typedef struct _GrabRec {
|
||||
GrabPtr next; /* for chain of passive grabs */
|
||||
XID resource;
|
||||
DeviceIntPtr device;
|
||||
WindowPtr window;
|
||||
unsigned ownerEvents:1;
|
||||
unsigned keyboardMode:1;
|
||||
unsigned pointerMode:1;
|
||||
enum InputLevel grabtype;
|
||||
CARD8 type; /* event type for passive grabs, 0 for active grabs */
|
||||
DetailRec modifiersDetail;
|
||||
DeviceIntPtr modifierDevice;
|
||||
DetailRec detail; /* key or button */
|
||||
WindowPtr confineTo; /* always NULL for keyboards */
|
||||
CursorPtr cursor; /* always NULL for keyboards */
|
||||
Mask eventMask;
|
||||
Mask deviceMask;
|
||||
/* XI2 event masks. One per device, each bit is a mask of (1 << type) */
|
||||
struct _XI2Mask *xi2mask;
|
||||
} GrabRec;
|
||||
|
||||
/**
|
||||
* Sprite information for a device.
|
||||
*/
|
||||
typedef struct _SpriteRec {
|
||||
CursorPtr current;
|
||||
BoxRec hotLimits; /* logical constraints of hot spot */
|
||||
Bool confined; /* confined to screen */
|
||||
RegionPtr hotShape; /* additional logical shape constraint */
|
||||
BoxRec physLimits; /* physical constraints of hot spot */
|
||||
WindowPtr win; /* window of logical position */
|
||||
HotSpot hot; /* logical pointer position */
|
||||
HotSpot hotPhys; /* physical pointer position */
|
||||
#ifdef XINERAMA
|
||||
ScreenPtr screen; /* all others are in Screen 0 coordinates */
|
||||
RegionRec Reg1; /* Region 1 for confining motion */
|
||||
RegionRec Reg2; /* Region 2 for confining virtual motion */
|
||||
WindowPtr windows[MAXSCREENS];
|
||||
WindowPtr confineWin; /* confine window */
|
||||
#endif /* XINERAMA */
|
||||
/* The window trace information is used at dix/events.c to avoid having
|
||||
* to compute all the windows between the root and the current pointer
|
||||
* window each time a button or key goes down. The grabs on each of those
|
||||
* windows must be checked.
|
||||
* spriteTraces should only be used at dix/events.c! */
|
||||
WindowPtr *spriteTrace;
|
||||
int spriteTraceSize;
|
||||
int spriteTraceGood;
|
||||
|
||||
/* Due to delays between event generation and event processing, it is
|
||||
* possible that the pointer has crossed screen boundaries between the
|
||||
* time in which it begins generating events and the time when
|
||||
* those events are processed.
|
||||
*
|
||||
* pEnqueueScreen: screen the pointer was on when the event was generated
|
||||
* pDequeueScreen: screen the pointer was on when the event is processed
|
||||
*/
|
||||
ScreenPtr pEnqueueScreen;
|
||||
ScreenPtr pDequeueScreen;
|
||||
|
||||
} SpriteRec;
|
||||
|
||||
typedef struct _KeyClassRec {
|
||||
int sourceid;
|
||||
CARD8 down[DOWN_LENGTH];
|
||||
CARD8 postdown[DOWN_LENGTH];
|
||||
int modifierKeyCount[8];
|
||||
struct _XkbSrvInfo *xkbInfo;
|
||||
} KeyClassRec, *KeyClassPtr;
|
||||
|
||||
typedef struct _ScrollInfo {
|
||||
enum ScrollType type;
|
||||
double increment;
|
||||
int flags;
|
||||
} ScrollInfo, *ScrollInfoPtr;
|
||||
|
||||
typedef struct _AxisInfo {
|
||||
int resolution;
|
||||
int min_resolution;
|
||||
int max_resolution;
|
||||
int min_value;
|
||||
int max_value;
|
||||
Atom label;
|
||||
CARD8 mode;
|
||||
ScrollInfo scroll;
|
||||
} AxisInfo, *AxisInfoPtr;
|
||||
|
||||
typedef struct _ValuatorAccelerationRec {
|
||||
int number;
|
||||
PointerAccelSchemeProc AccelSchemeProc;
|
||||
void *accelData; /* at disposal of AccelScheme */
|
||||
PointerAccelSchemeInitProc AccelInitProc;
|
||||
DeviceCallbackProc AccelCleanupProc;
|
||||
} ValuatorAccelerationRec, *ValuatorAccelerationPtr;
|
||||
|
||||
typedef struct _ValuatorClassRec {
|
||||
int sourceid;
|
||||
int numMotionEvents;
|
||||
int first_motion;
|
||||
int last_motion;
|
||||
void *motion; /* motion history buffer. Different layout
|
||||
for MDs and SDs! */
|
||||
WindowPtr motionHintWindow;
|
||||
|
||||
AxisInfoPtr axes;
|
||||
unsigned short numAxes;
|
||||
double *axisVal; /* always absolute, but device-coord system */
|
||||
ValuatorAccelerationRec accelScheme;
|
||||
int h_scroll_axis; /* horiz smooth-scrolling axis */
|
||||
int v_scroll_axis; /* vert smooth-scrolling axis */
|
||||
} ValuatorClassRec;
|
||||
|
||||
typedef struct _TouchListener {
|
||||
XID listener; /* grabs/event selection IDs receiving
|
||||
* events for this touch */
|
||||
int resource_type; /* listener's resource type */
|
||||
enum TouchListenerType type;
|
||||
enum TouchListenerState state;
|
||||
enum InputLevel level; /* matters only for emulating touches */
|
||||
WindowPtr window;
|
||||
GrabPtr grab;
|
||||
} TouchListener;
|
||||
|
||||
typedef struct _TouchPointInfo {
|
||||
uint32_t client_id; /* touch ID as seen in client events */
|
||||
int sourceid; /* Source device's ID for this touchpoint */
|
||||
Bool active; /* whether or not the touch is active */
|
||||
Bool pending_finish; /* true if the touch is physically inactive
|
||||
* but still owned by a grab */
|
||||
SpriteRec sprite; /* window trace for delivery */
|
||||
ValuatorMask *valuators; /* last recorded axis values */
|
||||
TouchListener *listeners; /* set of listeners */
|
||||
int num_listeners;
|
||||
int num_grabs; /* number of open grabs on this touch
|
||||
* which have not accepted or rejected */
|
||||
Bool emulate_pointer;
|
||||
DeviceEvent *history; /* History of events on this touchpoint */
|
||||
size_t history_elements; /* Number of current elements in history */
|
||||
size_t history_size; /* Size of history in elements */
|
||||
} TouchPointInfoRec;
|
||||
|
||||
typedef struct _TouchClassRec {
|
||||
int sourceid;
|
||||
TouchPointInfoPtr touches;
|
||||
unsigned short num_touches; /* number of allocated touches */
|
||||
unsigned short max_touches; /* maximum number of touches, may be 0 */
|
||||
CARD8 mode; /* ::XIDirectTouch, XIDependentTouch */
|
||||
/* for pointer-emulation */
|
||||
CARD8 buttonsDown; /* number of buttons down */
|
||||
unsigned short state; /* logical button state */
|
||||
Mask motionMask;
|
||||
} TouchClassRec;
|
||||
|
||||
typedef struct _GestureListener {
|
||||
XID listener; /* grabs/event selection IDs receiving
|
||||
* events for this gesture */
|
||||
int resource_type; /* listener's resource type */
|
||||
enum GestureListenerType type;
|
||||
WindowPtr window;
|
||||
GrabPtr grab;
|
||||
} GestureListener;
|
||||
|
||||
typedef struct _GestureInfo {
|
||||
int sourceid; /* Source device's ID for this gesture */
|
||||
Bool active; /* whether or not the gesture is active */
|
||||
uint8_t type; /* Gesture type: either ET_GesturePinchBegin or
|
||||
ET_GestureSwipeBegin. Valid if active == TRUE */
|
||||
int num_touches; /* The number of touches in the gesture */
|
||||
SpriteRec sprite; /* window trace for delivery */
|
||||
GestureListener listener; /* the listener that will receive events */
|
||||
Bool has_listener; /* true if listener has been setup already */
|
||||
} GestureInfoRec;
|
||||
|
||||
typedef struct _GestureClassRec {
|
||||
int sourceid;
|
||||
GestureInfoRec gesture;
|
||||
unsigned short max_touches; /* maximum number of touches, may be 0 */
|
||||
} GestureClassRec;
|
||||
|
||||
typedef struct _ButtonClassRec {
|
||||
int sourceid;
|
||||
CARD8 numButtons;
|
||||
CARD8 buttonsDown; /* number of buttons currently down
|
||||
This counts logical buttons, not
|
||||
physical ones, i.e if some buttons
|
||||
are mapped to 0, they're not counted
|
||||
here */
|
||||
unsigned short state;
|
||||
Mask motionMask;
|
||||
CARD8 down[DOWN_LENGTH];
|
||||
CARD8 postdown[DOWN_LENGTH];
|
||||
CARD8 map[MAP_LENGTH];
|
||||
union _XkbAction *xkb_acts;
|
||||
Atom labels[MAX_BUTTONS];
|
||||
} ButtonClassRec, *ButtonClassPtr;
|
||||
|
||||
typedef struct _FocusClassRec {
|
||||
int sourceid;
|
||||
WindowPtr win; /* May be set to a int constant (e.g. PointerRootWin)! */
|
||||
int revert;
|
||||
TimeStamp time;
|
||||
WindowPtr *trace;
|
||||
int traceSize;
|
||||
int traceGood;
|
||||
} FocusClassRec, *FocusClassPtr;
|
||||
|
||||
typedef struct _ProximityClassRec {
|
||||
int sourceid;
|
||||
char in_proximity;
|
||||
} ProximityClassRec, *ProximityClassPtr;
|
||||
|
||||
typedef struct _KbdFeedbackClassRec *KbdFeedbackPtr;
|
||||
typedef struct _PtrFeedbackClassRec *PtrFeedbackPtr;
|
||||
typedef struct _IntegerFeedbackClassRec *IntegerFeedbackPtr;
|
||||
typedef struct _StringFeedbackClassRec *StringFeedbackPtr;
|
||||
typedef struct _BellFeedbackClassRec *BellFeedbackPtr;
|
||||
typedef struct _LedFeedbackClassRec *LedFeedbackPtr;
|
||||
|
||||
typedef struct _KbdFeedbackClassRec {
|
||||
BellProcPtr BellProc;
|
||||
KbdCtrlProcPtr CtrlProc;
|
||||
KeybdCtrl ctrl;
|
||||
KbdFeedbackPtr next;
|
||||
struct _XkbSrvLedInfo *xkb_sli;
|
||||
} KbdFeedbackClassRec;
|
||||
|
||||
typedef struct _PtrFeedbackClassRec {
|
||||
PtrCtrlProcPtr CtrlProc;
|
||||
PtrCtrl ctrl;
|
||||
PtrFeedbackPtr next;
|
||||
} PtrFeedbackClassRec;
|
||||
|
||||
typedef struct _IntegerFeedbackClassRec {
|
||||
IntegerCtrlProcPtr CtrlProc;
|
||||
IntegerCtrl ctrl;
|
||||
IntegerFeedbackPtr next;
|
||||
} IntegerFeedbackClassRec;
|
||||
|
||||
typedef struct _StringFeedbackClassRec {
|
||||
StringCtrlProcPtr CtrlProc;
|
||||
StringCtrl ctrl;
|
||||
StringFeedbackPtr next;
|
||||
} StringFeedbackClassRec;
|
||||
|
||||
typedef struct _BellFeedbackClassRec {
|
||||
BellProcPtr BellProc;
|
||||
BellCtrlProcPtr CtrlProc;
|
||||
BellCtrl ctrl;
|
||||
BellFeedbackPtr next;
|
||||
} BellFeedbackClassRec;
|
||||
|
||||
typedef struct _LedFeedbackClassRec {
|
||||
LedCtrlProcPtr CtrlProc;
|
||||
LedCtrl ctrl;
|
||||
LedFeedbackPtr next;
|
||||
struct _XkbSrvLedInfo *xkb_sli;
|
||||
} LedFeedbackClassRec;
|
||||
|
||||
typedef struct _ClassesRec {
|
||||
KeyClassPtr key;
|
||||
ValuatorClassPtr valuator;
|
||||
TouchClassPtr touch;
|
||||
GestureClassPtr gesture;
|
||||
ButtonClassPtr button;
|
||||
FocusClassPtr focus;
|
||||
ProximityClassPtr proximity;
|
||||
KbdFeedbackPtr kbdfeed;
|
||||
PtrFeedbackPtr ptrfeed;
|
||||
IntegerFeedbackPtr intfeed;
|
||||
StringFeedbackPtr stringfeed;
|
||||
BellFeedbackPtr bell;
|
||||
LedFeedbackPtr leds;
|
||||
} ClassesRec;
|
||||
|
||||
/* Device properties */
|
||||
typedef struct _XIPropertyValue {
|
||||
Atom type; /* ignored by server */
|
||||
short format; /* format of data for swapping - 8,16,32 */
|
||||
long size; /* size of data in (format/8) bytes */
|
||||
void *data; /* private to client */
|
||||
} XIPropertyValueRec;
|
||||
|
||||
typedef struct _XIProperty {
|
||||
struct _XIProperty *next;
|
||||
Atom propertyName;
|
||||
BOOL deletable; /* clients can delete this prop? */
|
||||
XIPropertyValueRec value;
|
||||
} XIPropertyRec;
|
||||
|
||||
typedef XIPropertyRec *XIPropertyPtr;
|
||||
typedef XIPropertyValueRec *XIPropertyValuePtr;
|
||||
|
||||
typedef struct _XIPropertyHandler {
|
||||
struct _XIPropertyHandler *next;
|
||||
long id;
|
||||
int (*SetProperty) (DeviceIntPtr dev,
|
||||
Atom property, XIPropertyValuePtr prop, BOOL checkonly);
|
||||
int (*GetProperty) (DeviceIntPtr dev, Atom property);
|
||||
int (*DeleteProperty) (DeviceIntPtr dev, Atom property);
|
||||
} XIPropertyHandler, *XIPropertyHandlerPtr;
|
||||
|
||||
typedef struct _GrabInfoRec {
|
||||
TimeStamp grabTime;
|
||||
Bool fromPassiveGrab; /* true if from passive grab */
|
||||
Bool implicitGrab; /* implicit from ButtonPress */
|
||||
GrabPtr unused; /* Kept for ABI stability, remove soon */
|
||||
GrabPtr grab;
|
||||
CARD8 activatingKey;
|
||||
void (*ActivateGrab) (DeviceIntPtr /*device */ ,
|
||||
GrabPtr /*grab */ ,
|
||||
TimeStamp /*time */ ,
|
||||
Bool /*autoGrab */ );
|
||||
void (*DeactivateGrab) (DeviceIntPtr /*device */ );
|
||||
struct {
|
||||
Bool frozen;
|
||||
int state;
|
||||
GrabPtr other; /* if other grab has this frozen */
|
||||
InternalEvent *event; /* saved to be replayed */
|
||||
} sync;
|
||||
} GrabInfoRec, *GrabInfoPtr;
|
||||
|
||||
typedef struct _SpriteInfoRec {
|
||||
/* sprite must always point to a valid sprite. For devices sharing the
|
||||
* sprite, let sprite point to a paired spriteOwner's sprite. */
|
||||
SpritePtr sprite; /* sprite information */
|
||||
Bool spriteOwner; /* True if device owns the sprite */
|
||||
DeviceIntPtr paired; /* The paired device. Keyboard if
|
||||
spriteOwner is TRUE, otherwise the
|
||||
pointer that owns the sprite. */
|
||||
|
||||
/* keep states for animated cursor */
|
||||
struct {
|
||||
CursorPtr pCursor;
|
||||
ScreenPtr pScreen;
|
||||
int elt;
|
||||
} anim;
|
||||
} SpriteInfoRec, *SpriteInfoPtr;
|
||||
|
||||
/* device types */
|
||||
#define MASTER_POINTER 1
|
||||
#define MASTER_KEYBOARD 2
|
||||
#define SLAVE 3
|
||||
/* special types for GetMaster */
|
||||
#define MASTER_ATTACHED 4 /* Master for this device */
|
||||
#define KEYBOARD_OR_FLOAT 5 /* Keyboard master for this device or this device if floating */
|
||||
#define POINTER_OR_FLOAT 6 /* Pointer master for this device or this device if floating */
|
||||
|
||||
typedef struct _DeviceIntRec {
|
||||
DeviceRec public;
|
||||
DeviceIntPtr next;
|
||||
Bool startup; /* true if needs to be turned on at
|
||||
server initialization time */
|
||||
DeviceProc deviceProc; /* proc(DevicePtr, DEVICE_xx). It is
|
||||
used to initialize, turn on, or
|
||||
turn off the device */
|
||||
Bool inited; /* TRUE if INIT returns Success */
|
||||
Bool enabled; /* TRUE if ON returns Success */
|
||||
Bool coreEvents; /* TRUE if device also sends core */
|
||||
GrabInfoRec deviceGrab; /* grab on the device */
|
||||
int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
|
||||
Atom xinput_type;
|
||||
char *name;
|
||||
int id;
|
||||
KeyClassPtr key;
|
||||
ValuatorClassPtr valuator;
|
||||
TouchClassPtr touch;
|
||||
GestureClassPtr gesture;
|
||||
ButtonClassPtr button;
|
||||
FocusClassPtr focus;
|
||||
ProximityClassPtr proximity;
|
||||
KbdFeedbackPtr kbdfeed;
|
||||
PtrFeedbackPtr ptrfeed;
|
||||
IntegerFeedbackPtr intfeed;
|
||||
StringFeedbackPtr stringfeed;
|
||||
BellFeedbackPtr bell;
|
||||
LedFeedbackPtr leds;
|
||||
struct _XkbInterest *xkb_interest;
|
||||
char *config_info; /* used by the hotplug layer */
|
||||
ClassesPtr unused_classes; /* for master devices */
|
||||
int saved_master_id; /* for slaves while grabbed */
|
||||
PrivateRec *devPrivates;
|
||||
DeviceUnwrapProc unwrapProc;
|
||||
SpriteInfoPtr spriteInfo;
|
||||
DeviceIntPtr master; /* master device */
|
||||
DeviceIntPtr lastSlave; /* last slave device used */
|
||||
|
||||
/* last valuator values recorded, not posted to client;
|
||||
* for slave devices, valuators is in device coordinates, mapped to the
|
||||
* desktop
|
||||
* for master devices, valuators is in desktop coordinates.
|
||||
* see dix/getevents.c
|
||||
* remainder supports acceleration
|
||||
*/
|
||||
struct {
|
||||
double valuators[MAX_VALUATORS];
|
||||
int numValuators;
|
||||
DeviceIntPtr slave;
|
||||
ValuatorMask *scroll;
|
||||
int num_touches; /* size of the touches array */
|
||||
DDXTouchPointInfoPtr touches;
|
||||
} last;
|
||||
|
||||
/* Input device property handling. */
|
||||
struct {
|
||||
XIPropertyPtr properties;
|
||||
XIPropertyHandlerPtr handlers; /* NULL-terminated */
|
||||
} properties;
|
||||
|
||||
/* coordinate transformation matrix for relative movement. Matrix with
|
||||
* the translation component dropped */
|
||||
struct pixman_f_transform relative_transform;
|
||||
/* scale matrix for absolute devices, this is the combined matrix of
|
||||
[1/scale] . [transform] . [scale]. See DeviceSetTransform */
|
||||
struct pixman_f_transform scale_and_transform;
|
||||
|
||||
/* XTest related master device id */
|
||||
int xtest_master_id;
|
||||
DeviceSendEventsProc sendEventsProc;
|
||||
|
||||
struct _SyncCounter *idle_counter;
|
||||
|
||||
Bool ignoreXkbActionsBehaviors; /* TRUE if keys don't trigger behaviors and actions */
|
||||
} DeviceIntRec;
|
||||
|
||||
typedef struct {
|
||||
int numDevices; /* total number of devices */
|
||||
DeviceIntPtr devices; /* all devices turned on */
|
||||
DeviceIntPtr off_devices; /* all devices turned off */
|
||||
DeviceIntPtr keyboard; /* the main one for the server */
|
||||
DeviceIntPtr pointer;
|
||||
DeviceIntPtr all_devices;
|
||||
DeviceIntPtr all_master_devices;
|
||||
} InputInfo;
|
||||
|
||||
extern _X_EXPORT InputInfo inputInfo;
|
||||
|
||||
/* for keeping the events for devices grabbed synchronously */
|
||||
typedef struct _QdEvent *QdEventPtr;
|
||||
typedef struct _QdEvent {
|
||||
struct xorg_list next;
|
||||
DeviceIntPtr device;
|
||||
ScreenPtr pScreen; /* what screen the pointer was on */
|
||||
unsigned long months; /* milliseconds is in the event */
|
||||
InternalEvent *event;
|
||||
} QdEventRec;
|
||||
|
||||
/**
|
||||
* syncEvents is the global structure for queued events.
|
||||
*
|
||||
* Devices can be frozen through GrabModeSync pointer grabs. If this is the
|
||||
* case, events from these devices are added to "pending" instead of being
|
||||
* processed normally. When the device is unfrozen, events in "pending" are
|
||||
* replayed and processed as if they would come from the device directly.
|
||||
*/
|
||||
typedef struct _EventSyncInfo {
|
||||
struct xorg_list pending;
|
||||
|
||||
/** The device to replay events for. Only set in AllowEvents(), in which
|
||||
* case it is set to the device specified in the request. */
|
||||
DeviceIntPtr replayDev; /* kludgy rock to put flag for */
|
||||
|
||||
/**
|
||||
* The window the events are supposed to be replayed on.
|
||||
* This window may be set to the grab's window (but only when
|
||||
* Replay{Pointer|Keyboard} is given in the XAllowEvents()
|
||||
* request. */
|
||||
WindowPtr replayWin; /* ComputeFreezes */
|
||||
/**
|
||||
* Flag to indicate whether we're in the process of
|
||||
* replaying events. Only set in ComputeFreezes(). */
|
||||
Bool playingEvents;
|
||||
TimeStamp time;
|
||||
} EventSyncInfoRec, *EventSyncInfoPtr;
|
||||
|
||||
extern EventSyncInfoRec syncEvents;
|
||||
|
||||
/**
|
||||
* Given a sprite, returns the window at the bottom of the trace (i.e. the
|
||||
* furthest window from the root).
|
||||
*/
|
||||
static inline WindowPtr
|
||||
DeepestSpriteWin(SpritePtr sprite)
|
||||
{
|
||||
return sprite->spriteTrace[sprite->spriteTraceGood - 1];
|
||||
}
|
||||
|
||||
struct _XI2Mask {
|
||||
unsigned char **masks; /* event mask in masks[deviceid][event type byte] */
|
||||
size_t nmasks; /* number of masks */
|
||||
size_t mask_size; /* size of each mask in bytes */
|
||||
};
|
||||
|
||||
#endif /* INPUTSTRUCT_H */
|
||||
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Copyright © 2015 Red Hat, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _LIBINPUT_PROPERTIES_H_
|
||||
#define _LIBINPUT_PROPERTIES_H_
|
||||
|
||||
/* Tapping enabled/disabled: BOOL, 1 value */
|
||||
#define LIBINPUT_PROP_TAP "libinput Tapping Enabled"
|
||||
|
||||
/* Tapping default enabled/disabled: BOOL, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_TAP_DEFAULT "libinput Tapping Enabled Default"
|
||||
|
||||
/* Tap drag enabled/disabled: BOOL, 1 value */
|
||||
#define LIBINPUT_PROP_TAP_DRAG "libinput Tapping Drag Enabled"
|
||||
|
||||
/* Tap drag default enabled/disabled: BOOL, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_TAP_DRAG_DEFAULT "libinput Tapping Drag Enabled Default"
|
||||
|
||||
/* Tap drag lock enabled/disabled: BOOL, 1 value */
|
||||
#define LIBINPUT_PROP_TAP_DRAG_LOCK "libinput Tapping Drag Lock Enabled"
|
||||
|
||||
/* Tap drag lock default enabled/disabled: BOOL, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_TAP_DRAG_LOCK_DEFAULT "libinput Tapping Drag Lock Enabled Default"
|
||||
|
||||
/* Tap button order: BOOL, 2 values in order LRM, LMR, only one may be set
|
||||
at any time */
|
||||
#define LIBINPUT_PROP_TAP_BUTTONMAP "libinput Tapping Button Mapping Enabled"
|
||||
|
||||
/* Tap button default order: BOOL, 2 values in order LRM, LMR, read-only */
|
||||
#define LIBINPUT_PROP_TAP_BUTTONMAP_DEFAULT "libinput Tapping Button Mapping Default"
|
||||
|
||||
/* Clickfinger button order: BOOL, 2 values in order LRM, LMR, only one may be set
|
||||
at any time */
|
||||
#define LIBINPUT_PROP_CLICKFINGER_BUTTONMAP "libinput Clickfinger Button Mapping Enabled"
|
||||
|
||||
/* Clickfinger button default order: BOOL, 2 values in order LRM, LMR, read-only */
|
||||
#define LIBINPUT_PROP_CLICKFINGER_BUTTONMAP_DEFAULT "libinput Clickfinger Button Mapping Default"
|
||||
|
||||
/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows */
|
||||
#define LIBINPUT_PROP_CALIBRATION "libinput Calibration Matrix"
|
||||
|
||||
/* Calibration matrix: FLOAT, 9 values of a 3x3 matrix, in rows, read-only*/
|
||||
#define LIBINPUT_PROP_CALIBRATION_DEFAULT "libinput Calibration Matrix Default"
|
||||
|
||||
/* Pointer accel speed: FLOAT, 1 value, 32 bit */
|
||||
#define LIBINPUT_PROP_ACCEL "libinput Accel Speed"
|
||||
|
||||
/* Pointer accel speed: FLOAT, 1 value, 32 bit, read-only*/
|
||||
#define LIBINPUT_PROP_ACCEL_DEFAULT "libinput Accel Speed Default"
|
||||
|
||||
/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
|
||||
* only one is enabled at a time at max, read-only */
|
||||
#define LIBINPUT_PROP_ACCEL_PROFILES_AVAILABLE "libinput Accel Profiles Available"
|
||||
|
||||
/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
|
||||
only one is enabled at a time at max, read-only */
|
||||
#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED_DEFAULT "libinput Accel Profile Enabled Default"
|
||||
|
||||
/* Pointer accel profile: BOOL, 3 values in order adaptive, flat, custom
|
||||
only one is enabled at a time at max */
|
||||
#define LIBINPUT_PROP_ACCEL_PROFILE_ENABLED "libinput Accel Profile Enabled"
|
||||
|
||||
/* Points for the custom accel profile: FLOAT, N values */
|
||||
#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_FALLBACK "libinput Accel Custom Fallback Points"
|
||||
|
||||
/* Steps for the custom accel profile: FLOAT, 1 value */
|
||||
#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_FALLBACK "libinput Accel Custom Fallback Step"
|
||||
|
||||
/* Points for the custom accel profile: FLOAT, N values */
|
||||
#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_MOTION "libinput Accel Custom Motion Points"
|
||||
|
||||
/* Steps for the custom accel profile: FLOAT, 1 value */
|
||||
#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_MOTION "libinput Accel Custom Motion Step"
|
||||
|
||||
/* Points for the custom accel profile: FLOAT, N values */
|
||||
#define LIBINPUT_PROP_ACCEL_CUSTOM_POINTS_SCROLL "libinput Accel Custom Scroll Points"
|
||||
|
||||
/* Steps for the custom accel profile: FLOAT, 1 value */
|
||||
#define LIBINPUT_PROP_ACCEL_CUSTOM_STEP_SCROLL "libinput Accel Custom Scroll Step"
|
||||
|
||||
/* Natural scrolling: BOOL, 1 value */
|
||||
#define LIBINPUT_PROP_NATURAL_SCROLL "libinput Natural Scrolling Enabled"
|
||||
|
||||
/* Natural scrolling: BOOL, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_NATURAL_SCROLL_DEFAULT "libinput Natural Scrolling Enabled Default"
|
||||
|
||||
/* Send-events mode: BOOL read-only, 2 values in order disabled,
|
||||
disabled-on-external-mouse */
|
||||
#define LIBINPUT_PROP_SENDEVENTS_AVAILABLE "libinput Send Events Modes Available"
|
||||
|
||||
/* Send-events mode: BOOL, 2 values in order disabled,
|
||||
disabled-on-external-mouse */
|
||||
#define LIBINPUT_PROP_SENDEVENTS_ENABLED "libinput Send Events Mode Enabled"
|
||||
|
||||
/* Send-events mode: BOOL, 2 values in order disabled,
|
||||
disabled-on-external-mouse, read-only */
|
||||
#define LIBINPUT_PROP_SENDEVENTS_ENABLED_DEFAULT "libinput Send Events Mode Enabled Default"
|
||||
|
||||
/* Left-handed enabled/disabled: BOOL, 1 value */
|
||||
#define LIBINPUT_PROP_LEFT_HANDED "libinput Left Handed Enabled"
|
||||
|
||||
/* Left-handed enabled/disabled: BOOL, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_LEFT_HANDED_DEFAULT "libinput Left Handed Enabled Default"
|
||||
|
||||
/* Scroll method: BOOL read-only, 3 values in order 2fg, edge, button.
|
||||
shows available scroll methods */
|
||||
#define LIBINPUT_PROP_SCROLL_METHODS_AVAILABLE "libinput Scroll Methods Available"
|
||||
|
||||
/* Scroll method: BOOL, 3 values in order 2fg, edge, button
|
||||
only one is enabled at a time at max */
|
||||
#define LIBINPUT_PROP_SCROLL_METHOD_ENABLED "libinput Scroll Method Enabled"
|
||||
|
||||
/* Scroll method: BOOL, 3 values in order 2fg, edge, button
|
||||
only one is enabled at a time at max, read-only */
|
||||
#define LIBINPUT_PROP_SCROLL_METHOD_ENABLED_DEFAULT "libinput Scroll Method Enabled Default"
|
||||
|
||||
/* Scroll button for button scrolling: 32-bit int, 1 value */
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON "libinput Button Scrolling Button"
|
||||
|
||||
/* Scroll button for button scrolling: 32-bit int, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_DEFAULT "libinput Button Scrolling Button Default"
|
||||
|
||||
/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise */
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK "libinput Button Scrolling Button Lock Enabled"
|
||||
|
||||
/* Scroll button lock: BOOL, 1 value, TRUE for enabled, FALSE otherwise, read-only*/
|
||||
#define LIBINPUT_PROP_SCROLL_BUTTON_LOCK_DEFAULT "libinput Button Scrolling Button Lock Enabled Default"
|
||||
|
||||
/* Scroll pixel distance: CARD32, 1 value (with implementation-defined limits) */
|
||||
#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE "libinput Scrolling Pixel Distance"
|
||||
|
||||
/* Scroll pixel distance: CARD32, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_SCROLL_PIXEL_DISTANCE_DEFAULT "libinput Scrolling Pixel Distance Default"
|
||||
|
||||
/* Scroll factor: FLOAT, 1 value, 32 bit */
|
||||
#define LIBINPUT_PROP_SCROLL_FACTOR "libinput Scrolling Factor"
|
||||
|
||||
/* Scroll factor: FLOAT, 1 value, 32 bit, read-only */
|
||||
#define LIBINPUT_PROP_SCROLL_FACTOR_DEFAULT "libinput Scrolling Factor Default"
|
||||
|
||||
/* Click method: BOOL read-only, 2 values in order buttonareas, clickfinger
|
||||
shows available click methods */
|
||||
#define LIBINPUT_PROP_CLICK_METHODS_AVAILABLE "libinput Click Methods Available"
|
||||
|
||||
/* Click method: BOOL, 2 values in order buttonareas, clickfinger
|
||||
only one enabled at a time at max */
|
||||
#define LIBINPUT_PROP_CLICK_METHOD_ENABLED "libinput Click Method Enabled"
|
||||
|
||||
/* Click method: BOOL, 2 values in order buttonareas, clickfinger
|
||||
only one enabled at a time at max, read-only */
|
||||
#define LIBINPUT_PROP_CLICK_METHOD_ENABLED_DEFAULT "libinput Click Method Enabled Default"
|
||||
|
||||
/* Middle button emulation: BOOL, 1 value */
|
||||
#define LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED "libinput Middle Emulation Enabled"
|
||||
|
||||
/* Middle button emulation: BOOL, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_MIDDLE_EMULATION_ENABLED_DEFAULT "libinput Middle Emulation Enabled Default"
|
||||
|
||||
/* Disable while typing: BOOL, 1 value */
|
||||
#define LIBINPUT_PROP_DISABLE_WHILE_TYPING "libinput Disable While Typing Enabled"
|
||||
|
||||
/* Disable while typing: BOOL, 1 value, read-only */
|
||||
#define LIBINPUT_PROP_DISABLE_WHILE_TYPING_DEFAULT "libinput Disable While Typing Enabled Default"
|
||||
|
||||
/* Drag lock buttons, either:
|
||||
CARD8, one value, the meta lock button, or
|
||||
CARD8, n * 2 values, the drag lock pairs with n being the button and n+1
|
||||
the target button number */
|
||||
#define LIBINPUT_PROP_DRAG_LOCK_BUTTONS "libinput Drag Lock Buttons"
|
||||
|
||||
/* Horizontal scroll events enabled: BOOL, 1 value (0 or 1).
|
||||
* If disabled, horizontal scroll events are discarded */
|
||||
#define LIBINPUT_PROP_HORIZ_SCROLL_ENABLED "libinput Horizontal Scroll Enabled"
|
||||
|
||||
/* Number of modes each pad mode group has available: CARD8, one for each
|
||||
* pad mode group, read-only.
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUPS_AVAILABLE "libinput Pad Mode Groups Modes Available"
|
||||
|
||||
/* Mode each pad mode group is currently in: CARD8, one for each pad mode
|
||||
* group, read-only.
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUPS "libinput Pad Mode Groups Modes"
|
||||
|
||||
/* The association of each logical button with the pad mode group: INT8,
|
||||
* one for each logical button. If set to -1 the button cannot be associated
|
||||
* with a mode group. read-only
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUP_BUTTONS "libinput Pad Mode Group Buttons"
|
||||
|
||||
/* The association of each logical strip with the pad mode group: INT8,
|
||||
* one for each logical strip. If set to -1 the strip cannot be associated
|
||||
* with a mode group. read-only
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUP_STRIPS "libinput Pad Mode Group Strips"
|
||||
|
||||
/* The association of each logical ring with the pad mode group: INT8,
|
||||
* one for each logical ring. If set to -1 the ring cannot be associated
|
||||
* with a mode group. read-only
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_PAD_MODE_GROUP_RINGS "libinput Pad Mode Group Rings"
|
||||
|
||||
/* Device rotation: FLOAT, 1 value, 32 bit */
|
||||
#define LIBINPUT_PROP_ROTATION_ANGLE "libinput Rotation Angle"
|
||||
|
||||
/* Device rotation: FLOAT, 1 value, 32 bit, read-only */
|
||||
#define LIBINPUT_PROP_ROTATION_ANGLE_DEFAULT "libinput Rotation Angle Default"
|
||||
|
||||
/* Tablet tool pressure curve: float, 8 values, 32 bit
|
||||
* Value range is [0.0, 1.0], the values specify the x/y of the four
|
||||
* control points for a cubic bezier curve.
|
||||
* Default value: 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_TOOL_PRESSURECURVE "libinput Tablet Tool Pressurecurve"
|
||||
|
||||
/* Tablet tool pressure range: float, 2 values, 32 bit
|
||||
* Value range is [0.0, 1.0] for min and max physical pressure to map to the logical range
|
||||
* Default value: 0.0 1.0
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_TOOL_PRESSURE_RANGE "libinput Tablet Tool Pressure Range"
|
||||
|
||||
/* Tablet tool pressure range: float, 2 values, 32 bit, read-only */
|
||||
#define LIBINPUT_PROP_TABLET_TOOL_PRESSURE_RANGE_DEFAULT "libinput Tablet Tool Pressure Range Default"
|
||||
|
||||
/* Tablet tool area ratio: CARD32, 2 values, w and h */
|
||||
#define LIBINPUT_PROP_TABLET_TOOL_AREA_RATIO "libinput Tablet Tool Area Ratio"
|
||||
|
||||
/* High-resolution wheel scroll events enabled: BOOL, 1 value (0 or 1).
|
||||
* If disabled, high-resolution wheel scroll events are discarded */
|
||||
#define LIBINPUT_PROP_HIRES_WHEEL_SCROLL_ENABLED "libinput High Resolution Wheel Scroll Enabled"
|
||||
|
||||
/* The tablet tool unique serial number: CARD32, 1 value, constant for the
|
||||
* lifetime of the device.
|
||||
*
|
||||
* If this property exists and is zero, the tool does not have a unique serial
|
||||
* number.
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_TOOL_SERIAL "libinput Tablet Tool Serial"
|
||||
|
||||
/* The tablet tool hardware ID: CARD32, 1 value, constant for the lifetime of the device.
|
||||
*
|
||||
* This property only exists if the device has a known tool ID.
|
||||
* See libinput_tablet_tool_get_tool_id() in the libinput documentation for details.
|
||||
*/
|
||||
#define LIBINPUT_PROP_TABLET_TOOL_ID "libinput Tablet Tool ID"
|
||||
|
||||
#endif /* _LIBINPUT_PROPERTIES_H_ */
|
||||
@@ -0,0 +1,554 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
* Copyright © 2010 Francisco Jerez <currojerez@riseup.net>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _XORG_LIST_H_
|
||||
#define _XORG_LIST_H_
|
||||
|
||||
#include <stddef.h> /* offsetof() */
|
||||
|
||||
/**
|
||||
* @file Classic doubly-link circular list implementation.
|
||||
* For real usage examples of the linked list, see the file test/list.c
|
||||
*
|
||||
* Example:
|
||||
* We need to keep a list of struct foo in the parent struct bar, i.e. what
|
||||
* we want is something like this.
|
||||
*
|
||||
* struct bar {
|
||||
* ...
|
||||
* struct foo *list_of_foos; -----> struct foo {}, struct foo {}, struct foo{}
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* We need one list head in bar and a list element in all list_of_foos (both are of
|
||||
* data type 'struct xorg_list').
|
||||
*
|
||||
* struct bar {
|
||||
* ...
|
||||
* struct xorg_list list_of_foos;
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* struct foo {
|
||||
* ...
|
||||
* struct xorg_list entry;
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* Now we initialize the list head:
|
||||
*
|
||||
* struct bar bar;
|
||||
* ...
|
||||
* xorg_list_init(&bar.list_of_foos);
|
||||
*
|
||||
* Then we create the first element and add it to this list:
|
||||
*
|
||||
* struct foo *foo = malloc(...);
|
||||
* ....
|
||||
* xorg_list_add(&foo->entry, &bar.list_of_foos);
|
||||
*
|
||||
* Repeat the above for each element you want to add to the list. Deleting
|
||||
* works with the element itself.
|
||||
* xorg_list_del(&foo->entry);
|
||||
* free(foo);
|
||||
*
|
||||
* Note: calling xorg_list_del(&bar.list_of_foos) will set bar.list_of_foos to an empty
|
||||
* list again.
|
||||
*
|
||||
* Looping through the list requires a 'struct foo' as iterator and the
|
||||
* name of the field the subnodes use.
|
||||
*
|
||||
* struct foo *iterator;
|
||||
* xorg_list_for_each_entry(iterator, &bar.list_of_foos, entry) {
|
||||
* if (iterator->something == ...)
|
||||
* ...
|
||||
* }
|
||||
*
|
||||
* Note: You must not call xorg_list_del() on the iterator if you continue the
|
||||
* loop. You need to run the safe for-each loop instead:
|
||||
*
|
||||
* struct foo *iterator, *next;
|
||||
* xorg_list_for_each_entry_safe(iterator, next, &bar.list_of_foos, entry) {
|
||||
* if (...)
|
||||
* xorg_list_del(&iterator->entry);
|
||||
* }
|
||||
*
|
||||
* WARNING: entries MUST NOT be added to the list twice, otherwise iterating
|
||||
* will end up in infinite loop.
|
||||
* WARNING: entries MUST NOT be added to multiple lists - use separate entry
|
||||
* nodes within the container struct, if it needs to be added to
|
||||
* several lists at the same time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The linkage struct for list nodes. This struct must be part of your
|
||||
* to-be-linked struct. struct xorg_list is required for both the head of the
|
||||
* list and for each list node.
|
||||
*
|
||||
* Position and name of the struct xorg_list field is irrelevant.
|
||||
* There are no requirements that elements of a list are of the same type.
|
||||
* There are no requirements for a list head, any struct xorg_list can be a list
|
||||
* head.
|
||||
*/
|
||||
struct xorg_list {
|
||||
struct xorg_list *next, *prev;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize the list as an empty list.
|
||||
*
|
||||
* Example:
|
||||
* xorg_list_init(&bar->list_of_foos);
|
||||
*
|
||||
* @param list The list to initialize
|
||||
*/
|
||||
static inline void
|
||||
xorg_list_init(struct xorg_list *list)
|
||||
{
|
||||
list->next = list->prev = list;
|
||||
}
|
||||
|
||||
static inline void
|
||||
__xorg_list_autoinit(struct xorg_list *head)
|
||||
{
|
||||
if ((!head->prev) && (!head->next))
|
||||
xorg_list_init(head);
|
||||
}
|
||||
|
||||
static inline void
|
||||
__xorg_list_add(struct xorg_list *entry,
|
||||
struct xorg_list *prev, struct xorg_list *next)
|
||||
{
|
||||
next->prev = entry;
|
||||
entry->next = next;
|
||||
entry->prev = prev;
|
||||
prev->next = entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a new element after the given list head. The new element does not
|
||||
* need to be initialised as empty list.
|
||||
* The list changes from:
|
||||
* head → some element → ...
|
||||
* to
|
||||
* head → new element → older element → ...
|
||||
*
|
||||
* Example:
|
||||
* struct foo *newfoo = malloc(...);
|
||||
* xorg_list_add(&newfoo->entry, &bar->list_of_foos);
|
||||
*
|
||||
* @param entry The new element to prepend to the list.
|
||||
* @param head The existing list.
|
||||
*/
|
||||
static inline void
|
||||
xorg_list_add(struct xorg_list *entry, struct xorg_list *head)
|
||||
{
|
||||
__xorg_list_autoinit(head);
|
||||
__xorg_list_add(entry, head, head->next);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a new element to the end of the list given with this list head.
|
||||
*
|
||||
* The list changes from:
|
||||
* head → some element → ... → lastelement
|
||||
* to
|
||||
* head → some element → ... → lastelement → new element
|
||||
*
|
||||
* Example:
|
||||
* struct foo *newfoo = malloc(...);
|
||||
* xorg_list_append(&newfoo->entry, &bar->list_of_foos);
|
||||
*
|
||||
* @param entry The new element to append to the list.
|
||||
* @param head The existing list.
|
||||
*/
|
||||
static inline void
|
||||
xorg_list_append(struct xorg_list *entry, struct xorg_list *head)
|
||||
{
|
||||
__xorg_list_autoinit(head);
|
||||
__xorg_list_add(entry, head->prev, head);
|
||||
}
|
||||
|
||||
static inline void
|
||||
__xorg_list_del(struct xorg_list *prev, struct xorg_list *next)
|
||||
{
|
||||
next->prev = prev;
|
||||
prev->next = next;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the element from the list it is in. Using this function will reset
|
||||
* the pointers to/from this element so it is removed from the list. It does
|
||||
* NOT free the element itself or manipulate it otherwise.
|
||||
*
|
||||
* Using xorg_list_del on a pure list head (like in the example at the top of
|
||||
* this file) will NOT remove the first element from
|
||||
* the list but rather reset the list as empty list.
|
||||
*
|
||||
* Example:
|
||||
* xorg_list_del(&foo->entry);
|
||||
*
|
||||
* @param entry The element to remove.
|
||||
*/
|
||||
static inline void
|
||||
xorg_list_del(struct xorg_list *entry)
|
||||
{
|
||||
__xorg_list_autoinit(entry);
|
||||
__xorg_list_del(entry->prev, entry->next);
|
||||
xorg_list_init(entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the list is empty.
|
||||
*
|
||||
* Example:
|
||||
* xorg_list_is_empty(&bar->list_of_foos);
|
||||
*
|
||||
* @return True if the list is empty or False if the list contains one or more
|
||||
* elements.
|
||||
*/
|
||||
static inline int
|
||||
xorg_list_is_empty(struct xorg_list *head)
|
||||
{
|
||||
return ((head->next == NULL) || (head->next == head));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check whether element already is in list
|
||||
*
|
||||
* @param entry The element to check for
|
||||
* @param head The existing list.
|
||||
* @return zero when entry isn't present in list, otherwise non-zero
|
||||
*/
|
||||
static inline int
|
||||
xorg_list_present(struct xorg_list *entry, struct xorg_list *head)
|
||||
{
|
||||
for (struct xorg_list *l=head->next; l && (l != head); l=l->next) {
|
||||
if (l == entry)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief prepend a new element to the end of the list if not existing yet
|
||||
*
|
||||
* Same as xorg_list_add(), but protecting against duplicate insertion.
|
||||
*
|
||||
* @param entry The new element to append to the list.
|
||||
* @param head The existing list.
|
||||
* @return zero if element already in list, otherwise non-zero
|
||||
*/
|
||||
static inline int
|
||||
xorg_list_add_ndup(struct xorg_list *entry, struct xorg_list *head)
|
||||
{
|
||||
if (xorg_list_present(entry, head))
|
||||
return 0;
|
||||
|
||||
xorg_list_add(entry, head);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief append a new element to the end of the list if not existing yet
|
||||
*
|
||||
* Same as xorg_list_append(), but protecting against duplicate insertion.
|
||||
*
|
||||
* @param entry The new element to append to the list.
|
||||
* @param head The existing list.
|
||||
* @return zero if element already in list, otherwise non-zero
|
||||
*/
|
||||
static inline int
|
||||
xorg_list_append_ndup(struct xorg_list *entry, struct xorg_list *head)
|
||||
{
|
||||
if (xorg_list_present(entry, head))
|
||||
return 0;
|
||||
|
||||
xorg_list_append(entry, head);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a pointer to the container of this list element.
|
||||
*
|
||||
* Example:
|
||||
* struct foo* f;
|
||||
* f = container_of(&foo->entry, struct foo, entry);
|
||||
* assert(f == foo);
|
||||
*
|
||||
* @param ptr Pointer to the struct xorg_list.
|
||||
* @param type Data type of the list element.
|
||||
* @param member Member name of the struct xorg_list field in the list element.
|
||||
* @return A pointer to the data struct containing the list head.
|
||||
*/
|
||||
#ifndef container_of
|
||||
#define container_of(ptr, type, member) \
|
||||
(type *)((char *)(ptr) - offsetof(type, member))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Alias of container_of
|
||||
*/
|
||||
#define xorg_list_entry(ptr, type, member) \
|
||||
container_of((ptr), type, member)
|
||||
|
||||
/**
|
||||
* Retrieve the first list entry for the given list pointer.
|
||||
*
|
||||
* Example:
|
||||
* struct foo *first;
|
||||
* first = xorg_list_first_entry(&bar->list_of_foos, struct foo, list_of_foos);
|
||||
*
|
||||
* @param ptr The list head
|
||||
* @param type Data type of the list element to retrieve
|
||||
* @param member Member name of the struct xorg_list field in the list element.
|
||||
* @return A pointer to the first list element.
|
||||
*/
|
||||
#define xorg_list_first_entry(ptr, type, member) \
|
||||
xorg_list_entry((ptr)->next, type, member)
|
||||
|
||||
/**
|
||||
* Retrieve the last list entry for the given listpointer.
|
||||
*
|
||||
* Example:
|
||||
* struct foo *first;
|
||||
* first = xorg_list_last_entry(&bar->list_of_foos, struct foo, list_of_foos);
|
||||
*
|
||||
* @param ptr The list head
|
||||
* @param type Data type of the list element to retrieve
|
||||
* @param member Member name of the struct xorg_list field in the list element.
|
||||
* @return A pointer to the last list element.
|
||||
*/
|
||||
#define xorg_list_last_entry(ptr, type, member) \
|
||||
xorg_list_entry((ptr)->prev, type, member)
|
||||
|
||||
#define __container_of(ptr, sample, member) \
|
||||
container_of((ptr), typeof(*(sample)), member)
|
||||
|
||||
/**
|
||||
* Loop through the list given by head and set pos to struct in the list.
|
||||
*
|
||||
* Example:
|
||||
* struct foo *iterator;
|
||||
* xorg_list_for_each_entry(iterator, &bar->list_of_foos, entry) {
|
||||
* [modify iterator]
|
||||
* }
|
||||
*
|
||||
* This macro is not safe for node deletion. Use xorg_list_for_each_entry_safe
|
||||
* instead.
|
||||
*
|
||||
* @param pos Iterator variable of the type of the list elements.
|
||||
* @param head List head
|
||||
* @param member Member name of the struct xorg_list in the list elements.
|
||||
*
|
||||
*/
|
||||
#define xorg_list_for_each_entry(pos, head, member) \
|
||||
for ((pos) = NULL, \
|
||||
(pos) = __container_of((head)->next, (pos), member); \
|
||||
(((head)->next != NULL) && &(pos)->member != (head)); \
|
||||
(pos) = __container_of((pos)->member.next, (pos), member))
|
||||
|
||||
/**
|
||||
* Loop through the list, keeping a backup pointer to the element. This
|
||||
* macro allows for the deletion of a list element while looping through the
|
||||
* list.
|
||||
*
|
||||
* See xorg_list_for_each_entry for more details.
|
||||
*/
|
||||
#define xorg_list_for_each_entry_safe(pos, tmp, head, member) \
|
||||
for ((pos) = NULL, \
|
||||
(pos) = __container_of((head)->next, (pos), member), \
|
||||
(tmp) = __container_of((head)->next ? (pos)->member.next : NULL, (pos), member); \
|
||||
(((head)->next != NULL) && (&(pos)->member != (head))); \
|
||||
(pos) = (tmp), (tmp) = __container_of((pos)->member.next, (tmp), member))
|
||||
|
||||
/* NULL-Terminated List Interface
|
||||
*
|
||||
* The interface below does _not_ use the struct xorg_list as described above.
|
||||
* It is mainly for legacy structures that cannot easily be switched to
|
||||
* struct xorg_list.
|
||||
*
|
||||
* This interface is for structs like
|
||||
* struct foo {
|
||||
* [...]
|
||||
* struct foo *next;
|
||||
* [...]
|
||||
* };
|
||||
*
|
||||
* The position and field name of "next" are arbitrary.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Init the element as null-terminated list.
|
||||
*
|
||||
* Example:
|
||||
* struct foo *list = malloc();
|
||||
* nt_list_init(list, next);
|
||||
*
|
||||
* @param list The list element that will be the start of the list
|
||||
* @param member Member name of the field pointing to next struct
|
||||
*/
|
||||
#define nt_list_init(_list, _member) \
|
||||
(_list)->_member = NULL
|
||||
|
||||
/**
|
||||
* Returns the next element in the list or NULL on termination.
|
||||
*
|
||||
* Example:
|
||||
* struct foo *element = list;
|
||||
* while ((element = nt_list_next(element, next)) { }
|
||||
*
|
||||
* This macro is not safe for node deletion. Use nt_list_for_each_entry_safe
|
||||
* instead.
|
||||
*
|
||||
* @param list The list or current element.
|
||||
* @param member Member name of the field pointing to next struct.
|
||||
*/
|
||||
#define nt_list_next(_list, _member) \
|
||||
(_list)->_member
|
||||
|
||||
/**
|
||||
* Iterate through each element in the list.
|
||||
*
|
||||
* Example:
|
||||
* struct foo *iterator;
|
||||
* nt_list_for_each_entry(iterator, list, next) {
|
||||
* [modify iterator]
|
||||
* }
|
||||
*
|
||||
* @param entry Assigned to the current list element
|
||||
* @param list The list to iterate through.
|
||||
* @param member Member name of the field pointing to next struct.
|
||||
*/
|
||||
#define nt_list_for_each_entry(_entry, _list, _member) \
|
||||
for ((_entry) = (_list); (_entry); (_entry) = (_entry)->_member)
|
||||
|
||||
/**
|
||||
* Iterate through each element in the list, keeping a backup pointer to the
|
||||
* element. This macro allows for the deletion of a list element while
|
||||
* looping through the list.
|
||||
*
|
||||
* See nt_list_for_each_entry for more details.
|
||||
*
|
||||
* @param entry Assigned to the current list element
|
||||
* @param tmp The pointer to the next element
|
||||
* @param list The list to iterate through.
|
||||
* @param member Member name of the field pointing to next struct.
|
||||
*/
|
||||
#define nt_list_for_each_entry_safe(_entry, _tmp, _list, _member) \
|
||||
for ((_entry) = (_list), (_tmp) = (_entry) ? (_entry)->_member : NULL;\
|
||||
(_entry); \
|
||||
(_entry) = (_tmp), (_tmp) = (_tmp) ? (_tmp)->_member: NULL)
|
||||
|
||||
/**
|
||||
* Append the element to the end of the list. This macro may be used to
|
||||
* merge two lists.
|
||||
*
|
||||
* Example:
|
||||
* struct foo *elem = malloc(...);
|
||||
* nt_list_init(elem, next)
|
||||
* nt_list_append(elem, list, struct foo, next);
|
||||
*
|
||||
* Resulting list order:
|
||||
* list_item_0 -> list_item_1 -> ... -> elem_item_0 -> elem_item_1 ...
|
||||
*
|
||||
* @param entry An entry (or list) to append to the list
|
||||
* @param list The list to append to. This list must be a valid list, not
|
||||
* NULL.
|
||||
* @param type The list type
|
||||
* @param member Member name of the field pointing to next struct
|
||||
*/
|
||||
#define nt_list_append(_entry, _list, _type, _member) \
|
||||
do { \
|
||||
_type *__iterator = (_list); \
|
||||
while (__iterator->_member) { __iterator = __iterator->_member;}\
|
||||
__iterator->_member = (_entry); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Insert the element at the next position in the list. This macro may be
|
||||
* used to insert a list into a list.
|
||||
*
|
||||
* struct foo *elem = malloc(...);
|
||||
* nt_list_init(elem, next)
|
||||
* nt_list_insert(elem, list, struct foo, next);
|
||||
*
|
||||
* Resulting list order:
|
||||
* list_item_0 -> elem_item_0 -> elem_item_1 ... -> list_item_1 -> ...
|
||||
*
|
||||
* @param entry An entry (or list) to append to the list
|
||||
* @param list The list to insert to. This list must be a valid list, not
|
||||
* NULL.
|
||||
* @param type The list type
|
||||
* @param member Member name of the field pointing to next struct
|
||||
*/
|
||||
#define nt_list_insert(_entry, _list, _type, _member) \
|
||||
do { \
|
||||
nt_list_append((_list)->_member, (_entry), _type, _member); \
|
||||
(_list)->_member = (_entry); \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* Delete the entry from the list by iterating through the list and
|
||||
* removing any reference from the list to the entry.
|
||||
*
|
||||
* Example:
|
||||
* struct foo *elem = <assign to right element>
|
||||
* nt_list_del(elem, list, struct foo, next);
|
||||
*
|
||||
* @param entry The entry to delete from the list. entry is always
|
||||
* re-initialized as a null-terminated list.
|
||||
* @param list The list containing the entry, set to the new list without
|
||||
* the removed entry.
|
||||
* @param type The list type
|
||||
* @param member Member name of the field pointing to the next entry
|
||||
*/
|
||||
#define nt_list_del(_entry, _list, _type, _member) \
|
||||
do { \
|
||||
_type *__e = (_entry); \
|
||||
if (__e == NULL || (_list) == NULL) break; \
|
||||
if ((_list) == __e) { \
|
||||
(_list) = __e->_member; \
|
||||
} else { \
|
||||
_type *__prev = (_list); \
|
||||
while (__prev->_member && __prev->_member != __e) \
|
||||
__prev = nt_list_next(__prev, _member); \
|
||||
if (__prev->_member) \
|
||||
__prev->_member = __e->_member; \
|
||||
} \
|
||||
nt_list_init(__e, _member); \
|
||||
} while(0)
|
||||
|
||||
/**
|
||||
* DO NOT USE THIS.
|
||||
* This is a remainder of the xfree86 DDX attempt of having a set of generic
|
||||
* list functions. Unfortunately, the xf86OptionRec uses it and we can't
|
||||
* easily get rid of it. Do not use for new code.
|
||||
*/
|
||||
typedef struct generic_list_rec {
|
||||
void *next;
|
||||
} GenericListRec, *GenericListPtr, *glp;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,300 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 MI_H
|
||||
#define MI_H
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/fonts/font.h>
|
||||
|
||||
#include "regionstr.h"
|
||||
#include "validate.h"
|
||||
#include "window.h"
|
||||
#include "gc.h"
|
||||
#include "input.h"
|
||||
#include "cursor.h"
|
||||
#include "privates.h"
|
||||
#include "colormap.h"
|
||||
#include "events.h"
|
||||
|
||||
#define MiBits CARD32
|
||||
|
||||
typedef struct _miDash *miDashPtr;
|
||||
|
||||
#define EVEN_DASH 0
|
||||
#define ODD_DASH ~0
|
||||
|
||||
/* miarc.c */
|
||||
|
||||
extern _X_EXPORT void miPolyArc(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*narcs */ ,
|
||||
xArc * /*parcs */
|
||||
);
|
||||
|
||||
/* micopy.c */
|
||||
|
||||
#define miGetCompositeClip(pGC) ((pGC)->pCompositeClip)
|
||||
|
||||
typedef void (*miCopyProc) (DrawablePtr pSrcDrawable,
|
||||
DrawablePtr pDstDrawable,
|
||||
GCPtr pGC,
|
||||
BoxPtr pDstBox,
|
||||
int nbox,
|
||||
int dx,
|
||||
int dy,
|
||||
Bool reverse,
|
||||
Bool upsidedown, Pixel bitplane, void *closure);
|
||||
|
||||
extern _X_EXPORT void
|
||||
|
||||
miCopyRegion(DrawablePtr pSrcDrawable,
|
||||
DrawablePtr pDstDrawable,
|
||||
GCPtr pGC,
|
||||
RegionPtr pDstRegion,
|
||||
int dx,
|
||||
int dy, miCopyProc copyProc, Pixel bitPlane, void *closure);
|
||||
|
||||
extern _X_EXPORT RegionPtr
|
||||
|
||||
miDoCopy(DrawablePtr pSrcDrawable,
|
||||
DrawablePtr pDstDrawable,
|
||||
GCPtr pGC,
|
||||
int xIn,
|
||||
int yIn,
|
||||
int widthSrc,
|
||||
int heightSrc,
|
||||
int xOut,
|
||||
int yOut, miCopyProc copyProc, Pixel bitplane, void *closure);
|
||||
|
||||
/* mieq.c */
|
||||
|
||||
#ifndef INPUT_H
|
||||
typedef struct _DeviceRec *DevicePtr;
|
||||
#endif
|
||||
|
||||
/* miexpose.c */
|
||||
|
||||
extern _X_EXPORT RegionPtr miHandleExposures(DrawablePtr /*pSrcDrawable */ ,
|
||||
DrawablePtr /*pDstDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*srcx */ ,
|
||||
int /*srcy */ ,
|
||||
int /*width */ ,
|
||||
int /*height */ ,
|
||||
int /*dstx */ ,
|
||||
int /*dsty */
|
||||
);
|
||||
|
||||
extern _X_EXPORT void miClearDrawable(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */
|
||||
);
|
||||
|
||||
/* miglblt.c */
|
||||
|
||||
extern _X_EXPORT void miPolyGlyphBlt(DrawablePtr pDrawable,
|
||||
GCPtr pGC,
|
||||
int x,
|
||||
int y,
|
||||
unsigned int nglyph,
|
||||
CharInfoPtr *ppci,
|
||||
void *pglyphBase
|
||||
);
|
||||
|
||||
extern _X_EXPORT void miImageGlyphBlt(DrawablePtr pDrawable,
|
||||
GCPtr pGC,
|
||||
int x,
|
||||
int y,
|
||||
unsigned int nglyph,
|
||||
CharInfoPtr *ppci,
|
||||
void *pglyphBase
|
||||
);
|
||||
|
||||
/* mipoly.c */
|
||||
|
||||
extern _X_EXPORT void miFillPolygon(DrawablePtr /*dst */ ,
|
||||
GCPtr /*pgc */ ,
|
||||
int /*shape */ ,
|
||||
int /*mode */ ,
|
||||
int /*count */ ,
|
||||
DDXPointPtr /*pPts */
|
||||
);
|
||||
|
||||
/* mipolypnt.c */
|
||||
|
||||
extern _X_EXPORT void miPolyPoint(DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*mode */ ,
|
||||
int /*npt */ ,
|
||||
xPoint * /*pptInit */
|
||||
);
|
||||
|
||||
/* mipolyrect.c */
|
||||
|
||||
extern _X_EXPORT void miPolyRectangle(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*nrects */ ,
|
||||
xRectangle * /*pRects */
|
||||
);
|
||||
|
||||
/* mipolyseg.c */
|
||||
|
||||
extern _X_EXPORT void miPolySegment(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*nseg */ ,
|
||||
xSegment * /*pSegs */
|
||||
);
|
||||
|
||||
/* mipolytext.c */
|
||||
|
||||
extern _X_EXPORT int miPolyText8(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*count */ ,
|
||||
char * /*chars */
|
||||
);
|
||||
|
||||
extern _X_EXPORT int miPolyText16(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*count */ ,
|
||||
unsigned short * /*chars */
|
||||
);
|
||||
|
||||
extern _X_EXPORT void miImageText8(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*count */ ,
|
||||
char * /*chars */
|
||||
);
|
||||
|
||||
extern _X_EXPORT void miImageText16(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*x */ ,
|
||||
int /*y */ ,
|
||||
int /*count */ ,
|
||||
unsigned short * /*chars */
|
||||
);
|
||||
|
||||
/* mipushpxl.c */
|
||||
|
||||
extern _X_EXPORT void miPushPixels(GCPtr /*pGC */ ,
|
||||
PixmapPtr /*pBitMap */ ,
|
||||
DrawablePtr /*pDrawable */ ,
|
||||
int /*dx */ ,
|
||||
int /*dy */ ,
|
||||
int /*xOrg */ ,
|
||||
int /*yOrg */
|
||||
);
|
||||
|
||||
/* miscrinit.c */
|
||||
extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr pPixmap,
|
||||
int width,
|
||||
int height,
|
||||
int depth,
|
||||
int bitsPerPixel,
|
||||
int devKind,
|
||||
void *pPixData
|
||||
);
|
||||
|
||||
extern _X_EXPORT Bool miScreenInit(ScreenPtr pScreen,
|
||||
void *pbits,
|
||||
int xsize,
|
||||
int ysize,
|
||||
int dpix,
|
||||
int dpiy,
|
||||
int width,
|
||||
int rootDepth,
|
||||
int numDepths,
|
||||
DepthPtr depths,
|
||||
VisualID rootVisual,
|
||||
int numVisuals,
|
||||
VisualPtr visuals
|
||||
);
|
||||
|
||||
/* mivaltree.c */
|
||||
|
||||
extern _X_EXPORT void miWideLine(DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*mode */ ,
|
||||
int /*npt */ ,
|
||||
DDXPointPtr /*pPts */
|
||||
);
|
||||
|
||||
extern _X_EXPORT void miWideDash(DrawablePtr /*pDrawable */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*mode */ ,
|
||||
int /*npt */ ,
|
||||
DDXPointPtr /*pPts */
|
||||
);
|
||||
|
||||
extern _X_EXPORT void miPolylines(DrawablePtr pDrawable,
|
||||
GCPtr pGC,
|
||||
int mode,
|
||||
int npt,
|
||||
DDXPointPtr pPts);
|
||||
|
||||
/* mizerarc.c */
|
||||
|
||||
extern _X_EXPORT void miZeroPolyArc(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*narcs */ ,
|
||||
xArc * /*parcs */
|
||||
);
|
||||
|
||||
_X_EXPORT void miZeroLine(DrawablePtr dst, GCPtr gc, int mode, int nptInit, xPoint* pptInit);
|
||||
_X_EXPORT void miZeroDashLine(DrawablePtr dst, GCPtr pgc, int mode, int nptInit, xPoint *pptInit);
|
||||
|
||||
extern _X_EXPORT void miPolyFillArc(DrawablePtr /*pDraw */ ,
|
||||
GCPtr /*pGC */ ,
|
||||
int /*narcs */ ,
|
||||
xArc * /*parcs */
|
||||
);
|
||||
|
||||
#endif /* MI_H */
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef _MICMAP_H_
|
||||
#define _MICMAP_H_
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xdefs.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
#include "colormap.h"
|
||||
#include "privates.h"
|
||||
#include "screenint.h"
|
||||
|
||||
extern _X_EXPORT DevPrivateKeyRec micmapScrPrivateKeyRec;
|
||||
|
||||
#define micmapScrPrivateKey (&micmapScrPrivateKeyRec)
|
||||
|
||||
extern _X_EXPORT int miListInstalledColormaps(ScreenPtr pScreen,
|
||||
Colormap * pmaps);
|
||||
extern _X_EXPORT void miInstallColormap(ColormapPtr pmap);
|
||||
extern _X_EXPORT void miUninstallColormap(ColormapPtr pmap);
|
||||
|
||||
extern _X_EXPORT void miResolveColor(unsigned short *, unsigned short *,
|
||||
unsigned short *, VisualPtr);
|
||||
extern _X_EXPORT Bool miInitializeColormap(ColormapPtr);
|
||||
extern _X_EXPORT Bool miCreateDefColormap(ScreenPtr);
|
||||
extern _X_EXPORT void miClearVisualTypes(void);
|
||||
extern _X_EXPORT Bool miSetVisualTypes(int, int, int, int);
|
||||
extern _X_EXPORT Bool miSetPixmapDepths(void);
|
||||
extern _X_EXPORT Bool miSetVisualTypesAndMasks(int depth, int visuals,
|
||||
int bitsPerRGB, int preferredCVC,
|
||||
Pixel redMask, Pixel greenMask,
|
||||
Pixel blueMask);
|
||||
extern _X_EXPORT int miGetDefaultVisualMask(int);
|
||||
extern _X_EXPORT Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *,
|
||||
int *, VisualID *, unsigned long, int, int);
|
||||
|
||||
#define MAX_PSEUDO_DEPTH 10
|
||||
|
||||
#define StaticColorMask (1 << StaticColor)
|
||||
#define PseudoColorMask (1 << PseudoColor)
|
||||
#define TrueColorMask (1 << TrueColor)
|
||||
#define DirectColorMask (1 << DirectColor)
|
||||
|
||||
#endif /* _MICMAP_H_ */
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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
|
||||
* XFREE86 PROJECT 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 XFree86 Project 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
|
||||
* XFree86 Project.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MICOORD_H_
|
||||
#define _MICOORD_H_ 1
|
||||
|
||||
#include "servermd.h"
|
||||
|
||||
/* Macros which handle a coordinate in a single register */
|
||||
|
||||
#define GetHighWord(x) (((int) (x)) >> 16)
|
||||
|
||||
#if IMAGE_BYTE_ORDER == MSBFirst
|
||||
#define coordToInt(x,y) (((x) << 16) | ((y) & 0xffff))
|
||||
#define intToX(i) (GetHighWord((i)))
|
||||
#define intToY(i) ((int) ((short) (i)))
|
||||
#else
|
||||
#define coordToInt(x,y) (((y) << 16) | ((x) & 0xffff))
|
||||
#define intToX(i) ((int) ((short) (i)))
|
||||
#define intToY(i) (GetHighWord((i)))
|
||||
#endif
|
||||
|
||||
#endif /* _MICOORD_H_ */
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _MIGC_H
|
||||
#define _MIGC_H
|
||||
|
||||
extern _X_EXPORT void miChangeGC(GCPtr pGC,
|
||||
unsigned long mask);
|
||||
|
||||
extern _X_EXPORT void miDestroyGC(GCPtr pGC);
|
||||
|
||||
extern _X_EXPORT void miDestroyClip(GCPtr pGC);
|
||||
|
||||
extern _X_EXPORT void miChangeClip(GCPtr pGC,
|
||||
int type,
|
||||
void *pvalue,
|
||||
int nrects);
|
||||
|
||||
extern _X_EXPORT void miCopyClip(GCPtr pgcDst,
|
||||
GCPtr pgcSrc);
|
||||
|
||||
extern _X_EXPORT void miCopyGC(GCPtr pGCSrc,
|
||||
unsigned long changes,
|
||||
GCPtr pGCDst);
|
||||
|
||||
extern _X_EXPORT void miComputeCompositeClip(GCPtr pGC,
|
||||
DrawablePtr pDrawable);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef MILINE_H
|
||||
#define MILINE_H
|
||||
|
||||
#include "screenint.h"
|
||||
#include "privates.h"
|
||||
|
||||
/*
|
||||
* Public definitions used for configuring basic pixelization aspects
|
||||
* of the sample implementation line-drawing routines provided in
|
||||
* {mfb,mi,cfb*} at run-time.
|
||||
*/
|
||||
|
||||
#define XDECREASING 4
|
||||
#define YDECREASING 2
|
||||
#define YMAJOR 1
|
||||
|
||||
#define OCTANT1 (1 << (YDECREASING))
|
||||
#define OCTANT2 (1 << (YDECREASING|YMAJOR))
|
||||
#define OCTANT3 (1 << (XDECREASING|YDECREASING|YMAJOR))
|
||||
#define OCTANT4 (1 << (XDECREASING|YDECREASING))
|
||||
#define OCTANT5 (1 << (XDECREASING))
|
||||
#define OCTANT6 (1 << (XDECREASING|YMAJOR))
|
||||
#define OCTANT7 (1 << (YMAJOR))
|
||||
#define OCTANT8 (1 << (0))
|
||||
|
||||
/*
|
||||
* Devices can configure the rendering of routines in mi, mfb, and cfb*
|
||||
* by specifying a thin line bias to be applied to a particular screen
|
||||
* using the following function. The bias parameter is an OR'ing of
|
||||
* the appropriate OCTANT constants defined above to indicate which
|
||||
* octants to bias a line to prefer an axial step when the Bresenham
|
||||
* error term is exactly zero. The octants are mapped as follows:
|
||||
*
|
||||
* \ | /
|
||||
* \ 3 | 2 /
|
||||
* \ | /
|
||||
* 4 \ | / 1
|
||||
* \|/
|
||||
* -----------
|
||||
* /|\
|
||||
* 5 / | \ 8
|
||||
* / | \
|
||||
* / 6 | 7 \
|
||||
* / | \
|
||||
*
|
||||
* For more information, see "Ambiguities in Incremental Line Rastering,"
|
||||
* Jack E. Bresenham, IEEE CG&A, May 1987.
|
||||
*/
|
||||
|
||||
extern _X_EXPORT void miSetZeroLineBias(ScreenPtr /* pScreen */ ,
|
||||
unsigned int /* bias */
|
||||
);
|
||||
|
||||
/*
|
||||
* Private definitions needed for drawing thin (zero width) lines
|
||||
* Used by the mi, mfb, and all cfb* components.
|
||||
*/
|
||||
|
||||
#define X_AXIS 0
|
||||
#define Y_AXIS 1
|
||||
|
||||
#define OUT_LEFT 0x08
|
||||
#define OUT_RIGHT 0x04
|
||||
#define OUT_ABOVE 0x02
|
||||
#define OUT_BELOW 0x01
|
||||
|
||||
#define OUTCODES(_result, _x, _y, _pbox) \
|
||||
if ( (_x) < (_pbox)->x1) (_result) |= OUT_LEFT; \
|
||||
else if ( (_x) >= (_pbox)->x2) (_result) |= OUT_RIGHT; \
|
||||
if ( (_y) < (_pbox)->y1) (_result) |= OUT_ABOVE; \
|
||||
else if ( (_y) >= (_pbox)->y2) (_result) |= OUT_BELOW;
|
||||
|
||||
#define MIOUTCODES(outcode, x, y, xmin, ymin, xmax, ymax) \
|
||||
{\
|
||||
if ((x) < (xmin)) (outcode) |= OUT_LEFT;\
|
||||
if ((x) > (xmax)) (outcode) |= OUT_RIGHT;\
|
||||
if ((y) < (ymin)) (outcode) |= OUT_ABOVE;\
|
||||
if ((y) > (ymax)) (outcode) |= OUT_BELOW;\
|
||||
}
|
||||
|
||||
#define miGetZeroLineBias(_pScreen) ((unsigned long) (unsigned long*)\
|
||||
dixLookupPrivate(&(_pScreen)->devPrivates, miZeroLineScreenKey))
|
||||
|
||||
#define CalcLineDeltas(_x1,_y1,_x2,_y2,_adx,_ady,_sx,_sy,_SX,_SY,_octant) \
|
||||
(_octant) = 0; \
|
||||
(_sx) = (_SX); \
|
||||
if (((_adx) = (_x2) - (_x1)) < 0) { \
|
||||
(_adx) = -(_adx); \
|
||||
((_sx) = -(_sx)); \
|
||||
(_octant) |= XDECREASING; \
|
||||
} \
|
||||
(_sy) = (_SY); \
|
||||
if (((_ady) = (_y2) - (_y1)) < 0) { \
|
||||
(_ady) = -(_ady); \
|
||||
((_sy) = -(_sy)); \
|
||||
(_octant) |= YDECREASING; \
|
||||
}
|
||||
|
||||
#define SetYMajorOctant(_octant) ((_octant) |= YMAJOR)
|
||||
|
||||
#define FIXUP_ERROR(_e, _octant, _bias) \
|
||||
(_e) -= (((_bias) >> (_octant)) & 1)
|
||||
|
||||
extern _X_EXPORT DevPrivateKeyRec miZeroLineScreenKeyRec;
|
||||
|
||||
#define miZeroLineScreenKey (&miZeroLineScreenKeyRec)
|
||||
|
||||
extern _X_EXPORT int miZeroClipLine(int /*xmin */ ,
|
||||
int /*ymin */ ,
|
||||
int /*xmax */ ,
|
||||
int /*ymax */ ,
|
||||
int * /*new_x1 */ ,
|
||||
int * /*new_y1 */ ,
|
||||
int * /*new_x2 */ ,
|
||||
int * /*new_y2 */ ,
|
||||
unsigned int /*adx */ ,
|
||||
unsigned int /*ady */ ,
|
||||
int * /*pt1_clipped */ ,
|
||||
int * /*pt2_clipped */ ,
|
||||
int /*octant */ ,
|
||||
unsigned int /*bias */ ,
|
||||
int /*oc1 */ ,
|
||||
int /*oc2 */
|
||||
);
|
||||
|
||||
#endif /* MILINE_H */
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
*
|
||||
* Copyright © 2000 SuSE, Inc.
|
||||
*
|
||||
* 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 SuSE not be used in advertising or
|
||||
* publicity pertaining to distribution of the software without specific,
|
||||
* written prior permission. SuSE makes no representations about the
|
||||
* suitability of this software for any purpose. It is provided "as is"
|
||||
* without express or implied warranty.
|
||||
*
|
||||
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
||||
* 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.
|
||||
*
|
||||
* Author: Keith Packard, SuSE, Inc.
|
||||
*/
|
||||
|
||||
#ifndef _MIPICT_H_
|
||||
#define _MIPICT_H_
|
||||
|
||||
#include "picturestr.h"
|
||||
|
||||
#define MI_MAX_INDEXED 256 /* XXX depth must be <= 8 */
|
||||
|
||||
#if MI_MAX_INDEXED <= 256
|
||||
typedef CARD8 miIndexType;
|
||||
#endif
|
||||
|
||||
typedef struct _miIndexed {
|
||||
Bool color;
|
||||
CARD32 rgba[MI_MAX_INDEXED];
|
||||
miIndexType ent[32768];
|
||||
} miIndexedRec, *miIndexedPtr;
|
||||
|
||||
#define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
|
||||
(((s) >> 6) & 0x03e0) | \
|
||||
(((s) >> 9) & 0x7c00))
|
||||
#define miIndexToEnt15(mif,rgb15) ((mif)->ent[(rgb15)])
|
||||
#define miIndexToEnt24(mif,rgb24) miIndexToEnt15((mif),miCvtR8G8B8to15((rgb24)))
|
||||
|
||||
#define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15((rgb24))])
|
||||
|
||||
extern _X_EXPORT int
|
||||
miCreatePicture(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miDestroyPicture(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miCompositeSourceValidate(PicturePtr pPicture);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
|
||||
miComputeCompositeRegion(RegionPtr pRegion,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pMask,
|
||||
PicturePtr pDst,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc,
|
||||
INT16 xMask,
|
||||
INT16 yMask,
|
||||
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miRealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miUnrealizeGlyph(ScreenPtr pScreen, GlyphPtr glyph);
|
||||
|
||||
extern _X_EXPORT void
|
||||
|
||||
miGlyphs(CARD8 op,
|
||||
PicturePtr pSrc,
|
||||
PicturePtr pDst,
|
||||
PictFormatPtr maskFormat,
|
||||
INT16 xSrc,
|
||||
INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miRenderColorToPixel(PictFormatPtr pPict, xRenderColor * color, CARD32 *pixel);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miRenderPixelToColor(PictFormatPtr pPict, CARD32 pixel, xRenderColor * color);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miIsSolidAlpha(PicturePtr pSrc);
|
||||
|
||||
extern _X_EXPORT void
|
||||
|
||||
miCompositeRects(CARD8 op,
|
||||
PicturePtr pDst,
|
||||
xRenderColor * color, int nRect, xRectangle *rects);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miTrapezoidBounds(int ntrap, xTrapezoid * traps, BoxPtr box);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miPointFixedBounds(int npoint, xPointFixed * points, BoxPtr bounds);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miTriangleBounds(int ntri, xTriangle * tris, BoxPtr bounds);
|
||||
|
||||
extern _X_EXPORT Bool
|
||||
miInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
|
||||
|
||||
extern _X_EXPORT void
|
||||
|
||||
miUpdateIndexed(ScreenPtr pScreen,
|
||||
PictFormatPtr pFormat, int ndef, xColorItem * pdef);
|
||||
|
||||
#endif /* _MIPICT_H_ */
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
|
||||
Copyright 1989, 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.
|
||||
*/
|
||||
|
||||
#ifndef MIPOINTER_H
|
||||
#define MIPOINTER_H
|
||||
|
||||
#include "cursor.h"
|
||||
#include "input.h"
|
||||
#include "privates.h"
|
||||
|
||||
typedef struct _miPointerSpriteFuncRec {
|
||||
Bool (*RealizeCursor) (DeviceIntPtr /* pDev */ ,
|
||||
ScreenPtr /* pScr */ ,
|
||||
CursorPtr /* pCurs */
|
||||
);
|
||||
Bool (*UnrealizeCursor) (DeviceIntPtr /* pDev */ ,
|
||||
ScreenPtr /* pScr */ ,
|
||||
CursorPtr /* pCurs */
|
||||
);
|
||||
void (*SetCursor) (DeviceIntPtr /* pDev */ ,
|
||||
ScreenPtr /* pScr */ ,
|
||||
CursorPtr /* pCurs */ ,
|
||||
int /* x */ ,
|
||||
int /* y */
|
||||
);
|
||||
void (*MoveCursor) (DeviceIntPtr /* pDev */ ,
|
||||
ScreenPtr /* pScr */ ,
|
||||
int /* x */ ,
|
||||
int /* y */
|
||||
);
|
||||
Bool (*DeviceCursorInitialize) (DeviceIntPtr /* pDev */ ,
|
||||
ScreenPtr /* pScr */
|
||||
);
|
||||
void (*DeviceCursorCleanup) (DeviceIntPtr /* pDev */ ,
|
||||
ScreenPtr /* pScr */
|
||||
);
|
||||
} miPointerSpriteFuncRec, *miPointerSpriteFuncPtr;
|
||||
|
||||
typedef struct _miPointerScreenFuncRec {
|
||||
Bool (*CursorOffScreen) (ScreenPtr * /* ppScr */ ,
|
||||
int * /* px */ ,
|
||||
int * /* py */
|
||||
);
|
||||
void (*CrossScreen) (ScreenPtr /* pScr */ ,
|
||||
int /* entering */
|
||||
);
|
||||
void (*WarpCursor) (DeviceIntPtr /*pDev */ ,
|
||||
ScreenPtr /* pScr */ ,
|
||||
int /* x */ ,
|
||||
int /* y */
|
||||
);
|
||||
} miPointerScreenFuncRec, *miPointerScreenFuncPtr;
|
||||
|
||||
extern _X_EXPORT Bool miDCInitialize(ScreenPtr /*pScreen */ ,
|
||||
miPointerScreenFuncPtr /*screenFuncs */
|
||||
);
|
||||
|
||||
extern _X_EXPORT ScreenPtr
|
||||
miPointerGetScreen(DeviceIntPtr pDev);
|
||||
|
||||
/* Returns the current cursor position. */
|
||||
extern _X_EXPORT void
|
||||
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y);
|
||||
|
||||
/* Moves the cursor to the specified position. May clip the coordinates:
|
||||
* x and y are modified in-place. */
|
||||
extern _X_EXPORT ScreenPtr
|
||||
miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y,
|
||||
int *nevents, InternalEvent *events);
|
||||
|
||||
extern _X_EXPORT DevPrivateKeyRec miPointerScreenKeyRec;
|
||||
|
||||
#define miPointerScreenKey (&miPointerScreenKeyRec)
|
||||
|
||||
/**
|
||||
* @brief initialize pointer cursor with custom handling
|
||||
*
|
||||
* For DDX'es that need their own handling of pointer cursors,
|
||||
* and can't use the generic "soft cursor" that's created via
|
||||
* miDCInitialize().
|
||||
*
|
||||
* That can be the case on certain video HW with it's own sprite support,
|
||||
* or on remote display protocols like RDP, where the client get the cursor
|
||||
* pixmaps sent over the wire and is responsible for painting it on his side.
|
||||
*
|
||||
* Overwrites ScreenPtr vectors:
|
||||
*
|
||||
* ConstrainCursor, CursorLimits, DisplayCursor, RealizeCursor,
|
||||
* UnrealizeCursor, SetCursorPosition, RecolorCursor, DeviceCursorCleanup
|
||||
* DeviceCursorInitialize
|
||||
*
|
||||
* Hooks to ScreenPtr vectors: CloseScreen
|
||||
*
|
||||
* @param pScreen pointer to ScreenRec the pointer handling applies to
|
||||
* @param spireFuncs pointer to miPointerSpriteFuncPtr call vectors
|
||||
* @param screenFuncs pointer to miPointerScreenFuncPtr call vectors
|
||||
* @param waitForUpdate TRUE if MI shouldn't redraw the pointer immediately,
|
||||
but wait for somebody else triggering it explicitly
|
||||
* @return TRUE on success, FALSE usually indicates allocation failure
|
||||
*/
|
||||
_X_EXPORT Bool
|
||||
miPointerInitialize(ScreenPtr pScreen,
|
||||
miPointerSpriteFuncPtr spriteFuncs,
|
||||
miPointerScreenFuncPtr screenFuncs,
|
||||
Bool waitForUpdate);
|
||||
|
||||
#endif /* MIPOINTER_H */
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* mipointrst.h
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Copyright 1989, 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.
|
||||
*/
|
||||
|
||||
#ifndef MIPOINTRST_H
|
||||
#define MIPOINTRST_H
|
||||
|
||||
#include "mipointer.h"
|
||||
#include "scrnintstr.h"
|
||||
|
||||
typedef struct {
|
||||
miPointerSpriteFuncPtr spriteFuncs; /* sprite-specific methods */
|
||||
miPointerScreenFuncPtr screenFuncs; /* screen-specific methods */
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
Bool waitForUpdate; /* don't move cursor from input thread */
|
||||
Bool showTransparent; /* show empty cursors */
|
||||
} miPointerScreenRec, *miPointerScreenPtr;
|
||||
#endif /* MIPOINTRST_H */
|
||||
@@ -0,0 +1,306 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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.
|
||||
|
||||
******************************************************************/
|
||||
#ifndef MISC_H
|
||||
#define MISC_H 1
|
||||
/*
|
||||
* X internal definitions
|
||||
*
|
||||
*/
|
||||
|
||||
#include <X11/Xosdefs.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Xmd.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xdefs.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#ifndef MAXSCREENS
|
||||
#define MAXSCREENS 16
|
||||
#endif
|
||||
#ifndef MAXGPUSCREENS
|
||||
#define MAXGPUSCREENS 16
|
||||
#endif
|
||||
#define MAXFORMATS 8
|
||||
#ifndef MAXDEVICES
|
||||
#define MAXDEVICES 256 /* input devices */
|
||||
#endif
|
||||
#define GPU_SCREEN_OFFSET 256
|
||||
|
||||
/* 128 event opcodes for core + extension events, excluding GE */
|
||||
#define MAXEVENTS 128
|
||||
#define EXTENSION_EVENT_BASE 64
|
||||
#define EXTENSION_BASE 128
|
||||
|
||||
typedef uint32_t ATOM;
|
||||
|
||||
/* @brief generic X return code
|
||||
*
|
||||
* this type is should be used instead of plain int for all functions
|
||||
* returning and X error code (that's possibly sent to the client),
|
||||
* in order to make return value semantics clear to the humen reader.
|
||||
*
|
||||
* part of public SDK / driver API.
|
||||
*/
|
||||
typedef int XRetCode;
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
|
||||
#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */
|
||||
|
||||
#define NullBox ((BoxPtr)0)
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
/* @deprecated */
|
||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
/* abs() is a function, not a macro; include the file declaring
|
||||
* it in case we haven't done that yet.
|
||||
*/
|
||||
/* this assumes b > 0 */
|
||||
#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
|
||||
|
||||
/* XXX Not for modules */
|
||||
#include <limits.h>
|
||||
#if !defined(MAXSHORT) || !defined(MINSHORT) || \
|
||||
!defined(MAXINT) || !defined(MININT)
|
||||
/*
|
||||
* Some implementations #define these through <math.h>, so preclude
|
||||
* #include'ing it later.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#undef MAXSHORT
|
||||
#define MAXSHORT SHRT_MAX
|
||||
#undef MINSHORT
|
||||
#define MINSHORT SHRT_MIN
|
||||
#undef MAXINT
|
||||
#define MAXINT INT_MAX
|
||||
#undef MININT
|
||||
#define MININT INT_MIN
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h> /* for fopen, etc... */
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Calculate the number of bytes needed to hold bits.
|
||||
* @param bits The minimum number of bits needed.
|
||||
* @return The number of bytes needed to hold bits.
|
||||
*/
|
||||
static inline int
|
||||
bits_to_bytes(const int bits)
|
||||
{
|
||||
return ((bits + 7) >> 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the number of 4-byte units needed to hold the given number of
|
||||
* bytes.
|
||||
* @param bytes The minimum number of bytes needed.
|
||||
* @return The number of 4-byte units needed to hold bytes.
|
||||
*/
|
||||
static inline CARD32
|
||||
bytes_to_int32(const size_t bytes)
|
||||
{
|
||||
return (CARD32)(((bytes) + 3) >> 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the number of bytes (in multiples of 4) needed to hold bytes.
|
||||
* @param bytes The minimum number of bytes needed.
|
||||
* @return The closest multiple of 4 that is equal or higher than bytes.
|
||||
*/
|
||||
static inline int
|
||||
pad_to_int32(const int bytes)
|
||||
{
|
||||
return (((bytes) + 3) & ~3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate padding needed to bring the number of bytes to an even
|
||||
* multiple of 4.
|
||||
* @param bytes The minimum number of bytes needed.
|
||||
* @return The bytes of padding needed to arrive at the closest multiple of 4
|
||||
* that is equal or higher than bytes.
|
||||
*/
|
||||
static inline int
|
||||
padding_for_int32(const int bytes)
|
||||
{
|
||||
return ((-bytes) & 3);
|
||||
}
|
||||
|
||||
/* some macros to help swap requests, replies, and events */
|
||||
|
||||
#define LengthRestS(stuff) \
|
||||
((client->req_len << 1) - (sizeof(*(stuff)) >> 1))
|
||||
|
||||
#define SwapRestS(stuff) \
|
||||
SwapShorts((short *)((stuff) + 1), LengthRestS((stuff)))
|
||||
|
||||
#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
void __attribute__ ((error("wrong sized variable passed to swap")))
|
||||
wrong_size(void);
|
||||
#else
|
||||
static inline void
|
||||
wrong_size(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !(defined(__GNUC__))
|
||||
static inline int
|
||||
__builtin_constant_p(int x)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline uint64_t
|
||||
bswap_64(uint64_t x)
|
||||
{
|
||||
return (((x & 0xFF00000000000000ull) >> 56) |
|
||||
((x & 0x00FF000000000000ull) >> 40) |
|
||||
((x & 0x0000FF0000000000ull) >> 24) |
|
||||
((x & 0x000000FF00000000ull) >> 8) |
|
||||
((x & 0x00000000FF000000ull) << 8) |
|
||||
((x & 0x0000000000FF0000ull) << 24) |
|
||||
((x & 0x000000000000FF00ull) << 40) |
|
||||
((x & 0x00000000000000FFull) << 56));
|
||||
}
|
||||
|
||||
#define swapll(x) do { \
|
||||
if (sizeof(*(x)) != 8) \
|
||||
wrong_size(); \
|
||||
*(x) = bswap_64(*(x)); \
|
||||
} while (0)
|
||||
|
||||
static inline uint32_t
|
||||
bswap_32(uint32_t x)
|
||||
{
|
||||
return (((x & 0xFF000000) >> 24) |
|
||||
((x & 0x00FF0000) >> 8) |
|
||||
((x & 0x0000FF00) << 8) |
|
||||
((x & 0x000000FF) << 24));
|
||||
}
|
||||
|
||||
#define swapl(x) do { \
|
||||
if (sizeof(*(x)) != 4) \
|
||||
wrong_size(); \
|
||||
*(x) = bswap_32(*(x)); \
|
||||
} while (0)
|
||||
|
||||
static inline uint16_t
|
||||
bswap_16(uint16_t x)
|
||||
{
|
||||
return (((x & 0xFF00) >> 8) |
|
||||
((x & 0x00FF) << 8));
|
||||
}
|
||||
|
||||
#define swaps(x) do { \
|
||||
if (sizeof(*(x)) != 2) \
|
||||
wrong_size(); \
|
||||
*(x) = bswap_16(*(x)); \
|
||||
} while (0)
|
||||
|
||||
/* copy 32-bit value from src to dst byteswapping on the way */
|
||||
#define cpswapl(src, dst) do { \
|
||||
if (sizeof((src)) != 4 || sizeof((dst)) != 4) \
|
||||
wrong_size(); \
|
||||
(dst) = bswap_32((src)); \
|
||||
} while (0)
|
||||
|
||||
/* copy short from src to dst byteswapping on the way */
|
||||
#define cpswaps(src, dst) do { \
|
||||
if (sizeof((src)) != 2 || sizeof((dst)) != 2) \
|
||||
wrong_size(); \
|
||||
(dst) = bswap_16((src)); \
|
||||
} while (0)
|
||||
|
||||
extern _X_EXPORT void SwapShorts(short *list, unsigned long count);
|
||||
|
||||
typedef struct _xPoint *DDXPointPtr;
|
||||
typedef struct pixman_box16 *BoxPtr;
|
||||
typedef struct _xEvent *xEventPtr;
|
||||
typedef struct _xRectangle *xRectanglePtr;
|
||||
typedef struct _GrabRec *GrabPtr;
|
||||
|
||||
typedef unsigned long x_server_generation_t;
|
||||
|
||||
extern _X_EXPORT unsigned long globalSerialNumber;
|
||||
extern _X_EXPORT x_server_generation_t serverGeneration;
|
||||
|
||||
#endif /* MISC_H */
|
||||
@@ -0,0 +1,65 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 MISCSTRUCT_H
|
||||
#define MISCSTRUCT_H 1
|
||||
|
||||
#include "misc.h"
|
||||
#include <X11/Xprotostr.h>
|
||||
#include <pixman.h>
|
||||
|
||||
typedef xPoint DDXPointRec;
|
||||
|
||||
typedef struct pixman_box16 BoxRec;
|
||||
|
||||
typedef union _DevUnion {
|
||||
void *ptr;
|
||||
long val;
|
||||
unsigned long uval;
|
||||
void *(*fptr) (void);
|
||||
} DevUnion;
|
||||
|
||||
#endif /* MISCSTRUCT_H */
|
||||
@@ -0,0 +1,62 @@
|
||||
/***********************************************************
|
||||
|
||||
Copyright 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.
|
||||
|
||||
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 MISTRUCT_H
|
||||
#define MISTRUCT_H
|
||||
|
||||
#include "mi.h"
|
||||
#include "regionstr.h"
|
||||
|
||||
/* information about dashes */
|
||||
typedef struct _miDash {
|
||||
xPoint pt;
|
||||
int e1, e2; /* keep these, so we don't have to do it again */
|
||||
int e; /* bresenham error term for this point on line */
|
||||
int which;
|
||||
int newLine; /* 0 if part of same original line as previous dash */
|
||||
} miDashRec;
|
||||
|
||||
#endif /* MISTRUCT_H */
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Copyright © 2010 NVIDIA Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef _MISYNC_H_
|
||||
#define _MISYNC_H_
|
||||
|
||||
#include "screenint.h"
|
||||
|
||||
typedef struct _SyncObject SyncObject;
|
||||
typedef struct _SyncFence SyncFence;
|
||||
typedef struct _SyncTrigger SyncTrigger;
|
||||
|
||||
typedef void (*SyncScreenCreateFenceFunc) (ScreenPtr pScreen,
|
||||
SyncFence * pFence,
|
||||
Bool initially_triggered);
|
||||
typedef void (*SyncScreenDestroyFenceFunc) (ScreenPtr pScreen,
|
||||
SyncFence * pFence);
|
||||
|
||||
typedef struct _syncScreenFuncs {
|
||||
SyncScreenCreateFenceFunc CreateFence;
|
||||
SyncScreenDestroyFenceFunc DestroyFence;
|
||||
} SyncScreenFuncsRec, *SyncScreenFuncsPtr;
|
||||
|
||||
extern _X_EXPORT void
|
||||
miSyncScreenCreateFence(ScreenPtr pScreen, SyncFence * pFence,
|
||||
Bool initially_triggered);
|
||||
extern _X_EXPORT void
|
||||
miSyncScreenDestroyFence(ScreenPtr pScreen, SyncFence * pFence);
|
||||
|
||||
typedef void (*SyncFenceSetTriggeredFunc) (SyncFence * pFence);
|
||||
typedef void (*SyncFenceResetFunc) (SyncFence * pFence);
|
||||
typedef Bool (*SyncFenceCheckTriggeredFunc) (SyncFence * pFence);
|
||||
typedef void (*SyncFenceAddTriggerFunc) (SyncTrigger * pTrigger);
|
||||
typedef void (*SyncFenceDeleteTriggerFunc) (SyncTrigger * pTrigger);
|
||||
|
||||
typedef struct _syncFenceFuncs {
|
||||
SyncFenceSetTriggeredFunc SetTriggered;
|
||||
SyncFenceResetFunc Reset;
|
||||
SyncFenceCheckTriggeredFunc CheckTriggered;
|
||||
SyncFenceAddTriggerFunc AddTrigger;
|
||||
SyncFenceDeleteTriggerFunc DeleteTrigger;
|
||||
} SyncFenceFuncsRec, *SyncFenceFuncsPtr;
|
||||
|
||||
extern _X_EXPORT void
|
||||
miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence,
|
||||
Bool initially_triggered);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miSyncDestroyFence(SyncFence * pFence);
|
||||
|
||||
extern _X_EXPORT void
|
||||
miSyncTriggerFence(SyncFence * pFence);
|
||||
|
||||
extern _X_EXPORT SyncScreenFuncsPtr miSyncGetScreenFuncs(ScreenPtr pScreen);
|
||||
extern _X_EXPORT Bool
|
||||
miSyncSetup(ScreenPtr pScreen);
|
||||
|
||||
#endif /* _MISYNC_H_ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user