mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-01 09:08:00 +02:00
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into glucose-2
Conflicts: configure.ac hw/xgl/Makefile.am hw/xgl/egl/xeglinit.c hw/xgl/glx/Makefile.am hw/xgl/glx/module/Makefile.am hw/xgl/glx/xglx.c hw/xgl/glx/xglxinit.c hw/xgl/glxext/Makefile.am hw/xgl/glxext/module/Makefile.am hw/xgl/glxext/xglglxext.c hw/xgl/glxext/xglglxlog.c hw/xgl/xglglx.c hw/xgl/xglglx.h hw/xgl/xglinit.c hw/xgl/xglinput.c hw/xgl/xglparse.c hw/xgl/xglscreen.c include/xgl-config.h.in
This commit is contained in:
commit
946549401c
64 changed files with 254 additions and 5133 deletions
88
.gitignore
vendored
88
.gitignore
vendored
|
|
@ -37,61 +37,6 @@ xorg-server.pc
|
|||
stamp-h?
|
||||
do-not-use-config.h
|
||||
do-not-use-config.h.in
|
||||
cfb/cfb8lineCO.c
|
||||
cfb/cfb8lineCP.c
|
||||
cfb/cfb8lineG.c
|
||||
cfb/cfb8lineX.c
|
||||
cfb/cfb8segC.c
|
||||
cfb/cfb8segCS.c
|
||||
cfb/cfb8segX.c
|
||||
cfb/cfb8setG.c
|
||||
cfb/cfbbltC.c
|
||||
cfb/cfbbltG.c
|
||||
cfb/cfbbltO.c
|
||||
cfb/cfbbltX.c
|
||||
cfb/cfbfillarcC.c
|
||||
cfb/cfbfillarcG.c
|
||||
cfb/cfbglrop8.c
|
||||
cfb/cfbply1rctC.c
|
||||
cfb/cfbply1rctG.c
|
||||
cfb/cfbseg.c
|
||||
cfb/cfbsolidC.c
|
||||
cfb/cfbsolidG.c
|
||||
cfb/cfbsolidX.c
|
||||
cfb/cfbtile32C.c
|
||||
cfb/cfbtile32G.c
|
||||
cfb/cfbtileoddC.c
|
||||
cfb/cfbtileoddG.c
|
||||
cfb/cfbzerarcC.c
|
||||
cfb/cfbzerarcG.c
|
||||
cfb/cfbzerarcX.c
|
||||
cfb32/cfb8lineCO.c
|
||||
cfb32/cfb8lineCP.c
|
||||
cfb32/cfb8lineG.c
|
||||
cfb32/cfb8lineX.c
|
||||
cfb32/cfb8segC.c
|
||||
cfb32/cfb8segCS.c
|
||||
cfb32/cfb8segX.c
|
||||
cfb32/cfb8setG.c
|
||||
cfb32/cfbbltC.c
|
||||
cfb32/cfbbltG.c
|
||||
cfb32/cfbbltO.c
|
||||
cfb32/cfbbltX.c
|
||||
cfb32/cfbfillarcC.c
|
||||
cfb32/cfbfillarcG.c
|
||||
cfb32/cfbply1rctC.c
|
||||
cfb32/cfbply1rctG.c
|
||||
cfb32/cfbseg.c
|
||||
cfb32/cfbsolidC.c
|
||||
cfb32/cfbsolidG.c
|
||||
cfb32/cfbsolidX.c
|
||||
cfb32/cfbtile32C.c
|
||||
cfb32/cfbtile32G.c
|
||||
cfb32/cfbtileoddC.c
|
||||
cfb32/cfbtileoddG.c
|
||||
cfb32/cfbzerarcC.c
|
||||
cfb32/cfbzerarcG.c
|
||||
cfb32/cfbzerarcX.c
|
||||
doc/Xserver.1x
|
||||
doc/Xserver.man
|
||||
hw/dmx/Xdmx
|
||||
|
|
@ -120,24 +65,11 @@ hw/dmx/examples/xdmx
|
|||
hw/dmx/examples/xinput
|
||||
hw/dmx/examples/xled
|
||||
hw/dmx/examples/xtest
|
||||
hw/kdrive/ati/Xati
|
||||
hw/kdrive/chips/Xchips
|
||||
hw/kdrive/ephyr/Xephyr
|
||||
hw/kdrive/epson/Xepson
|
||||
hw/kdrive/fake/Xfake
|
||||
hw/kdrive/fbdev/Xfbdev
|
||||
hw/kdrive/i810/Xi810
|
||||
hw/kdrive/mach64/Xmach64
|
||||
hw/kdrive/mga/Xmga
|
||||
hw/kdrive/neomagic/Xneomagic
|
||||
hw/kdrive/nvidia/Xnvidia
|
||||
hw/kdrive/pm2/Xpm2
|
||||
hw/kdrive/r128/Xr128
|
||||
hw/kdrive/sdl/Xsdl
|
||||
hw/kdrive/sis300/Xsis
|
||||
hw/kdrive/smi/Xsmi
|
||||
hw/kdrive/vesa/Xvesa
|
||||
hw/kdrive/via/Xvia
|
||||
hw/vfb/Xvfb
|
||||
hw/vfb/Xvfb.1x
|
||||
hw/vfb/Xvfb.man
|
||||
|
|
@ -153,15 +85,9 @@ hw/xfree86/exa/exa.4x
|
|||
hw/xfree86/exa/exa.man
|
||||
hw/xfree86/fbdevhw/fbdevhw.4x
|
||||
hw/xfree86/fbdevhw/fbdevhw.man
|
||||
hw/xfree86/getconfig/cfg.man
|
||||
hw/xfree86/getconfig/getconfig.1x
|
||||
hw/xfree86/getconfig/getconfig.5x
|
||||
hw/xfree86/getconfig/getconfig.man
|
||||
hw/xfree86/os-support/xorgos.c
|
||||
hw/xfree86/osandcommon.c
|
||||
hw/xfree86/ramdac/xf86BitOrder.c
|
||||
hw/xfree86/scanpci/xf86PciData.c
|
||||
hw/xfree86/scanpci/xf86PciIds.h
|
||||
hw/xfree86/utils/cvt/cvt
|
||||
hw/xfree86/utils/cvt/cvt.man
|
||||
hw/xfree86/utils/gtf/gtf
|
||||
|
|
@ -174,12 +100,6 @@ hw/xfree86/utils/ioport/ioport
|
|||
hw/xfree86/utils/ioport/outb
|
||||
hw/xfree86/utils/ioport/outl
|
||||
hw/xfree86/utils/ioport/outw
|
||||
hw/xfree86/utils/pcitweak/pcitweak
|
||||
hw/xfree86/utils/pcitweak/pcitweak.1x
|
||||
hw/xfree86/utils/pcitweak/pcitweak.man
|
||||
hw/xfree86/utils/scanpci/scanpci
|
||||
hw/xfree86/utils/scanpci/scanpci.1x
|
||||
hw/xfree86/utils/scanpci/scanpci.man
|
||||
hw/xfree86/utils/xorgcfg/XOrgCfg
|
||||
hw/xfree86/utils/xorgcfg/xorgcfg
|
||||
hw/xfree86/utils/xorgcfg/xorgcfg.1x
|
||||
|
|
@ -256,20 +176,12 @@ hw/xfree86/xf1bpp/mfbtileG.c
|
|||
hw/xfree86/xf1bpp/mfbwindow.c
|
||||
hw/xfree86/xf1bpp/mfbzerarc.c
|
||||
hw/xfree86/xf4bpp/mfbseg.c
|
||||
hw/xfree86/xf8_32bpp/cfbgc32.c
|
||||
hw/xfree86/xf8_32bpp/cfbgc8.c
|
||||
hw/xfree86/xorg.c
|
||||
hw/xfree86/xorg.conf.example
|
||||
hw/xfree86/xorg.conf.example.pre
|
||||
hw/xnest/Xnest
|
||||
hw/xnest/Xnest.1x
|
||||
hw/xnest/Xnest.man
|
||||
hw/xprint/Xprt
|
||||
hw/xprint/config/C/print/Xprinters.ghostscript
|
||||
hw/xprint/doc/Xprt.1x
|
||||
hw/xprint/doc/Xprt.man
|
||||
hw/xprint/dpmsstubs-wrapper.c
|
||||
hw/xprint/miinitext-wrapper.c
|
||||
hw/xquartz/mach-startup/mach_startup.h
|
||||
hw/xquartz/mach-startup/mach_startupServer.c
|
||||
hw/xquartz/mach-startup/mach_startupServer.h
|
||||
|
|
|
|||
|
|
@ -676,15 +676,19 @@ SProcSecurityGenerateAuthorization(
|
|||
char n;
|
||||
CARD32 *values;
|
||||
unsigned long nvalues;
|
||||
int values_offset;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
|
||||
swaps(&stuff->nbytesAuthProto, n);
|
||||
swaps(&stuff->nbytesAuthData, n);
|
||||
swapl(&stuff->valueMask, n);
|
||||
values = (CARD32 *)(&stuff[1]) +
|
||||
((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
|
||||
((stuff->nbytesAuthData + (unsigned)3) >> 2);
|
||||
values_offset = ((stuff->nbytesAuthProto + (unsigned)3) >> 2) +
|
||||
((stuff->nbytesAuthData + (unsigned)3) >> 2);
|
||||
if (values_offset >
|
||||
stuff->length - (sz_xSecurityGenerateAuthorizationReq >> 2))
|
||||
return BadLength;
|
||||
values = (CARD32 *)(&stuff[1]) + values_offset;
|
||||
nvalues = (((CARD32 *)stuff) + stuff->length) - values;
|
||||
SwapLongs(values, nvalues);
|
||||
return ProcSecurityGenerateAuthorization(client);
|
||||
|
|
|
|||
113
Xext/shm.c
113
Xext/shm.c
|
|
@ -188,13 +188,12 @@ static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage};
|
|||
static Bool badSysCall = FALSE;
|
||||
|
||||
static void
|
||||
SigSysHandler(signo)
|
||||
int signo;
|
||||
SigSysHandler(int signo)
|
||||
{
|
||||
badSysCall = TRUE;
|
||||
}
|
||||
|
||||
static Bool CheckForShmSyscall()
|
||||
static Bool CheckForShmSyscall(void)
|
||||
{
|
||||
void (*oldHandler)();
|
||||
int shmid = -1;
|
||||
|
|
@ -278,8 +277,7 @@ ShmExtensionInit(INITARGS)
|
|||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
ShmResetProc (extEntry)
|
||||
ExtensionEntry *extEntry;
|
||||
ShmResetProc(ExtensionEntry *extEntry)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -291,17 +289,13 @@ ExtensionEntry *extEntry;
|
|||
}
|
||||
|
||||
void
|
||||
ShmRegisterFuncs(
|
||||
ScreenPtr pScreen,
|
||||
ShmFuncsPtr funcs)
|
||||
ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs)
|
||||
{
|
||||
shmFuncs[pScreen->myNum] = funcs;
|
||||
}
|
||||
|
||||
void
|
||||
ShmSetPixmapFormat(
|
||||
ScreenPtr pScreen,
|
||||
int format)
|
||||
ShmSetPixmapFormat(ScreenPtr pScreen, int format)
|
||||
{
|
||||
shmPixFormat[pScreen->myNum] = format;
|
||||
}
|
||||
|
|
@ -328,15 +322,13 @@ ShmDestroyPixmap (PixmapPtr pPixmap)
|
|||
}
|
||||
|
||||
void
|
||||
ShmRegisterFbFuncs(pScreen)
|
||||
ScreenPtr pScreen;
|
||||
ShmRegisterFbFuncs(ScreenPtr pScreen)
|
||||
{
|
||||
shmFuncs[pScreen->myNum] = &fbFuncs;
|
||||
}
|
||||
|
||||
static int
|
||||
ProcShmQueryVersion(client)
|
||||
ClientPtr client;
|
||||
ProcShmQueryVersion(ClientPtr client)
|
||||
{
|
||||
xShmQueryVersionReply rep;
|
||||
int n;
|
||||
|
|
@ -430,8 +422,7 @@ shm_access(ClientPtr client, SHMPERM_TYPE *perm, int readonly)
|
|||
}
|
||||
|
||||
static int
|
||||
ProcShmAttach(client)
|
||||
ClientPtr client;
|
||||
ProcShmAttach(ClientPtr client)
|
||||
{
|
||||
SHMSTAT_TYPE buf;
|
||||
ShmDescPtr shmdesc;
|
||||
|
|
@ -492,9 +483,8 @@ ProcShmAttach(client)
|
|||
|
||||
/*ARGSUSED*/
|
||||
static int
|
||||
ShmDetachSegment(value, shmseg)
|
||||
pointer value; /* must conform to DeleteType */
|
||||
XID shmseg;
|
||||
ShmDetachSegment(pointer value, /* must conform to DeleteType */
|
||||
XID shmseg)
|
||||
{
|
||||
ShmDescPtr shmdesc = (ShmDescPtr)value;
|
||||
ShmDescPtr *prev;
|
||||
|
|
@ -510,8 +500,7 @@ ShmDetachSegment(value, shmseg)
|
|||
}
|
||||
|
||||
static int
|
||||
ProcShmDetach(client)
|
||||
ClientPtr client;
|
||||
ProcShmDetach(ClientPtr client)
|
||||
{
|
||||
ShmDescPtr shmdesc;
|
||||
REQUEST(xShmDetachReq);
|
||||
|
|
@ -523,12 +512,10 @@ ProcShmDetach(client)
|
|||
}
|
||||
|
||||
static void
|
||||
miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
|
||||
DrawablePtr dst;
|
||||
GCPtr pGC;
|
||||
int depth, w, h, sx, sy, sw, sh, dx, dy;
|
||||
unsigned int format;
|
||||
char *data;
|
||||
miShmPutImage(DrawablePtr dst, GCPtr pGC,
|
||||
int depth, unsigned int format,
|
||||
int w, int h, int sx, int sy, int sw, int sh, int dx, int dy,
|
||||
char *data)
|
||||
{
|
||||
PixmapPtr pmap;
|
||||
GCPtr putGC;
|
||||
|
|
@ -557,12 +544,10 @@ miShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
|
|||
}
|
||||
|
||||
_X_EXPORT void
|
||||
fbShmPutImage(dst, pGC, depth, format, w, h, sx, sy, sw, sh, dx, dy, data)
|
||||
DrawablePtr dst;
|
||||
GCPtr pGC;
|
||||
int depth, w, h, sx, sy, sw, sh, dx, dy;
|
||||
unsigned int format;
|
||||
char *data;
|
||||
fbShmPutImage(DrawablePtr dst, GCPtr pGC,
|
||||
int depth, unsigned int format,
|
||||
int w, int h, int sx, int sy, int sw, int sh, int dx, int dy,
|
||||
char *data)
|
||||
{
|
||||
if ((format == ZPixmap) || (depth == 1))
|
||||
{
|
||||
|
|
@ -747,8 +732,7 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
|||
}
|
||||
|
||||
static int
|
||||
ProcPanoramiXShmCreatePixmap(
|
||||
ClientPtr client)
|
||||
ProcPanoramiXShmCreatePixmap(ClientPtr client)
|
||||
{
|
||||
ScreenPtr pScreen = NULL;
|
||||
PixmapPtr pMap = NULL;
|
||||
|
|
@ -855,8 +839,7 @@ CreatePmap:
|
|||
#endif
|
||||
|
||||
static int
|
||||
ProcShmPutImage(client)
|
||||
ClientPtr client;
|
||||
ProcShmPutImage(ClientPtr client)
|
||||
{
|
||||
GCPtr pGC;
|
||||
DrawablePtr pDraw;
|
||||
|
|
@ -894,8 +877,17 @@ ProcShmPutImage(client)
|
|||
return BadValue;
|
||||
}
|
||||
|
||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
|
||||
client);
|
||||
/*
|
||||
* There's a potential integer overflow in this check:
|
||||
* VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
|
||||
* client);
|
||||
* the version below ought to avoid it
|
||||
*/
|
||||
if (stuff->totalHeight != 0 &&
|
||||
length > (shmdesc->size - stuff->offset)/stuff->totalHeight) {
|
||||
client->errorValue = stuff->totalWidth;
|
||||
return BadValue;
|
||||
}
|
||||
if (stuff->srcX > stuff->totalWidth)
|
||||
{
|
||||
client->errorValue = stuff->srcX;
|
||||
|
|
@ -959,8 +951,7 @@ ProcShmPutImage(client)
|
|||
|
||||
|
||||
static int
|
||||
ProcShmGetImage(client)
|
||||
ClientPtr client;
|
||||
ProcShmGetImage(ClientPtr client)
|
||||
{
|
||||
DrawablePtr pDraw;
|
||||
long lenPer = 0, length;
|
||||
|
|
@ -1072,12 +1063,8 @@ ProcShmGetImage(client)
|
|||
}
|
||||
|
||||
static PixmapPtr
|
||||
fbShmCreatePixmap (pScreen, width, height, depth, addr)
|
||||
ScreenPtr pScreen;
|
||||
int width;
|
||||
int height;
|
||||
int depth;
|
||||
char *addr;
|
||||
fbShmCreatePixmap (ScreenPtr pScreen,
|
||||
int width, int height, int depth, char *addr)
|
||||
{
|
||||
PixmapPtr pPixmap;
|
||||
|
||||
|
|
@ -1094,8 +1081,7 @@ fbShmCreatePixmap (pScreen, width, height, depth, addr)
|
|||
}
|
||||
|
||||
static int
|
||||
ProcShmCreatePixmap(client)
|
||||
ClientPtr client;
|
||||
ProcShmCreatePixmap(ClientPtr client)
|
||||
{
|
||||
PixmapPtr pMap;
|
||||
DrawablePtr pDraw;
|
||||
|
|
@ -1176,8 +1162,7 @@ CreatePmap:
|
|||
}
|
||||
|
||||
static int
|
||||
ProcShmDispatch (client)
|
||||
ClientPtr client;
|
||||
ProcShmDispatch (ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
switch (stuff->data)
|
||||
|
|
@ -1212,8 +1197,7 @@ ProcShmDispatch (client)
|
|||
}
|
||||
|
||||
static void
|
||||
SShmCompletionEvent(from, to)
|
||||
xShmCompletionEvent *from, *to;
|
||||
SShmCompletionEvent(xShmCompletionEvent *from, xShmCompletionEvent *to)
|
||||
{
|
||||
to->type = from->type;
|
||||
cpswaps(from->sequenceNumber, to->sequenceNumber);
|
||||
|
|
@ -1225,8 +1209,7 @@ SShmCompletionEvent(from, to)
|
|||
}
|
||||
|
||||
static int
|
||||
SProcShmQueryVersion(client)
|
||||
ClientPtr client;
|
||||
SProcShmQueryVersion(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmQueryVersionReq);
|
||||
|
|
@ -1236,8 +1219,7 @@ SProcShmQueryVersion(client)
|
|||
}
|
||||
|
||||
static int
|
||||
SProcShmAttach(client)
|
||||
ClientPtr client;
|
||||
SProcShmAttach(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmAttachReq);
|
||||
|
|
@ -1249,8 +1231,7 @@ SProcShmAttach(client)
|
|||
}
|
||||
|
||||
static int
|
||||
SProcShmDetach(client)
|
||||
ClientPtr client;
|
||||
SProcShmDetach(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmDetachReq);
|
||||
|
|
@ -1261,8 +1242,7 @@ SProcShmDetach(client)
|
|||
}
|
||||
|
||||
static int
|
||||
SProcShmPutImage(client)
|
||||
ClientPtr client;
|
||||
SProcShmPutImage(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmPutImageReq);
|
||||
|
|
@ -1284,8 +1264,7 @@ SProcShmPutImage(client)
|
|||
}
|
||||
|
||||
static int
|
||||
SProcShmGetImage(client)
|
||||
ClientPtr client;
|
||||
SProcShmGetImage(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmGetImageReq);
|
||||
|
|
@ -1303,8 +1282,7 @@ SProcShmGetImage(client)
|
|||
}
|
||||
|
||||
static int
|
||||
SProcShmCreatePixmap(client)
|
||||
ClientPtr client;
|
||||
SProcShmCreatePixmap(ClientPtr client)
|
||||
{
|
||||
int n;
|
||||
REQUEST(xShmCreatePixmapReq);
|
||||
|
|
@ -1320,8 +1298,7 @@ SProcShmCreatePixmap(client)
|
|||
}
|
||||
|
||||
static int
|
||||
SProcShmDispatch (client)
|
||||
ClientPtr client;
|
||||
SProcShmDispatch (ClientPtr client)
|
||||
{
|
||||
REQUEST(xReq);
|
||||
switch (stuff->data)
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ ProcXTestFakeInput(client)
|
|||
deviceValuator *dv = NULL;
|
||||
int valuators[MAX_VALUATORS] = {0};
|
||||
int numValuators = 0;
|
||||
int firstValuator;
|
||||
int firstValuator = 0;
|
||||
EventListPtr events;
|
||||
int nevents;
|
||||
int i;
|
||||
|
|
|
|||
14
configure.ac
14
configure.ac
|
|
@ -40,8 +40,6 @@ AC_CONFIG_HEADERS(include/xorg-server.h)
|
|||
dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just
|
||||
dnl dix/).
|
||||
AC_CONFIG_HEADERS(include/dix-config.h)
|
||||
dnl xgl-config.h covers the Xgl DDX.
|
||||
AC_CONFIG_HEADERS(include/xgl-config.h)
|
||||
dnl xorg-config.h covers the Xorg DDX.
|
||||
AC_CONFIG_HEADERS(include/xorg-config.h)
|
||||
dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs.
|
||||
|
|
@ -567,9 +565,6 @@ AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server
|
|||
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
|
||||
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
|
||||
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
|
||||
AC_ARG_ENABLE(xgl, AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
|
||||
AC_ARG_ENABLE(xglx, AS_HELP_STRING([--enable-xglx], [Build Xglx xgl module (default: no)]), [XGLX=$enableval], [XGLX=no])
|
||||
AC_ARG_ENABLE(xegl, AS_HELP_STRING([--enable-xegl], [Build Xegl xgl module (default: no)]), [XEGL=$enableval], [XEGL=no])
|
||||
dnl legacy fb support
|
||||
AC_ARG_ENABLE(mfb, AS_HELP_STRING([--enable-mfb], [Build legacy mono framebuffer support (default: disable)]), [MFB=$enableval], [MFB=no])
|
||||
dnl kdrive and its subsystems
|
||||
|
|
@ -1331,7 +1326,7 @@ xorg_bus_ppcpci=no
|
|||
xorg_bus_sparcpci=no
|
||||
xorg_bus_sparc=no
|
||||
|
||||
if test "x$XORG" = xyes -o "x$XGL" = xyes; then
|
||||
if test "x$XORG" = xyes; then
|
||||
XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
|
||||
XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
|
||||
XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
|
||||
|
|
@ -2073,13 +2068,6 @@ hw/dmx/input/Makefile
|
|||
hw/dmx/glxProxy/Makefile
|
||||
hw/dmx/Makefile
|
||||
hw/vfb/Makefile
|
||||
hw/xgl/Makefile
|
||||
hw/xgl/egl/Makefile
|
||||
hw/xgl/egl/module/Makefile
|
||||
hw/xgl/glx/Makefile
|
||||
hw/xgl/glx/module/Makefile
|
||||
hw/xgl/glxext/Makefile
|
||||
hw/xgl/glxext/module/Makefile
|
||||
hw/xnest/Makefile
|
||||
hw/xwin/Makefile
|
||||
hw/xquartz/Makefile
|
||||
|
|
|
|||
53
dbe/dbe.c
53
dbe/dbe.c
|
|
@ -229,6 +229,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
|
|||
xDbeSwapAction swapAction;
|
||||
VisualID visual;
|
||||
int status;
|
||||
int add_index;
|
||||
|
||||
|
||||
REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
|
||||
|
|
@ -299,14 +300,6 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
|
|||
return(BadAlloc);
|
||||
bzero(pDbeWindowPriv, sizeof(DbeWindowPrivRec));
|
||||
|
||||
/* Make the window priv a DBE window priv resource. */
|
||||
if (!AddResource(stuff->buffer, dbeWindowPrivResType,
|
||||
(pointer)pDbeWindowPriv))
|
||||
{
|
||||
xfree(pDbeWindowPriv);
|
||||
return(BadAlloc);
|
||||
}
|
||||
|
||||
/* Fill out window priv information. */
|
||||
pDbeWindowPriv->pWindow = pWin;
|
||||
pDbeWindowPriv->width = pWin->drawable.width;
|
||||
|
|
@ -321,14 +314,15 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
|
|||
/* Initialize the buffer ID list. */
|
||||
pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS;
|
||||
pDbeWindowPriv->IDs[0] = stuff->buffer;
|
||||
for (i = 1; i < DBE_INIT_MAX_IDS; i++)
|
||||
|
||||
add_index = 0;
|
||||
for (i = 0; i < DBE_INIT_MAX_IDS; i++)
|
||||
{
|
||||
pDbeWindowPriv->IDs[i] = DBE_FREE_ID_ELEMENT;
|
||||
}
|
||||
|
||||
|
||||
/* Actually connect the window priv to the window. */
|
||||
dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, pDbeWindowPriv);
|
||||
dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, pDbeWindowPriv);
|
||||
|
||||
} /* if -- There is no buffer associated with the window. */
|
||||
|
||||
|
|
@ -354,7 +348,6 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
|
|||
/* No more room in the ID array -- reallocate another array. */
|
||||
XID *pIDs;
|
||||
|
||||
|
||||
/* Setup an array pointer for the realloc operation below. */
|
||||
if (pDbeWindowPriv->maxAvailableIDs == DBE_INIT_MAX_IDS)
|
||||
{
|
||||
|
|
@ -391,16 +384,7 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
|
|||
pDbeWindowPriv->maxAvailableIDs += DBE_INCR_MAX_IDS;
|
||||
}
|
||||
|
||||
/* Finally, record the buffer ID in the array. */
|
||||
pDbeWindowPriv->IDs[i] = stuff->buffer;
|
||||
|
||||
/* Associate the new ID with an existing window priv. */
|
||||
if (!AddResource(stuff->buffer, dbeWindowPrivResType,
|
||||
(pointer)pDbeWindowPriv))
|
||||
{
|
||||
pDbeWindowPriv->IDs[i] = DBE_FREE_ID_ELEMENT;
|
||||
return(BadAlloc);
|
||||
}
|
||||
add_index = i;
|
||||
|
||||
} /* else -- A buffer is already associated with the window. */
|
||||
|
||||
|
|
@ -409,13 +393,26 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
|
|||
status = (*pDbeScreenPriv->AllocBackBufferName)(pWin, stuff->buffer,
|
||||
stuff->swapAction);
|
||||
|
||||
if ((status != Success) && (pDbeWindowPriv->nBufferIDs == 0))
|
||||
if (status == Success)
|
||||
{
|
||||
pDbeWindowPriv->IDs[add_index] = stuff->buffer;
|
||||
if (!AddResource(stuff->buffer, dbeWindowPrivResType,
|
||||
(pointer)pDbeWindowPriv))
|
||||
{
|
||||
pDbeWindowPriv->IDs[add_index] = DBE_FREE_ID_ELEMENT;
|
||||
|
||||
if (pDbeWindowPriv->nBufferIDs == 0) {
|
||||
status = BadAlloc;
|
||||
goto out_free;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* The DDX buffer allocation routine failed for the first buffer of
|
||||
* this window.
|
||||
*/
|
||||
xfree(pDbeWindowPriv);
|
||||
return(status);
|
||||
if (pDbeWindowPriv->nBufferIDs == 0) {
|
||||
goto out_free;
|
||||
}
|
||||
}
|
||||
|
||||
/* Increment the number of buffers (XIDs) associated with this window. */
|
||||
|
|
@ -424,9 +421,13 @@ ProcDbeAllocateBackBufferName(ClientPtr client)
|
|||
/* Set swap action on all calls. */
|
||||
pDbeWindowPriv->swapAction = stuff->swapAction;
|
||||
|
||||
|
||||
return(status);
|
||||
|
||||
out_free:
|
||||
dixSetPrivate(&pWin->devPrivates, dbeWindowPrivKey, NULL);
|
||||
xfree(pDbeWindowPriv);
|
||||
return (status);
|
||||
|
||||
} /* ProcDbeAllocateBackBufferName() */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2950,6 +2950,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
|
|||
|
||||
if (pScreen)
|
||||
{
|
||||
(*pScreen->RealizeCursor) ( pDev, pScreen, pSprite->current);
|
||||
(*pScreen->CursorLimits) ( pDev, pScreen, pSprite->current,
|
||||
&pSprite->hotLimits, &pSprite->physLimits);
|
||||
pSprite->confined = FALSE;
|
||||
|
|
|
|||
|
|
@ -362,6 +362,7 @@ ExaCheckComposite (CARD8 op,
|
|||
CARD32
|
||||
exaGetPixmapFirstPixel (PixmapPtr pPixmap)
|
||||
{
|
||||
ExaScreenPriv(pPixmap->drawable.pScreen);
|
||||
CARD32 pixel;
|
||||
void *fb;
|
||||
Bool need_finish = FALSE;
|
||||
|
|
@ -376,7 +377,8 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap)
|
|||
fb = pExaPixmap->sys_ptr;
|
||||
|
||||
/* Try to avoid framebuffer readbacks */
|
||||
if ((!offscreen && !sys_valid && !damaged) ||
|
||||
if (pExaScr->info->CreatePixmap ||
|
||||
(!offscreen && !sys_valid && !damaged) ||
|
||||
(offscreen && (!sys_valid || damaged)))
|
||||
{
|
||||
box.x1 = 0;
|
||||
|
|
|
|||
|
|
@ -943,11 +943,11 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
|
|||
buf[p++] = modes->transparentAlpha;
|
||||
buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
|
||||
buf[p++] = modes->transparentIndex;
|
||||
buf[p++] = 0;
|
||||
buf[p++] = 0;
|
||||
buf[p++] = 0;
|
||||
buf[p++] = 0;
|
||||
buf[p++] = 0;
|
||||
buf[p++] = GLX_SAMPLES_SGIS;
|
||||
buf[p++] = modes->samples;
|
||||
buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
|
||||
buf[p++] = modes->sampleBuffers;
|
||||
buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */
|
||||
buf[p++] = 0;
|
||||
|
||||
if (client->swapped) {
|
||||
|
|
@ -959,7 +959,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
|
|||
return Success;
|
||||
}
|
||||
|
||||
#define __GLX_TOTAL_FBCONFIG_ATTRIBS (33)
|
||||
#define __GLX_TOTAL_FBCONFIG_ATTRIBS (35)
|
||||
#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
|
||||
/**
|
||||
* Send the set of GLXFBConfigs to the client. There is not currently
|
||||
|
|
@ -1037,6 +1037,9 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
|
|||
WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha );
|
||||
WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex );
|
||||
WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod );
|
||||
WRITE_PAIR( GLX_SAMPLES_SGIS, modes->samples );
|
||||
WRITE_PAIR( GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers );
|
||||
/* GLX_VISUAL_SELECT_GROUP_SGIX ? */
|
||||
WRITE_PAIR( GLX_DRAWABLE_TYPE, modes->drawableType );
|
||||
WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb );
|
||||
WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba );
|
||||
|
|
|
|||
|
|
@ -485,9 +485,11 @@ nooverride:
|
|||
|
||||
data = xalloc(pitch * pixmap->drawable.height);
|
||||
|
||||
__glXenterServer(GL_FALSE);
|
||||
pScreen->GetImage(&pixmap->drawable, 0 /*pixmap->drawable.x*/,
|
||||
0 /*pixmap->drawable.y*/, pixmap->drawable.width,
|
||||
pixmap->drawable.height, ZPixmap, ~0, data);
|
||||
__glXleaveServer(GL_FALSE);
|
||||
|
||||
if (pixmap->drawable.depth == 24)
|
||||
glxFillAlphaChannel(data,
|
||||
|
|
@ -529,9 +531,11 @@ nooverride:
|
|||
pixmap->drawable.depth);
|
||||
void *data = xalloc(pitch * (p[i].y2 - p[i].y1));
|
||||
|
||||
__glXenterServer(GL_FALSE);
|
||||
pScreen->GetImage(&pixmap->drawable, /*pixmap->drawable.x +*/ p[i].x1,
|
||||
/*pixmap->drawable.y*/ + p[i].y1, p[i].x2 - p[i].x1,
|
||||
p[i].y2 - p[i].y1, ZPixmap, ~0, data);
|
||||
__glXleaveServer(GL_FALSE);
|
||||
|
||||
if (pixmap->drawable.depth == 24)
|
||||
glxFillAlphaChannel(data,
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ struct __GLXDRIdrawable {
|
|||
__GLXDRIscreen *screen;
|
||||
|
||||
GCPtr gc; /* scratch GC for span drawing */
|
||||
GCPtr cleargc; /* GC for clearing the color buffer */
|
||||
GCPtr swapgc; /* GC for swapping the color buffers */
|
||||
};
|
||||
|
||||
|
|
@ -94,7 +93,6 @@ __glXDRIdrawableDestroy(__GLXdrawable *drawable)
|
|||
(*core->destroyDrawable)(private->driDrawable);
|
||||
|
||||
FreeScratchGC(private->gc);
|
||||
FreeScratchGC(private->cleargc);
|
||||
FreeScratchGC(private->swapgc);
|
||||
|
||||
xfree(private);
|
||||
|
|
@ -335,11 +333,9 @@ __glXDRIscreenCreateDrawable(__GLXscreen *screen,
|
|||
private->base.copySubBuffer = __glXDRIdrawableCopySubBuffer;
|
||||
|
||||
private->gc = CreateScratchGC(pScreen, pDraw->depth);
|
||||
private->cleargc = CreateScratchGC(pScreen, pDraw->depth);
|
||||
private->swapgc = CreateScratchGC(pScreen, pDraw->depth);
|
||||
|
||||
glxChangeGC(private->gc, GCFunction, GXcopy);
|
||||
glxChangeGC(private->cleargc, GCFunction, GXcopy);
|
||||
glxChangeGC(private->swapgc, GCFunction, GXcopy);
|
||||
glxChangeGC(private->swapgc, GCGraphicsExposures, FALSE);
|
||||
|
||||
|
|
@ -378,9 +374,6 @@ swrastPutImage(__DRIdrawable *draw, int op,
|
|||
case __DRI_SWRAST_IMAGE_OP_DRAW:
|
||||
gc = drawable->gc;
|
||||
break;
|
||||
case __DRI_SWRAST_IMAGE_OP_CLEAR:
|
||||
gc = drawable->cleargc;
|
||||
break;
|
||||
case __DRI_SWRAST_IMAGE_OP_SWAP:
|
||||
gc = drawable->swapgc;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -18,10 +18,6 @@ if XWIN
|
|||
XWIN_SUBDIRS = xwin
|
||||
endif
|
||||
|
||||
if XGL
|
||||
XGL_SUBDIRS = xgl
|
||||
endif
|
||||
|
||||
if KDRIVE
|
||||
KDRIVE_SUBDIRS = kdrive
|
||||
endif
|
||||
|
|
@ -32,7 +28,6 @@ endif
|
|||
|
||||
SUBDIRS = \
|
||||
$(XORG_SUBDIRS) \
|
||||
$(XGL_SUBDIRS) \
|
||||
$(XWIN_SUBDIRS) \
|
||||
$(XVFB_SUBDIRS) \
|
||||
$(XNEST_SUBDIRS) \
|
||||
|
|
@ -40,7 +35,7 @@ SUBDIRS = \
|
|||
$(KDRIVE_SUBDIRS) \
|
||||
$(XQUARTZ_SUBDIRS)
|
||||
|
||||
DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xgl
|
||||
DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive
|
||||
|
||||
relink:
|
||||
for i in $(SUBDIRS) ; do $(MAKE) -C $$i relink ; done
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ InitInput (int argc, char **argv)
|
|||
{
|
||||
KdKeyboardInfo *ki;
|
||||
KdPointerInfo *pi;
|
||||
|
||||
|
||||
KdAddKeyboardDriver(&EphyrKeyboardDriver);
|
||||
#ifdef linux
|
||||
KdAddKeyboardDriver(&LinuxEvdevKeyboardDriver);
|
||||
|
|
@ -301,17 +301,17 @@ miPointerSpriteFuncRec EphyrPointerSpriteFuncs = {
|
|||
ephyrUnrealizeCursor,
|
||||
ephyrSetCursor,
|
||||
ephyrMoveCursor,
|
||||
ephyrDeviceCursorInitialize,
|
||||
NULL
|
||||
ephyrDeviceCursorInitialize,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
Bool
|
||||
ephyrCursorInit(ScreenPtr pScreen)
|
||||
{
|
||||
miPointerInitialize(pScreen,
|
||||
miPointerInitialize(pScreen,
|
||||
&EphyrPointerSpriteFuncs,
|
||||
&ephyrPointerScreenFuncs,
|
||||
&ephyrPointerScreenFuncs,
|
||||
FALSE);
|
||||
|
||||
return TRUE;
|
||||
|
|
@ -336,18 +336,18 @@ KdCardFuncs ephyrFuncs = {
|
|||
ephyrRestore, /* restore */
|
||||
ephyrScreenFini, /* scrfini */
|
||||
ephyrCardFini, /* cardfini */
|
||||
|
||||
0, /* initCursor */
|
||||
0, /* enableCursor */
|
||||
|
||||
0, /* initCursor */
|
||||
0, /* enableCursor */
|
||||
0, /* disableCursor */
|
||||
0, /* finiCursor */
|
||||
0, /* recolorCursor */
|
||||
|
||||
|
||||
0, /* initAccel */
|
||||
0, /* enableAccel */
|
||||
0, /* disableAccel */
|
||||
0, /* finiAccel */
|
||||
|
||||
ephyrGetColors, /* getColors */
|
||||
|
||||
ephyrGetColors,/* getColors */
|
||||
ephyrPutColors, /* putColors */
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2107,7 +2107,7 @@ KdEnqueuePointerEvent(KdPointerInfo *pi, unsigned long flags, int rx, int ry,
|
|||
if (flags & KD_MOUSE_DELTA)
|
||||
{
|
||||
if (x || y || z)
|
||||
dixflags = POINTER_RELATIVE & POINTER_ACCELERATE;
|
||||
dixflags = POINTER_RELATIVE | POINTER_ACCELERATE;
|
||||
} else if (x != pi->dixdev->last.valuators[0] ||
|
||||
y != pi->dixdev->last.valuators[1])
|
||||
dixflags = POINTER_ABSOLUTE;
|
||||
|
|
|
|||
|
|
@ -2454,12 +2454,6 @@ addDefaultModes(MonPtr monitorp)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
checkInput(serverLayoutPtr layout) {
|
||||
if (!xf86Info.allowEmptyInput)
|
||||
checkCoreInputDevices(layout, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* load the config file and fill the global data structure
|
||||
*/
|
||||
|
|
@ -2486,7 +2480,7 @@ xf86HandleConfigFile(Bool autoconfig)
|
|||
xf86MsgVerb(from, 0, "Using config file: \"%s\"\n", filename);
|
||||
xf86ConfigFile = xnfstrdup(filename);
|
||||
} else {
|
||||
xf86Msg(X_ERROR, "Unable to locate/open config file");
|
||||
xf86Msg(X_WARNING, "Unable to locate/open config file");
|
||||
if (xf86ConfigFile)
|
||||
xf86ErrorFVerb(0, ": \"%s\"", xf86ConfigFile);
|
||||
xf86ErrorFVerb(0, "\n");
|
||||
|
|
|
|||
|
|
@ -236,8 +236,6 @@ ProcessInputEvents ()
|
|||
}
|
||||
#endif
|
||||
|
||||
xf86Info.inputPending = FALSE;
|
||||
|
||||
mieqProcessInputEvents();
|
||||
|
||||
/* FIXME: This is a problem if we have multiple pointers */
|
||||
|
|
@ -499,8 +497,6 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
|
|||
}
|
||||
|
||||
if (xf86VTSwitchPending()) xf86VTSwitch();
|
||||
|
||||
if (xf86Info.inputPending) ProcessInputEvents();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ xf86InfoRec xf86Info = {
|
|||
NULL, /* mouseLocal */
|
||||
-1, /* lastEventTime */
|
||||
FALSE, /* vtRequestsPending */
|
||||
FALSE, /* inputPending */
|
||||
FALSE, /* dontVTSwitch */
|
||||
FALSE, /* dontZap */
|
||||
FALSE, /* dontZoom */
|
||||
|
|
|
|||
|
|
@ -1117,7 +1117,6 @@ InitInput(argc, argv)
|
|||
InputInfoPtr pInfo;
|
||||
|
||||
xf86Info.vtRequestsPending = FALSE;
|
||||
xf86Info.inputPending = FALSE;
|
||||
|
||||
/* Call the PreInit function for each input device instance. */
|
||||
for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ typedef struct {
|
|||
/* event handler part */
|
||||
int lastEventTime;
|
||||
Bool vtRequestsPending;
|
||||
Bool inputPending;
|
||||
Bool dontVTSwitch;
|
||||
Bool dontZap;
|
||||
Bool dontZoom;
|
||||
|
|
|
|||
|
|
@ -785,9 +785,9 @@ xf86ScaleAxis(int Cx,
|
|||
ErrorF ("Divide by Zero in xf86ScaleAxis");
|
||||
}
|
||||
|
||||
if (X > Sxlow)
|
||||
if (X > Sxhigh)
|
||||
X = Sxlow;
|
||||
if (X < Sxhigh)
|
||||
if (X < Sxlow)
|
||||
X = Sxhigh;
|
||||
|
||||
return (X);
|
||||
|
|
|
|||
|
|
@ -1864,6 +1864,7 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
|
|||
|
||||
nextEnabledOutput(config, enabled, &o);
|
||||
while ((mode = nextAspectMode(config->output[o], mode, aspect))) {
|
||||
test = mode;
|
||||
for (p = o; nextEnabledOutput(config, enabled, &p); ) {
|
||||
test = xf86OutputFindClosestMode(config->output[p], mode);
|
||||
if (!test)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ static void xf86CursorSetCursor(DeviceIntPtr, ScreenPtr, CursorPtr, int, int);
|
|||
static void xf86CursorMoveCursor(DeviceIntPtr, ScreenPtr, int, int);
|
||||
static Bool xf86DeviceCursorInitialize(DeviceIntPtr, ScreenPtr);
|
||||
static void xf86DeviceCursorCleanup(DeviceIntPtr, ScreenPtr);
|
||||
static void xf86DeviceCursorUndisplay(DeviceIntPtr, ScreenPtr);
|
||||
|
||||
static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
|
||||
xf86CursorRealizeCursor,
|
||||
|
|
|
|||
|
|
@ -1,44 +0,0 @@
|
|||
if XGL
|
||||
XGL_MODULE_DIRS = module
|
||||
endif
|
||||
|
||||
DIST_SUBDIRS = module
|
||||
|
||||
SUBDIRS = \
|
||||
. \
|
||||
$(XGL_MODULE_DIRS)
|
||||
|
||||
AM_CFLAGS = \
|
||||
$(DIX_CFLAGS) \
|
||||
-DHAVE_XGL_CONFIG_H \
|
||||
-DHAVE_DIX_CONFIG_H \
|
||||
$(XEGLMODULES_CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libxegl.la
|
||||
|
||||
libxegl_la_SOURCES = \
|
||||
xegl.h \
|
||||
xegl.c \
|
||||
xeglinput.c \
|
||||
kkeymap.h \
|
||||
kinput.c \
|
||||
evdev.c
|
||||
|
||||
XEGL_LIBS = \
|
||||
@XEGL_LIBS@ \
|
||||
libxegl.la \
|
||||
../libxgl.a \
|
||||
$XSERVER_LIBS
|
||||
|
||||
Xegl_LDFLAGS = -export-dynamic
|
||||
Xegl_SOURCES = \
|
||||
xeglinit.c \
|
||||
$(top_srcdir)/mi/miinitext.c \
|
||||
$(top_srcdir)/Xext/dpmsstubs.c \
|
||||
$(top_srcdir)/Xi/stubs.c \
|
||||
$(top_srcdir)/fb/fbcmap.c
|
||||
|
||||
Xegl_DEPENDENCIES = $(XEGL_LIBS)
|
||||
Xegl_LDADD = $(XEGL_LIBS) $(XSERVER_SYS_LIBS) $(XEGL_SYS_LIBS)
|
||||
|
||||
bin_PROGRAMS = Xegl
|
||||
|
|
@ -1,646 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2004 Keith Packard
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||
* documentation for any purpose is hereby granted without fee, provided that
|
||||
* the above copyright notice appear in all copies and that both that
|
||||
* copyright notice and this permission notice appear in supporting
|
||||
* documentation, and that the name of Keith Packard not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||
* EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
||||
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <xgl-config.h>
|
||||
#define NEED_EVENTS
|
||||
#include <errno.h>
|
||||
#include <linux/input.h>
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xpoll.h>
|
||||
#define XK_PUBLISHING
|
||||
#include <X11/keysym.h>
|
||||
#include "inputstr.h"
|
||||
#include "kkeymap.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "xegl.h"
|
||||
|
||||
#define NUM_EVENTS 128
|
||||
#define ABS_UNSET -65535
|
||||
|
||||
#define BITS_PER_LONG (sizeof(long) * 8)
|
||||
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
|
||||
#define ISBITSET(x,y) ((x)[LONG(y)] & BIT(y))
|
||||
#define OFF(x) ((x)%BITS_PER_LONG)
|
||||
#define LONG(x) ((x)/BITS_PER_LONG)
|
||||
#define BIT(x) (1 << OFF(x))
|
||||
#define SETBIT(x,y) ((x)[LONG(y)] |= BIT(y))
|
||||
#define CLRBIT(x,y) ((x)[LONG(y)] &= ~BIT(y))
|
||||
#define ASSIGNBIT(x,y,z) ((x)[LONG(y)] = ((x)[LONG(y)] & ~BIT(y)) | (z << OFF(y)))
|
||||
|
||||
typedef struct _kevdevMouse {
|
||||
/* current device state */
|
||||
int rel[REL_MAX + 1];
|
||||
int abs[ABS_MAX + 1];
|
||||
int prevabs[ABS_MAX + 1];
|
||||
long key[NBITS(KEY_MAX + 1)];
|
||||
|
||||
/* supported device info */
|
||||
long relbits[NBITS(REL_MAX + 1)];
|
||||
long absbits[NBITS(ABS_MAX + 1)];
|
||||
long keybits[NBITS(KEY_MAX + 1)];
|
||||
struct input_absinfo absinfo[ABS_MAX + 1];
|
||||
int max_rel;
|
||||
int max_abs;
|
||||
} Kevdev;
|
||||
|
||||
static int flags = 0;
|
||||
|
||||
static void
|
||||
EvdevMotion (KdMouseInfo *mi)
|
||||
{
|
||||
Kevdev *ke = mi->driver;
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= ke->max_rel; i++)
|
||||
if (ke->rel[i])
|
||||
{
|
||||
KdEnqueueMouseEvent (mi, flags | KD_MOUSE_DELTA, ke->rel[0], ke->rel[1]);
|
||||
int a;
|
||||
// ErrorF ("rel");
|
||||
for (a = 0; a <= ke->max_rel; a++)
|
||||
{
|
||||
// if (ISBITSET (ke->relbits, a))
|
||||
// ErrorF (" %d=%d", a, ke->rel[a]);
|
||||
ke->rel[a] = 0;
|
||||
}
|
||||
// ErrorF ("\n");
|
||||
break;
|
||||
}
|
||||
for (i = 0; i < ke->max_abs; i++)
|
||||
if (ke->abs[i] != ke->prevabs[i])
|
||||
{
|
||||
KdEnqueueMouseEvent (mi, flags, ke->abs[0], ke->abs[1]);
|
||||
int a;
|
||||
// ErrorF ("abs");
|
||||
for (a = 0; a <= ke->max_abs; a++)
|
||||
{
|
||||
// if (ISBITSET (ke->absbits, a))
|
||||
// ErrorF (" %d=%d", a, ke->abs[a]);
|
||||
ke->prevabs[a] = ke->abs[a];
|
||||
}
|
||||
// ErrorF ("\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
EvdevRead (int evdevPort, void *closure)
|
||||
{
|
||||
KdMouseInfo *mi = closure;
|
||||
Kevdev *ke = mi->driver;
|
||||
int i, n;
|
||||
struct input_event events[NUM_EVENTS];
|
||||
|
||||
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
|
||||
if (n <= 0)
|
||||
return;
|
||||
n /= sizeof (struct input_event);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
switch (events[i].type) {
|
||||
case EV_SYN:
|
||||
break;
|
||||
case EV_KEY:
|
||||
EvdevMotion (mi);
|
||||
ASSIGNBIT(ke->key,events[i].code, events[i].value);
|
||||
if (events[i].code < 0x100)
|
||||
ErrorF ("key %d %d\n", events[i].code, events[i].value);
|
||||
else
|
||||
ErrorF ("key 0x%x %d\n", events[i].code, events[i].value);
|
||||
|
||||
if (events[i].value==1) {
|
||||
switch (events[i].code) {
|
||||
case BTN_LEFT:
|
||||
flags |= KD_BUTTON_1;
|
||||
break;
|
||||
case BTN_RIGHT:
|
||||
flags |= KD_BUTTON_3;
|
||||
break;
|
||||
case BTN_MIDDLE:
|
||||
flags |= KD_BUTTON_2;
|
||||
break;
|
||||
case BTN_FORWARD:
|
||||
flags |= KD_BUTTON_4;
|
||||
break;
|
||||
case BTN_BACK:
|
||||
flags |= KD_BUTTON_5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (events[i].value==0) {
|
||||
switch (events[i].code) {
|
||||
case BTN_LEFT:
|
||||
flags &= ~KD_BUTTON_1;
|
||||
break;
|
||||
case BTN_RIGHT:
|
||||
flags &= ~KD_BUTTON_3;
|
||||
break;
|
||||
case BTN_MIDDLE:
|
||||
flags &= ~KD_BUTTON_2;
|
||||
break;
|
||||
case BTN_FORWARD:
|
||||
flags &= ~KD_BUTTON_4;
|
||||
break;
|
||||
case BTN_BACK:
|
||||
flags &= ~KD_BUTTON_5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
KdEnqueueMouseEvent (mi, KD_MOUSE_DELTA | flags, 0, 0);
|
||||
break;
|
||||
case EV_REL:
|
||||
ke->rel[events[i].code] += events[i].value;
|
||||
break;
|
||||
case EV_ABS:
|
||||
ke->abs[events[i].code] = events[i].value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
EvdevMotion (mi);
|
||||
}
|
||||
|
||||
int EvdevInputType;
|
||||
|
||||
char *kdefaultEvdev[] = {
|
||||
// "/dev/input/event0",
|
||||
"/dev/input/event1",
|
||||
// "/dev/input/event2",
|
||||
// "/dev/input/event3",
|
||||
// "/dev/input/event4",
|
||||
// "/dev/input/event5",
|
||||
};
|
||||
|
||||
#define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0]))
|
||||
|
||||
static Bool
|
||||
EvdevInit (void)
|
||||
{
|
||||
int i;
|
||||
int fd;
|
||||
KdMouseInfo *mi, *next;
|
||||
int n = 0;
|
||||
char *prot;
|
||||
char name[100];
|
||||
|
||||
if (!EvdevInputType)
|
||||
EvdevInputType = KdAllocInputType ();
|
||||
|
||||
for (mi = kdMouseInfo; mi; mi = next)
|
||||
{
|
||||
next = mi->next;
|
||||
prot = mi->prot;
|
||||
if (mi->inputType)
|
||||
continue;
|
||||
if (!mi->name)
|
||||
{
|
||||
for (i = 0; i < NUM_DEFAULT_EVDEV; i++)
|
||||
{
|
||||
fd = open (kdefaultEvdev[i], 2);
|
||||
if (fd >= 0)
|
||||
{
|
||||
ioctl(fd, EVIOCGRAB, 1);
|
||||
|
||||
ioctl(fd, EVIOCGNAME(sizeof(name)), name);
|
||||
ErrorF("Name is %s\n", name);
|
||||
ioctl(fd, EVIOCGPHYS(sizeof(name)), name);
|
||||
ErrorF("Phys Loc is %s\n", name);
|
||||
ioctl(fd, EVIOCGUNIQ(sizeof(name)), name);
|
||||
ErrorF("Unique is %s\n", name);
|
||||
|
||||
mi->name = KdSaveString (kdefaultEvdev[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
fd = open (mi->name, 2);
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
unsigned long ev[NBITS(EV_MAX)];
|
||||
Kevdev *ke;
|
||||
|
||||
if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0)
|
||||
{
|
||||
perror ("EVIOCGBIT 0");
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
ke = xalloc (sizeof (Kevdev));
|
||||
if (!ke)
|
||||
{
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
memset (ke, '\0', sizeof (Kevdev));
|
||||
if (ISBITSET (ev, EV_KEY))
|
||||
{
|
||||
if (ioctl (fd, EVIOCGBIT (EV_KEY, sizeof (ke->keybits)),
|
||||
ke->keybits) < 0)
|
||||
{
|
||||
perror ("EVIOCGBIT EV_KEY");
|
||||
xfree (ke);
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (ISBITSET (ev, EV_REL))
|
||||
{
|
||||
if (ioctl (fd, EVIOCGBIT (EV_REL, sizeof (ke->relbits)),
|
||||
ke->relbits) < 0)
|
||||
{
|
||||
perror ("EVIOCGBIT EV_REL");
|
||||
xfree (ke);
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
for (ke->max_rel = REL_MAX; ke->max_rel >= 0; ke->max_rel--)
|
||||
if (ISBITSET(ke->relbits, ke->max_rel))
|
||||
break;
|
||||
}
|
||||
if (ISBITSET (ev, EV_ABS))
|
||||
{
|
||||
int i;
|
||||
|
||||
if (ioctl (fd, EVIOCGBIT (EV_ABS, sizeof (ke->absbits)),
|
||||
ke->absbits) < 0)
|
||||
{
|
||||
perror ("EVIOCGBIT EV_ABS");
|
||||
xfree (ke);
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
for (ke->max_abs = ABS_MAX; ke->max_abs >= 0; ke->max_abs--)
|
||||
if (ISBITSET(ke->absbits, ke->max_abs))
|
||||
break;
|
||||
for (i = 0; i <= ke->max_abs; i++)
|
||||
{
|
||||
if (ISBITSET (ke->absbits, i))
|
||||
if (ioctl (fd, EVIOCGABS(i), &ke->absinfo[i]) < 0)
|
||||
{
|
||||
perror ("EVIOCGABS");
|
||||
break;
|
||||
}
|
||||
ke->prevabs[i] = ABS_UNSET;
|
||||
}
|
||||
if (i <= ke->max_abs)
|
||||
{
|
||||
xfree (ke);
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
mi->driver = ke;
|
||||
mi->inputType = EvdevInputType;
|
||||
if (KdRegisterFd (EvdevInputType, fd, EvdevRead, (void *) mi))
|
||||
n++;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
EvdevFini (void)
|
||||
{
|
||||
KdMouseInfo *mi;
|
||||
|
||||
KdUnregisterFds (EvdevInputType, TRUE);
|
||||
for (mi = kdMouseInfo; mi; mi = mi->next)
|
||||
{
|
||||
if (mi->inputType == EvdevInputType)
|
||||
{
|
||||
xfree (mi->driver);
|
||||
mi->driver = 0;
|
||||
mi->inputType = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
KdMouseFuncs LinuxEvdevMouseFuncs = {
|
||||
EvdevInit,
|
||||
EvdevFini,
|
||||
};
|
||||
|
||||
|
||||
KeySym evdevKeymap[(112 - 1 + 1) * 2] = {
|
||||
/* These are directly mapped from DOS scanset 0 */
|
||||
/* 1 8 */ XK_Escape, NoSymbol,
|
||||
/* 2 9 */ XK_1, XK_exclam,
|
||||
/* 3 10 */ XK_2, XK_at,
|
||||
/* 4 11 */ XK_3, XK_numbersign,
|
||||
/* 5 12 */ XK_4, XK_dollar,
|
||||
/* 6 13 */ XK_5, XK_percent,
|
||||
/* 7 14 */ XK_6, XK_asciicircum,
|
||||
/* 8 15 */ XK_7, XK_ampersand,
|
||||
/* 9 16 */ XK_8, XK_asterisk,
|
||||
/* 10 17 */ XK_9, XK_parenleft,
|
||||
/* 11 18 */ XK_0, XK_parenright,
|
||||
/* 12 19 */ XK_minus, XK_underscore,
|
||||
/* 13 20 */ XK_equal, XK_plus,
|
||||
/* 14 21 */ XK_BackSpace, NoSymbol,
|
||||
/* 15 22 */ XK_Tab, NoSymbol,
|
||||
/* 16 23 */ XK_Q, NoSymbol,
|
||||
/* 17 24 */ XK_W, NoSymbol,
|
||||
/* 18 25 */ XK_E, NoSymbol,
|
||||
/* 19 26 */ XK_R, NoSymbol,
|
||||
/* 20 27 */ XK_T, NoSymbol,
|
||||
/* 21 28 */ XK_Y, NoSymbol,
|
||||
/* 22 29 */ XK_U, NoSymbol,
|
||||
/* 23 30 */ XK_I, NoSymbol,
|
||||
/* 24 31 */ XK_O, NoSymbol,
|
||||
/* 25 32 */ XK_P, NoSymbol,
|
||||
/* 26 33 */ XK_bracketleft, XK_braceleft,
|
||||
/* 27 34 */ XK_bracketright, XK_braceright,
|
||||
/* 28 35 */ XK_Return, NoSymbol,
|
||||
/* 29 36 */ XK_Control_L, NoSymbol,
|
||||
/* 30 37 */ XK_A, NoSymbol,
|
||||
/* 31 38 */ XK_S, NoSymbol,
|
||||
/* 32 39 */ XK_D, NoSymbol,
|
||||
/* 33 40 */ XK_F, NoSymbol,
|
||||
/* 34 41 */ XK_G, NoSymbol,
|
||||
/* 35 42 */ XK_H, NoSymbol,
|
||||
/* 36 43 */ XK_J, NoSymbol,
|
||||
/* 37 44 */ XK_K, NoSymbol,
|
||||
/* 38 45 */ XK_L, NoSymbol,
|
||||
/* 39 46 */ XK_semicolon, XK_colon,
|
||||
/* 40 47 */ XK_apostrophe, XK_quotedbl,
|
||||
/* 41 48 */ XK_grave, XK_asciitilde,
|
||||
/* 42 49 */ XK_Shift_L, NoSymbol,
|
||||
/* 43 50 */ XK_backslash, XK_bar,
|
||||
/* 44 51 */ XK_Z, NoSymbol,
|
||||
/* 45 52 */ XK_X, NoSymbol,
|
||||
/* 46 53 */ XK_C, NoSymbol,
|
||||
/* 47 54 */ XK_V, NoSymbol,
|
||||
/* 48 55 */ XK_B, NoSymbol,
|
||||
/* 49 56 */ XK_N, NoSymbol,
|
||||
/* 50 57 */ XK_M, NoSymbol,
|
||||
/* 51 58 */ XK_comma, XK_less,
|
||||
/* 52 59 */ XK_period, XK_greater,
|
||||
/* 53 60 */ XK_slash, XK_question,
|
||||
/* 54 61 */ XK_Shift_R, NoSymbol,
|
||||
/* 55 62 */ XK_KP_Multiply, NoSymbol,
|
||||
/* 56 63 */ XK_Alt_L, XK_Meta_L,
|
||||
/* 57 64 */ XK_space, NoSymbol,
|
||||
/* 58 65 */ XK_Caps_Lock, NoSymbol,
|
||||
/* 59 66 */ XK_F1, NoSymbol,
|
||||
/* 60 67 */ XK_F2, NoSymbol,
|
||||
/* 61 68 */ XK_F3, NoSymbol,
|
||||
/* 62 69 */ XK_F4, NoSymbol,
|
||||
/* 63 70 */ XK_F5, NoSymbol,
|
||||
/* 64 71 */ XK_F6, NoSymbol,
|
||||
/* 65 72 */ XK_F7, NoSymbol,
|
||||
/* 66 73 */ XK_F8, NoSymbol,
|
||||
/* 67 74 */ XK_F9, NoSymbol,
|
||||
/* 68 75 */ XK_F10, NoSymbol,
|
||||
/* 69 76 */ XK_Break, XK_Pause,
|
||||
/* 70 77 */ XK_Scroll_Lock, NoSymbol,
|
||||
/* 71 78 */ XK_KP_Home, XK_KP_7,
|
||||
/* 72 79 */ XK_KP_Up, XK_KP_8,
|
||||
/* 73 80 */ XK_KP_Page_Up, XK_KP_9,
|
||||
/* 74 81 */ XK_KP_Subtract, NoSymbol,
|
||||
/* 75 82 */ XK_KP_Left, XK_KP_4,
|
||||
/* 76 83 */ XK_KP_5, NoSymbol,
|
||||
/* 77 84 */ XK_KP_Right, XK_KP_6,
|
||||
/* 78 85 */ XK_KP_Add, NoSymbol,
|
||||
/* 79 86 */ XK_KP_End, XK_KP_1,
|
||||
/* 80 87 */ XK_KP_Down, XK_KP_2,
|
||||
/* 81 88 */ XK_KP_Page_Down, XK_KP_3,
|
||||
/* 82 89 */ XK_KP_Insert, XK_KP_0,
|
||||
/* 83 90 */ XK_KP_Delete, XK_KP_Decimal,
|
||||
/* 84 91 */ NoSymbol, NoSymbol,
|
||||
/* 85 92 */ NoSymbol, NoSymbol,
|
||||
/* 86 93 */ NoSymbol, NoSymbol,
|
||||
/* 87 94 */ XK_F11, NoSymbol,
|
||||
/* 88 95 */ XK_F12, NoSymbol,
|
||||
|
||||
/* These are remapped from the extended set (using ExtendMap) */
|
||||
|
||||
/* 89 96 */ XK_Control_R, NoSymbol,
|
||||
/* 90 97 */ XK_KP_Enter, NoSymbol,
|
||||
/* 91 98 */ XK_KP_Divide, NoSymbol,
|
||||
/* 92 99 */ XK_Sys_Req, XK_Print,
|
||||
/* 93 100 */ XK_Alt_R, XK_Meta_R,
|
||||
/* 94 101 */ XK_Num_Lock, NoSymbol,
|
||||
/* 95 102 */ XK_Home, NoSymbol,
|
||||
/* 96 103 */ XK_Up, NoSymbol,
|
||||
/* 97 104 */ XK_Page_Up, NoSymbol,
|
||||
/* 98 105 */ XK_Left, NoSymbol,
|
||||
/* 99 106 */ XK_Right, NoSymbol,
|
||||
/* 100 107 */ XK_End, NoSymbol,
|
||||
/* 101 108 */ XK_Down, NoSymbol,
|
||||
/* 102 109 */ XK_Page_Down, NoSymbol,
|
||||
/* 103 110 */ XK_Insert, NoSymbol,
|
||||
/* 104 111 */ XK_Delete, NoSymbol,
|
||||
/* 105 112 */ XK_Super_L, NoSymbol,
|
||||
/* 106 113 */ XK_Super_R, NoSymbol,
|
||||
/* 107 114 */ XK_Menu, NoSymbol,
|
||||
/* 108 115 */ NoSymbol, NoSymbol,
|
||||
/* 109 116 */ NoSymbol, NoSymbol,
|
||||
/* 110 117 */ NoSymbol, NoSymbol,
|
||||
/* 111 118 */ NoSymbol, NoSymbol,
|
||||
/* 112 119 */ NoSymbol, NoSymbol,
|
||||
};
|
||||
|
||||
static void
|
||||
EvdevRead1 (int evdevPort, void *closure)
|
||||
{
|
||||
int i, n, xk;
|
||||
struct input_event events[NUM_EVENTS];
|
||||
|
||||
n = read (evdevPort, &events, NUM_EVENTS * sizeof (struct input_event));
|
||||
if (n <= 0)
|
||||
return;
|
||||
n /= sizeof (struct input_event);
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
switch (events[i].type) {
|
||||
case EV_SYN:
|
||||
break;
|
||||
case EV_KEY:
|
||||
xk = events[i].code;
|
||||
if (events[i].code < 0x100)
|
||||
ErrorF ("key %d %d xk %d\n", events[i].code, events[i].value, xk);
|
||||
else
|
||||
ErrorF ("key 0x%x %d xk %d\n", events[i].code, events[i].value, xk);
|
||||
if (events[i].value == 2) {
|
||||
//KdEnqueueKeyboardEvent (xk, 0);
|
||||
KdEnqueueKeyboardEvent (xk, 0);
|
||||
} else
|
||||
KdEnqueueKeyboardEvent (xk, !events[i].value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char *kdefaultEvdev1[] = {
|
||||
"/dev/input/event0",
|
||||
// "/dev/input/event1",
|
||||
// "/dev/input/event2",
|
||||
// "/dev/input/event3",
|
||||
// "/dev/input/event4",
|
||||
// "/dev/input/event5",
|
||||
};
|
||||
|
||||
#define NUM_DEFAULT_EVDEV1 (sizeof (kdefaultEvdev1) / sizeof (kdefaultEvdev1[0]))
|
||||
|
||||
static Bool
|
||||
EvdevKbdInit (void)
|
||||
{
|
||||
int i;
|
||||
int fd;
|
||||
int n = 0;
|
||||
char name[100];
|
||||
|
||||
if (!EvdevInputType)
|
||||
EvdevInputType = KdAllocInputType ();
|
||||
|
||||
for (i = 0; i < NUM_DEFAULT_EVDEV; i++)
|
||||
{
|
||||
fd = open (kdefaultEvdev1[i], 2);
|
||||
if (fd >= 0)
|
||||
{
|
||||
ioctl(fd, EVIOCGRAB, 1);
|
||||
|
||||
ioctl(fd, EVIOCGNAME(sizeof(name)), name);
|
||||
ErrorF("Name is %s\n", name);
|
||||
ioctl(fd, EVIOCGPHYS(sizeof(name)), name);
|
||||
ErrorF("Phys Loc is %s\n", name);
|
||||
ioctl(fd, EVIOCGUNIQ(sizeof(name)), name);
|
||||
ErrorF("Unique is %s\n", name);
|
||||
|
||||
}
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
unsigned long ev[NBITS(EV_MAX)];
|
||||
Kevdev *ke;
|
||||
|
||||
if (ioctl (fd, EVIOCGBIT(0 /*EV*/, sizeof (ev)), ev) < 0)
|
||||
{
|
||||
perror ("EVIOCGBIT 0");
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
ke = xalloc (sizeof (Kevdev));
|
||||
if (!ke)
|
||||
{
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
memset (ke, '\0', sizeof (Kevdev));
|
||||
if (ISBITSET (ev, EV_KEY))
|
||||
{
|
||||
if (ioctl (fd, EVIOCGBIT (EV_KEY, sizeof (ke->keybits)),
|
||||
ke->keybits) < 0)
|
||||
{
|
||||
perror ("EVIOCGBIT EV_KEY");
|
||||
xfree (ke);
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (ISBITSET (ev, EV_REL))
|
||||
{
|
||||
if (ioctl (fd, EVIOCGBIT (EV_REL, sizeof (ke->relbits)),
|
||||
ke->relbits) < 0)
|
||||
{
|
||||
perror ("EVIOCGBIT EV_REL");
|
||||
xfree (ke);
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
for (ke->max_rel = REL_MAX; ke->max_rel >= 0; ke->max_rel--)
|
||||
if (ISBITSET(ke->relbits, ke->max_rel))
|
||||
break;
|
||||
}
|
||||
if (ISBITSET (ev, EV_ABS))
|
||||
{
|
||||
int i;
|
||||
|
||||
if (ioctl (fd, EVIOCGBIT (EV_ABS, sizeof (ke->absbits)),
|
||||
ke->absbits) < 0)
|
||||
{
|
||||
perror ("EVIOCGBIT EV_ABS");
|
||||
xfree (ke);
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
for (ke->max_abs = ABS_MAX; ke->max_abs >= 0; ke->max_abs--)
|
||||
if (ISBITSET(ke->absbits, ke->max_abs))
|
||||
break;
|
||||
for (i = 0; i <= ke->max_abs; i++)
|
||||
{
|
||||
if (ISBITSET (ke->absbits, i))
|
||||
if (ioctl (fd, EVIOCGABS(i), &ke->absinfo[i]) < 0)
|
||||
{
|
||||
perror ("EVIOCGABS");
|
||||
break;
|
||||
}
|
||||
ke->prevabs[i] = ABS_UNSET;
|
||||
}
|
||||
if (i <= ke->max_abs)
|
||||
{
|
||||
xfree (ke);
|
||||
close (fd);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (KdRegisterFd (EvdevInputType, fd, EvdevRead1, NULL))
|
||||
n++;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void EvdevKbdLoad(void)
|
||||
{
|
||||
kdMinScanCode = 1;
|
||||
kdMaxScanCode = 112;
|
||||
kdKeymapWidth = 2;
|
||||
memcpy (kdKeymap, evdevKeymap, sizeof (evdevKeymap));
|
||||
}
|
||||
|
||||
static void
|
||||
EvdevKbdFini (void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
EvdevKbdLeds (int leds)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static void EvdevKbdBell(int volume, int pitch, int duration)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
KdKeyboardFuncs LinuxEvdevKeyboardFuncs = {
|
||||
EvdevKbdLoad,
|
||||
EvdevKbdInit,
|
||||
EvdevKbdLeds,
|
||||
EvdevKbdBell,
|
||||
EvdevKbdFini,
|
||||
0,
|
||||
};
|
||||
1670
hw/xgl/egl/kinput.c
1670
hw/xgl/egl/kinput.c
File diff suppressed because it is too large
Load diff
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
* Copyright 1999 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.
|
||||
*/
|
||||
/*
|
||||
* All global variables and functions pertaining to keyboard key mapping
|
||||
* live in this header file.
|
||||
*/
|
||||
|
||||
#ifndef _KKEYMAP_H
|
||||
#define _KKEYMAP_H
|
||||
|
||||
/* Offset of MIN_SCANCODE to 8 (X minimum scancode value) */
|
||||
#define KD_KEY_OFFSET (8 - kdMinScanCode)
|
||||
|
||||
#define KD_MIN_KEYCODE 8
|
||||
#define KD_MAX_KEYCODE 254
|
||||
#define KD_MAX_WIDTH 4
|
||||
#define KD_MAX_LENGTH (KD_MAX_KEYCODE - KD_MIN_KEYCODE + 1)
|
||||
|
||||
extern int kdMinScanCode;
|
||||
extern int kdMaxScanCode;
|
||||
extern int kdMinKeyCode;
|
||||
extern int kdMaxKeyCode;
|
||||
extern int kdKeymapWidth;
|
||||
|
||||
extern KeySym kdKeymap[KD_MAX_LENGTH * KD_MAX_WIDTH];
|
||||
|
||||
extern CARD8 kdModMap[MAP_LENGTH];
|
||||
|
||||
extern KeySymsRec kdKeySyms;
|
||||
|
||||
typedef struct {
|
||||
KeySym modsym;
|
||||
int modbit;
|
||||
} KdKeySymModsRec;
|
||||
|
||||
#endif /* _KKEYMAP_H */
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
AM_CFLAGS = \
|
||||
$(DIX_CFLAGS) \
|
||||
-I$(srcdir)/.. \
|
||||
-I$(srcdir)/../.. \
|
||||
$(XEGLMODULES_CFLAGS)
|
||||
|
||||
libxegl_la_LDFLAGS = -avoid-version
|
||||
libxegl_la_SOURCES = xeglmodule.c
|
||||
libxegl_la_LIBADD = \
|
||||
$(top_builddir)/hw/xgl/glx/libxegl.la \
|
||||
$(XEGLMODULES_LIBS)
|
||||
|
||||
moduledir = @xglmoduledir@
|
||||
|
||||
module_LTLIBRARIES = libxegl.la
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#include "xglmodule.h"
|
||||
#include "xegl.h"
|
||||
|
||||
#include <glitz-egl.h>
|
||||
|
||||
char *
|
||||
moduleVersion (void)
|
||||
{
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
Bool
|
||||
moduleInit (const char *module)
|
||||
{
|
||||
glitz_egl_init (module);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
InitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
xeglInitOutput (pScreenInfo, argc, argv);
|
||||
}
|
||||
|
||||
Bool
|
||||
LegalModifier (unsigned int key,
|
||||
DeviceIntPtr pDev)
|
||||
{
|
||||
return xeglLegalModifier (key, pDev);
|
||||
}
|
||||
|
||||
void
|
||||
ProcessInputEvents (void)
|
||||
{
|
||||
xeglProcessInputEvents ();
|
||||
}
|
||||
|
||||
void
|
||||
InitInput (int argc,
|
||||
char **argv)
|
||||
{
|
||||
xeglInitInput (argc, argv);
|
||||
}
|
||||
|
||||
void
|
||||
ddxUseMsg (void)
|
||||
{
|
||||
ErrorF ("\nXegl usage:\n");
|
||||
xeglUseMsg ();
|
||||
}
|
||||
|
||||
int
|
||||
ddxProcessArgument (int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
return xeglProcessArgument (argc, argv, i);
|
||||
}
|
||||
|
||||
void
|
||||
AbortDDX (void)
|
||||
{
|
||||
xeglAbort ();
|
||||
}
|
||||
|
||||
void
|
||||
ddxGiveUp (void)
|
||||
{
|
||||
xeglGiveUp ();
|
||||
}
|
||||
|
||||
void
|
||||
OsVendorInit (void)
|
||||
{
|
||||
xeglOsVendorInit ();
|
||||
}
|
||||
|
|
@ -1,303 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2004 David Reveman
|
||||
*
|
||||
* 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
|
||||
* David Reveman not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* David Reveman makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* DAVID REVEMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL DAVID REVEMAN 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <glitz-egl.h>
|
||||
|
||||
#include "inputstr.h"
|
||||
#include "cursorstr.h"
|
||||
#include "mipointer.h"
|
||||
|
||||
#include "xegl.h"
|
||||
|
||||
#define XEGL_DEFAULT_SCREEN_WIDTH 800
|
||||
#define XEGL_DEFAULT_SCREEN_HEIGHT 600
|
||||
|
||||
DevPrivateKey xeglScreenPrivateKey = &xeglScreenPrivateKey;
|
||||
|
||||
#define XEGL_GET_SCREEN_PRIV(pScreen) ((xeglScreenPtr) \
|
||||
dixLookupPrivate(&(pScreen)->devPrivates, xeglScreenPrivateKey))
|
||||
|
||||
#define XEGL_SET_SCREEN_PRIV(pScreen, v) \
|
||||
dixSetPrivate(&(pScreen)->devPrivates, xeglScreenPrivateKey, v)
|
||||
|
||||
#define XEGL_SCREEN_PRIV(pScreen) \
|
||||
xeglScreenPtr pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen)
|
||||
|
||||
static EGLDisplay eDisplay;
|
||||
static EGLScreenMESA eScreen;
|
||||
static ScreenPtr currentScreen = 0;
|
||||
static Bool softCursor = TRUE;
|
||||
|
||||
extern miPointerScreenFuncRec kdPointerScreenFuncs;
|
||||
|
||||
static Bool
|
||||
xeglAllocatePrivates (ScreenPtr pScreen)
|
||||
{
|
||||
xeglScreenPtr pScreenPriv;
|
||||
|
||||
pScreenPriv = xalloc (sizeof (xeglScreenRec));
|
||||
if (!pScreenPriv)
|
||||
return FALSE;
|
||||
|
||||
XEGL_SET_SCREEN_PRIV (pScreen, pScreenPriv);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
xeglCloseScreen (int index,
|
||||
ScreenPtr pScreen)
|
||||
{
|
||||
glitz_drawable_t *drawable;
|
||||
|
||||
XEGL_SCREEN_PRIV (pScreen);
|
||||
|
||||
drawable = XGL_GET_SCREEN_PRIV (pScreen)->drawable;
|
||||
if (drawable)
|
||||
glitz_drawable_destroy (drawable);
|
||||
|
||||
xglClearVisualTypes ();
|
||||
|
||||
XGL_SCREEN_UNWRAP (CloseScreen);
|
||||
xfree (pScreenPriv);
|
||||
|
||||
return (*pScreen->CloseScreen) (index, pScreen);
|
||||
}
|
||||
|
||||
static Bool
|
||||
xeglScreenInit (int index,
|
||||
ScreenPtr pScreen,
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
EGLSurface eSurface;
|
||||
EGLModeMESA mode;
|
||||
int count;
|
||||
xeglScreenPtr pScreenPriv;
|
||||
glitz_drawable_format_t *format;
|
||||
glitz_drawable_t *drawable;
|
||||
EGLint screenAttribs[] = {
|
||||
EGL_WIDTH, 1024,
|
||||
EGL_HEIGHT, 768,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
if (xglScreenInfo.width == 0 || xglScreenInfo.height == 0)
|
||||
{
|
||||
xglScreenInfo.width = XEGL_DEFAULT_SCREEN_WIDTH;
|
||||
xglScreenInfo.height = XEGL_DEFAULT_SCREEN_HEIGHT;
|
||||
|
||||
}
|
||||
|
||||
screenAttribs[1] = xglScreenInfo.width;
|
||||
screenAttribs[3] = xglScreenInfo.height;
|
||||
|
||||
format = xglVisuals[0].format;
|
||||
|
||||
if (!xeglAllocatePrivates (pScreen))
|
||||
return FALSE;
|
||||
|
||||
currentScreen = pScreen;
|
||||
|
||||
pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen);
|
||||
|
||||
if (xglScreenInfo.width == 0 || xglScreenInfo.height == 0)
|
||||
{
|
||||
xglScreenInfo.width = XEGL_DEFAULT_SCREEN_WIDTH;
|
||||
xglScreenInfo.height = XEGL_DEFAULT_SCREEN_HEIGHT;
|
||||
}
|
||||
|
||||
eglGetModesMESA (eDisplay, eScreen, &mode, 1, &count);
|
||||
|
||||
eSurface = eglCreateScreenSurfaceMESA (eDisplay, format->id, screenAttribs);
|
||||
if (eSurface == EGL_NO_SURFACE)
|
||||
{
|
||||
ErrorF ("failed to create screen surface\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
eglShowScreenSurfaceMESA (eDisplay, eScreen, eSurface, mode);
|
||||
|
||||
drawable = glitz_egl_create_surface (eDisplay, eScreen, format, eSurface,
|
||||
xglScreenInfo.width,
|
||||
xglScreenInfo.height);
|
||||
if (!drawable)
|
||||
{
|
||||
ErrorF ("[%d] couldn't create glitz drawable for window\n", index);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
xglScreenInfo.drawable = drawable;
|
||||
|
||||
if (!xglScreenInit (pScreen))
|
||||
return FALSE;
|
||||
|
||||
#ifdef GLXEXT
|
||||
if (!xglInitVisualConfigs (pScreen))
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
XGL_SCREEN_WRAP (CloseScreen, xeglCloseScreen);
|
||||
|
||||
miDCInitialize (pScreen, &kdPointerScreenFuncs);
|
||||
miCreateDefColormap(pScreen);
|
||||
|
||||
if (!xglFinishScreenInit (pScreen))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
xeglInitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
glitz_drawable_format_t *format, templ;
|
||||
int i, maj, min, count;
|
||||
unsigned long mask;
|
||||
|
||||
xglSetPixmapFormats (pScreenInfo);
|
||||
|
||||
if (!eDisplay)
|
||||
{
|
||||
eDisplay = eglGetDisplay (":0");
|
||||
|
||||
if (!eglInitialize (eDisplay, &maj, &min))
|
||||
FatalError ("can't open display");
|
||||
|
||||
eglGetScreensMESA (eDisplay, &eScreen, 1, &count);
|
||||
}
|
||||
|
||||
templ.samples = 1;
|
||||
templ.doublebuffer = 1;
|
||||
templ.color.alpha_size = 8;
|
||||
|
||||
mask = GLITZ_FORMAT_SAMPLES_MASK;
|
||||
|
||||
format = glitz_egl_find_window_config (eDisplay, eScreen,
|
||||
mask, &templ, 0);
|
||||
|
||||
if (!format)
|
||||
FatalError ("no visual format found");
|
||||
|
||||
xglSetVisualTypesAndMasks (pScreenInfo, format, (1 << TrueColor));
|
||||
|
||||
xglInitVisuals (pScreenInfo);
|
||||
|
||||
AddScreen (xeglScreenInit, argc, argv);
|
||||
}
|
||||
|
||||
static void
|
||||
xeglBlockHandler (pointer blockData,
|
||||
OSTimePtr pTimeout,
|
||||
pointer pReadMask)
|
||||
{
|
||||
XGL_SCREEN_PRIV (currentScreen);
|
||||
|
||||
if (!xglSyncSurface (&pScreenPriv->pScreenPixmap->drawable))
|
||||
FatalError (XGL_SW_FAILURE_STRING);
|
||||
|
||||
glitz_surface_flush (pScreenPriv->surface);
|
||||
glitz_drawable_finish (pScreenPriv->drawable);
|
||||
}
|
||||
|
||||
void
|
||||
xeglInitInput (int argc,
|
||||
char **argv)
|
||||
{
|
||||
eglInitInput (&LinuxEvdevMouseFuncs, &LinuxEvdevKeyboardFuncs);
|
||||
RegisterBlockAndWakeupHandlers (xeglBlockHandler, KdWakeupHandler, NULL);
|
||||
}
|
||||
|
||||
Bool
|
||||
xeglLegalModifier (unsigned int key,
|
||||
DeviceIntPtr pDev)
|
||||
{
|
||||
return KdLegalModifier (key, pDev);
|
||||
}
|
||||
|
||||
void
|
||||
xeglProcessInputEvents (void)
|
||||
{
|
||||
KdProcessInputEvents ();
|
||||
}
|
||||
|
||||
void
|
||||
xeglUseMsg (void)
|
||||
{
|
||||
ErrorF ("-screen WIDTH[/WIDTHMM]xHEIGHT[/HEIGHTMM] "
|
||||
"specify screen characteristics\n");
|
||||
ErrorF ("-softcursor force software cursor\n");
|
||||
}
|
||||
|
||||
int
|
||||
xeglProcessArgument (int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
if (!strcmp (argv[i], "-screen"))
|
||||
{
|
||||
if ((i + 1) < argc)
|
||||
{
|
||||
xglParseScreen (argv[i + 1]);
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
|
||||
return 2;
|
||||
}
|
||||
else if (!strcmp (argv[i], "-softcursor"))
|
||||
{
|
||||
softCursor = TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
xeglAbort (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
xeglGiveUp (void)
|
||||
{
|
||||
AbortDDX ();
|
||||
}
|
||||
|
||||
void
|
||||
xeglOsVendorInit (void)
|
||||
{
|
||||
}
|
||||
|
|
@ -1,214 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#ifndef _XEGL_H_
|
||||
#define _XEGL_H_
|
||||
|
||||
#include "xgl.h"
|
||||
|
||||
#include "randrstr.h"
|
||||
|
||||
#define KD_BUTTON_1 0x01
|
||||
#define KD_BUTTON_2 0x02
|
||||
#define KD_BUTTON_3 0x04
|
||||
#define KD_BUTTON_4 0x08
|
||||
#define KD_BUTTON_5 0x10
|
||||
#define KD_MOUSE_DELTA 0x80000000
|
||||
|
||||
typedef struct _KdMouseFuncs {
|
||||
Bool (*Init) (void);
|
||||
void (*Fini) (void);
|
||||
} KdMouseFuncs;
|
||||
|
||||
typedef struct _KdKeyboardFuncs {
|
||||
void (*Load) (void);
|
||||
int (*Init) (void);
|
||||
void (*Leds) (int);
|
||||
void (*Bell) (int, int, int);
|
||||
void (*Fini) (void);
|
||||
int LockLed;
|
||||
} KdKeyboardFuncs;
|
||||
|
||||
typedef struct _KdOsFuncs {
|
||||
int (*Init) (void);
|
||||
void (*Enable) (void);
|
||||
Bool (*SpecialKey) (KeySym);
|
||||
void (*Disable) (void);
|
||||
void (*Fini) (void);
|
||||
void (*pollEvents) (void);
|
||||
} KdOsFuncs;
|
||||
|
||||
typedef struct _KdMouseMatrix {
|
||||
int matrix[2][3];
|
||||
} KdMouseMatrix;
|
||||
|
||||
typedef enum _KdMouseState {
|
||||
start,
|
||||
button_1_pend,
|
||||
button_1_down,
|
||||
button_2_down,
|
||||
button_3_pend,
|
||||
button_3_down,
|
||||
synth_2_down_13,
|
||||
synth_2_down_3,
|
||||
synth_2_down_1,
|
||||
num_input_states
|
||||
} KdMouseState;
|
||||
|
||||
#define KD_MAX_BUTTON 7
|
||||
|
||||
typedef struct _KdMouseInfo {
|
||||
struct _KdMouseInfo *next;
|
||||
void *driver;
|
||||
void *closure;
|
||||
char *name;
|
||||
char *prot;
|
||||
char map[KD_MAX_BUTTON];
|
||||
int nbutton;
|
||||
Bool emulateMiddleButton;
|
||||
unsigned long emulationTimeout;
|
||||
Bool timeoutPending;
|
||||
KdMouseState mouseState;
|
||||
Bool eventHeld;
|
||||
xEvent heldEvent;
|
||||
unsigned char buttonState;
|
||||
int emulationDx, emulationDy;
|
||||
int inputType;
|
||||
Bool transformCoordinates;
|
||||
} KdMouseInfo;
|
||||
|
||||
typedef struct _xeglScreen {
|
||||
CloseScreenProcPtr CloseScreen;
|
||||
ScreenPtr pScreen;
|
||||
DDXPointRec origin;
|
||||
} xeglScreenRec, *xeglScreenPtr;
|
||||
|
||||
extern KdMouseInfo *kdMouseInfo;
|
||||
extern KdOsFuncs *kdOsFuncs;
|
||||
extern Bool kdDontZap;
|
||||
extern Bool kdDisableZaphod;
|
||||
extern DevPrivateKey xeglScreenPrivateKey;
|
||||
extern KdMouseFuncs LinuxEvdevMouseFuncs;
|
||||
extern KdKeyboardFuncs LinuxEvdevKeyboardFuncs;
|
||||
|
||||
#define RR_Rotate_All \
|
||||
(RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270)
|
||||
#define RR_Reflect_All (RR_Reflect_X | RR_Reflect_Y)
|
||||
|
||||
#define KdGetScreenPriv(pScreen) ((xeglScreenPtr) \
|
||||
dixLookupPrivate(&(pScreen)->devPrivates, xeglScreenPrivateKey))
|
||||
#define KdScreenPriv(pScreen) \
|
||||
xeglScreenPtr pScreenPriv = KdGetScreenPriv (pScreen)
|
||||
|
||||
void
|
||||
eglInitInput (KdMouseFuncs *pMouseFuncs,
|
||||
KdKeyboardFuncs *pKeyboardFuncs);
|
||||
|
||||
void
|
||||
KdParseMouse (char *arg);
|
||||
|
||||
KdMouseInfo *
|
||||
KdMouseInfoAdd (void);
|
||||
|
||||
void
|
||||
KdMouseInfoDispose (KdMouseInfo *mi);
|
||||
|
||||
int
|
||||
KdAllocInputType (void);
|
||||
|
||||
char *
|
||||
KdSaveString (char *str);
|
||||
|
||||
Bool
|
||||
KdRegisterFd (int type,
|
||||
int fd,
|
||||
void (*read) (int fd, void *closure),
|
||||
void *closure);
|
||||
|
||||
void
|
||||
KdUnregisterFds (int type,
|
||||
Bool do_close);
|
||||
|
||||
void
|
||||
KdEnqueueKeyboardEvent (unsigned char scan_code,
|
||||
unsigned char is_up);
|
||||
|
||||
void
|
||||
KdEnqueueMouseEvent (KdMouseInfo *mi,
|
||||
unsigned long flags,
|
||||
int rx,
|
||||
int ry);
|
||||
|
||||
void
|
||||
KdRegisterFdEnableDisable (int fd,
|
||||
int (*enable) (int fd, void *closure),
|
||||
void (*disable) (int fd, void *closure));
|
||||
|
||||
void
|
||||
KdWakeupHandler (pointer data,
|
||||
int result,
|
||||
pointer readmask);
|
||||
|
||||
Bool
|
||||
KdLegalModifier (unsigned int key,
|
||||
DeviceIntPtr pDev);
|
||||
|
||||
void
|
||||
KdProcessInputEvents (void);
|
||||
|
||||
void
|
||||
xeglInitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv);
|
||||
|
||||
Bool
|
||||
xeglLegalModifier (unsigned int key,
|
||||
DevicePtr pDev);
|
||||
|
||||
void
|
||||
xeglProcessInputEvents (void);
|
||||
|
||||
void
|
||||
xeglInitInput (int argc,
|
||||
char **argv);
|
||||
|
||||
void
|
||||
xeglUseMsg (void);
|
||||
|
||||
int
|
||||
xeglProcessArgument (int argc,
|
||||
char **argv,
|
||||
int i);
|
||||
|
||||
void
|
||||
xeglAbort (void);
|
||||
|
||||
void
|
||||
xeglGiveUp (void);
|
||||
|
||||
void
|
||||
xeglOsVendorInit (void);
|
||||
|
||||
#endif /* _XEGL_H_ */
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
#include "xgl.h"
|
||||
#include "xegl.h"
|
||||
|
||||
KdOsFuncs *kdOsFuncs;
|
||||
Bool kdEmulateMiddleButton;
|
||||
Bool kdRawPointerCoordinates;
|
||||
Bool kdDontZap;
|
||||
Bool kdDisableZaphod;
|
||||
int kdScreenPrivateIndex;
|
||||
|
||||
static char *
|
||||
KdParseFindNext (char *cur, char *delim, char *save, char *last)
|
||||
{
|
||||
while (*cur && !strchr (delim, *cur))
|
||||
{
|
||||
*save++ = *cur++;
|
||||
}
|
||||
*save = 0;
|
||||
*last = *cur;
|
||||
if (*cur)
|
||||
cur++;
|
||||
return cur;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mouse argument syntax:
|
||||
*
|
||||
* device,protocol,options...
|
||||
*
|
||||
* Options are any of:
|
||||
* 1-5 n button mouse
|
||||
* 2button emulate middle button
|
||||
* {NMO} Reorder buttons
|
||||
*/
|
||||
char *
|
||||
KdSaveString (char *str)
|
||||
{
|
||||
char *n = (char *) xalloc (strlen (str) + 1);
|
||||
|
||||
if (!n)
|
||||
return 0;
|
||||
strcpy (n, str);
|
||||
return n;
|
||||
}
|
||||
|
||||
/*
|
||||
* Parse mouse information. Syntax:
|
||||
*
|
||||
* <device>,<nbutton>,<protocol>{,<option>}...
|
||||
*
|
||||
* options: {nmo} pointer mapping (e.g. {321})
|
||||
* 2button emulate middle button
|
||||
* 3button dont emulate middle button
|
||||
*/
|
||||
void
|
||||
KdParseMouse (char *arg)
|
||||
{
|
||||
char save[1024];
|
||||
char delim;
|
||||
KdMouseInfo *mi;
|
||||
int i;
|
||||
|
||||
mi = KdMouseInfoAdd ();
|
||||
if (!mi)
|
||||
return;
|
||||
mi->name = 0;
|
||||
mi->prot = 0;
|
||||
mi->emulateMiddleButton = kdEmulateMiddleButton;
|
||||
mi->transformCoordinates = !kdRawPointerCoordinates;
|
||||
mi->nbutton = 3;
|
||||
for (i = 0; i < KD_MAX_BUTTON; i++)
|
||||
mi->map[i] = i + 1;
|
||||
|
||||
if (!arg)
|
||||
return;
|
||||
if (strlen (arg) >= sizeof (save))
|
||||
return;
|
||||
arg = KdParseFindNext (arg, ",", save, &delim);
|
||||
if (!save[0])
|
||||
return;
|
||||
mi->name = KdSaveString (save);
|
||||
if (delim != ',')
|
||||
return;
|
||||
|
||||
arg = KdParseFindNext (arg, ",", save, &delim);
|
||||
if (!save[0])
|
||||
return;
|
||||
|
||||
if ('1' <= save[0] && save[0] <= '0' + KD_MAX_BUTTON && save[1] == '\0')
|
||||
{
|
||||
mi->nbutton = save[0] - '0';
|
||||
if (mi->nbutton > KD_MAX_BUTTON)
|
||||
{
|
||||
UseMsg ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!delim != ',')
|
||||
return;
|
||||
|
||||
arg = KdParseFindNext (arg, ",", save, &delim);
|
||||
|
||||
if (save[0])
|
||||
mi->prot = KdSaveString (save);
|
||||
|
||||
while (delim == ',')
|
||||
{
|
||||
arg = KdParseFindNext (arg, ",", save, &delim);
|
||||
if (save[0] == '{')
|
||||
{
|
||||
char *s = save + 1;
|
||||
i = 0;
|
||||
while (*s && *s != '}')
|
||||
{
|
||||
if ('1' <= *s && *s <= '0' + mi->nbutton)
|
||||
mi->map[i] = *s - '0';
|
||||
else
|
||||
UseMsg ();
|
||||
s++;
|
||||
}
|
||||
}
|
||||
else if (!strcmp (save, "2button"))
|
||||
mi->emulateMiddleButton = TRUE;
|
||||
else if (!strcmp (save, "3button"))
|
||||
mi->emulateMiddleButton = FALSE;
|
||||
else if (!strcmp (save, "rawcoord"))
|
||||
mi->transformCoordinates = FALSE;
|
||||
else if (!strcmp (save, "transform"))
|
||||
mi->transformCoordinates = TRUE;
|
||||
else
|
||||
UseMsg ();
|
||||
}
|
||||
}
|
||||
|
||||
KdMouseInfo *kdMouseInfo;
|
||||
|
||||
KdMouseInfo *
|
||||
KdMouseInfoAdd (void)
|
||||
{
|
||||
KdMouseInfo *mi, **prev;
|
||||
|
||||
mi = (KdMouseInfo *) xalloc (sizeof (KdMouseInfo));
|
||||
if (!mi)
|
||||
return 0;
|
||||
bzero (mi, sizeof (KdMouseInfo));
|
||||
for (prev = &kdMouseInfo; *prev; prev = &(*prev)->next);
|
||||
*prev = mi;
|
||||
return mi;
|
||||
}
|
||||
|
||||
void
|
||||
KdMouseInfoDispose (KdMouseInfo *mi)
|
||||
{
|
||||
KdMouseInfo **prev;
|
||||
|
||||
for (prev = &kdMouseInfo; *prev; prev = &(*prev)->next)
|
||||
if (*prev == mi)
|
||||
{
|
||||
*prev = mi->next;
|
||||
if (mi->name)
|
||||
xfree (mi->name);
|
||||
if (mi->prot)
|
||||
xfree (mi->prot);
|
||||
xfree (mi);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#include "xglx.h"
|
||||
#include "xglmodule.h"
|
||||
|
||||
#include <glitz-glx.h>
|
||||
|
||||
char *
|
||||
moduleVersion (void)
|
||||
{
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
Bool
|
||||
moduleInit (const char *module)
|
||||
{
|
||||
glitz_glx_init (module);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
InitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
xglxInitOutput (pScreenInfo, argc, argv);
|
||||
}
|
||||
|
||||
Bool
|
||||
LegalModifier (unsigned int key,
|
||||
DeviceIntPtr pDev)
|
||||
{
|
||||
return xglxLegalModifier (key, pDev);
|
||||
}
|
||||
|
||||
void
|
||||
ProcessInputEvents (void)
|
||||
{
|
||||
xglxProcessInputEvents ();
|
||||
}
|
||||
|
||||
void
|
||||
InitInput (int argc,
|
||||
char **argv)
|
||||
{
|
||||
xglxInitInput (argc, argv);
|
||||
}
|
||||
|
||||
void
|
||||
ddxUseMsg (void)
|
||||
{
|
||||
ErrorF ("\nXglx usage:\n");
|
||||
xglxUseMsg ();
|
||||
}
|
||||
|
||||
int
|
||||
ddxProcessArgument (int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
return xglxProcessArgument (argc, argv, i);
|
||||
}
|
||||
|
||||
void
|
||||
AbortDDX (void)
|
||||
{
|
||||
xglxAbort ();
|
||||
}
|
||||
|
||||
void
|
||||
ddxGiveUp (void)
|
||||
{
|
||||
xglxGiveUp ();
|
||||
}
|
||||
|
||||
void
|
||||
OsVendorInit (void)
|
||||
{
|
||||
xglxOsVendorInit ();
|
||||
}
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#ifndef _XGLX_H_
|
||||
#define _XGLX_H_
|
||||
|
||||
#include "xgl.h"
|
||||
|
||||
#ifdef _XSERVER64
|
||||
#define _XSERVER64_tmp
|
||||
#undef _XSERVER64
|
||||
typedef unsigned long XID64;
|
||||
typedef unsigned long Mask64;
|
||||
typedef unsigned long Atom64;
|
||||
typedef unsigned long VisualID64;
|
||||
typedef unsigned long Time64;
|
||||
#define XID XID64
|
||||
#define Mask Mask64
|
||||
#define Atom Atom64
|
||||
#define VisualID VisualID64
|
||||
#define Time Time64
|
||||
typedef XID Window64;
|
||||
typedef XID Drawable64;
|
||||
typedef XID Font64;
|
||||
typedef XID Pixmap64;
|
||||
typedef XID Cursor64;
|
||||
typedef XID Colormap64;
|
||||
typedef XID GContext64;
|
||||
typedef XID KeySym64;
|
||||
#define Window Window64
|
||||
#define Drawable Drawable64
|
||||
#define Font Font64
|
||||
#define Pixmap Pixmap64
|
||||
#define Cursor Cursor64
|
||||
#define Colormap Colormap64
|
||||
#define GContext GContext64
|
||||
#define KeySym KeySym64
|
||||
#endif
|
||||
|
||||
#define GC XlibGC
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#undef GC
|
||||
|
||||
#ifdef _XSERVER64_tmp
|
||||
#ifndef _XSERVER64
|
||||
#define _XSERVER64
|
||||
#endif
|
||||
#undef _XSERVER64_tmp
|
||||
#undef XID
|
||||
#undef Mask
|
||||
#undef Atom
|
||||
#undef VisualID
|
||||
#undef Time
|
||||
#undef Window
|
||||
#undef Drawable
|
||||
#undef Font
|
||||
#undef Pixmap
|
||||
#undef Cursor
|
||||
#undef Colormap
|
||||
#undef GContext
|
||||
#undef KeySym
|
||||
#endif
|
||||
|
||||
void
|
||||
xglxInitOutput (ScreenInfo *pScreenInfo,
|
||||
int argc,
|
||||
char **argv);
|
||||
|
||||
Bool
|
||||
xglxLegalModifier (unsigned int key,
|
||||
DeviceIntPtr pDev);
|
||||
|
||||
void
|
||||
xglxProcessInputEvents (void);
|
||||
|
||||
void
|
||||
xglxInitInput (int argc,
|
||||
char **argv);
|
||||
|
||||
void
|
||||
xglxUseMsg (void);
|
||||
|
||||
int
|
||||
xglxProcessArgument (int argc,
|
||||
char **argv,
|
||||
int i);
|
||||
|
||||
void
|
||||
xglxAbort (void);
|
||||
|
||||
void
|
||||
xglxGiveUp (void);
|
||||
|
||||
void
|
||||
xglxOsVendorInit (void);
|
||||
|
||||
#ifndef NXGLXORG
|
||||
|
||||
void
|
||||
xglxUseXorgMsg (void);
|
||||
|
||||
int
|
||||
xglxProcessXorgArgument (int argc,
|
||||
char **argv,
|
||||
int i);
|
||||
|
||||
void
|
||||
xglxAbortXorg (void);
|
||||
|
||||
char *
|
||||
xglxInitXorg (void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _XGLX_H_ */
|
||||
|
|
@ -1,674 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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.
|
||||
*
|
||||
* Authors: David Reveman <davidr@novell.com>
|
||||
* Matthias Hopf <mhopf@suse.de>
|
||||
*/
|
||||
|
||||
#include "xglx.h"
|
||||
|
||||
#ifndef NXGLXORG
|
||||
|
||||
#include <X11/Xauth.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <signal.h>
|
||||
#include <setjmp.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <libgen.h>
|
||||
|
||||
typedef void (*sighandler_t) (int);
|
||||
|
||||
#define XORG_DIE_TIMEOUT 3
|
||||
#define XORG_DEV_RANDOM "/dev/urandom"
|
||||
|
||||
static char xorgAuthBuf[256];
|
||||
static char *xorgAuthTempl = "/tmp/.Xgl-auth-XXXXXX";
|
||||
static char *xorgAuth = NULL;
|
||||
|
||||
static char *xorgProgs[] = { "/usr/bin/Xorg", "/usr/X11R6/bin/Xorg" };
|
||||
static char *xorgProg = NULL;
|
||||
|
||||
static char *xorgDisplay = ":93";
|
||||
static char *xorgTerminate = "-terminate";
|
||||
|
||||
static pid_t xorgPid = 0;
|
||||
static int receivedUsr1 = 0;
|
||||
static jmp_buf jumpbuf;
|
||||
|
||||
static Bool waitAndExit = FALSE;
|
||||
|
||||
static char **xorgArgv = 0;
|
||||
static int nXorgArgv = 0;
|
||||
|
||||
typedef struct _xglxArg *xglxArgPtr;
|
||||
|
||||
typedef int (*xglxProcessArgumentProc) (xglxArgPtr, int, char **, int);
|
||||
|
||||
typedef struct _xglxArg {
|
||||
xglxProcessArgumentProc processArgument;
|
||||
const char *name;
|
||||
const char *usage;
|
||||
} xglxArgRec;
|
||||
|
||||
static int
|
||||
xglxAddXorgArguments (char **argv,
|
||||
int n)
|
||||
{
|
||||
char **newArgv;
|
||||
int i;
|
||||
|
||||
newArgv = xrealloc (xorgArgv, sizeof (char *) * (nXorgArgv + n));
|
||||
if (!newArgv)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
newArgv[nXorgArgv + i] = argv[i];
|
||||
|
||||
xorgArgv = newArgv;
|
||||
nXorgArgv += n;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static int
|
||||
xglxProcessCommonXorgArgument (xglxArgPtr pArg,
|
||||
int n,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
if (strcmp (argv[i], pArg->name) == 0)
|
||||
{
|
||||
if (i + n - 1 < argc)
|
||||
return xglxAddXorgArguments (&argv[i], n);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define PROCESS_COMMON_XORG_ARGUMENT_IMP(args) \
|
||||
static int \
|
||||
xglxProcess ## args ## CommonXorgArgument (xglxArgPtr pArg, \
|
||||
int argc, \
|
||||
char **argv, \
|
||||
int i) \
|
||||
{ \
|
||||
return xglxProcessCommonXorgArgument (pArg, args, argc, argv, i); \
|
||||
}
|
||||
|
||||
PROCESS_COMMON_XORG_ARGUMENT_IMP (1)
|
||||
PROCESS_COMMON_XORG_ARGUMENT_IMP (2)
|
||||
|
||||
static int
|
||||
xglxProcessXorgVTArgument (xglxArgPtr pArg,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
if (argv[i][0] == 'v' && argv[i][1] == 't' &&
|
||||
strspn (&argv[i][2], "0123456789") == strlen (&argv[i][2]))
|
||||
return xglxAddXorgArguments (&argv[i], 1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
xglxProcessXorgAcArgument (xglxArgPtr pArg,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
static char *ac = "-ac";
|
||||
|
||||
if (strcmp (argv[i], pArg->name) == 0)
|
||||
{
|
||||
if (xglxAddXorgArguments (&ac, 1))
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
xglxProcessXorgVersionArgument (xglxArgPtr pArg,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
static char *version = "-version";
|
||||
|
||||
if (strcmp (argv[i], pArg->name) == 0)
|
||||
{
|
||||
if (xglxAddXorgArguments (&version, 1))
|
||||
{
|
||||
waitAndExit = TRUE;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
xglxProcessXorgProgArgument (xglxArgPtr pArg,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
if (strcmp (argv[i], pArg->name) == 0)
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
xorgProg = argv[i + 1];
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
xglxProcessXorgDisplayArgument (xglxArgPtr pArg,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
if (strcmp (argv[i], pArg->name) == 0)
|
||||
{
|
||||
if (i + 1 < argc)
|
||||
{
|
||||
xorgDisplay = argv[i + 1];
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
xglxProcessXorgWaitExitArgument (xglxArgPtr pArg,
|
||||
int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
if (xglxProcessCommonXorgArgument (pArg, 1, argc, argv, i))
|
||||
{
|
||||
waitAndExit = TRUE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define ARG(processArgument, name, usage) \
|
||||
{ processArgument, name, usage }
|
||||
|
||||
#define XORG_ARG(name, args) \
|
||||
ARG (xglxProcess ## args ## CommonXorgArgument, name, 0)
|
||||
|
||||
#define XORG_UARG(name, usage, args) \
|
||||
ARG (xglxProcess ## args ## CommonXorgArgument, name, usage)
|
||||
|
||||
xglxArgRec xorgUid0Args[] = {
|
||||
XORG_UARG ("-modulepath", " paths specify the module search path", 2),
|
||||
XORG_UARG ("-logfile", " file specify a log file name", 2),
|
||||
ARG (xglxProcessXorgWaitExitArgument, "-configure",
|
||||
" probe for devices and write an Xorg config")
|
||||
};
|
||||
|
||||
xglxArgRec xorgUidArgs[] = {
|
||||
XORG_UARG ("-config",
|
||||
" file specify configuration file, relative to the\n"
|
||||
" Xorg config search path, "
|
||||
"only root can use absolute", 2)
|
||||
};
|
||||
|
||||
xglxArgRec xorgArgs[] = {
|
||||
ARG (xglxProcessXorgWaitExitArgument, "-probeonly",
|
||||
" probe for devices, then exit"),
|
||||
XORG_UARG ("-verbose", " [n] verbose startup messages", 2),
|
||||
XORG_UARG ("-logverbose", " [n] verbose log messages", 2),
|
||||
XORG_UARG ("-quiet", " minimal startup messages", 1),
|
||||
XORG_UARG ("-depth", " n set colour depth. Default: 8", 2),
|
||||
XORG_UARG ("-gamma",
|
||||
" f set gamma value (0.1 < f < 10.0) "
|
||||
"Default: 1.0", 2),
|
||||
XORG_UARG ("-rgamma", " f set gamma value for red phase", 2),
|
||||
XORG_UARG ("-ggamma", " f set gamma value for green phase",
|
||||
2),
|
||||
XORG_UARG ("-bgamma", " f set gamma value for blue phase", 2),
|
||||
XORG_UARG ("-layout",
|
||||
" name specify the ServerLayout section name", 2),
|
||||
XORG_UARG ("-screen",
|
||||
" name specify the Screen section name", 2),
|
||||
XORG_UARG ("-keyboard",
|
||||
" name specify the core keyboard InputDevice name", 2),
|
||||
XORG_UARG ("-pointer",
|
||||
" name specify the core pointer InputDevice name", 2),
|
||||
XORG_UARG ("-nosilk", " disable Silken Mouse", 1),
|
||||
XORG_UARG ("-disableModInDev",
|
||||
" disable dynamic modification of input device settings",
|
||||
1),
|
||||
XORG_UARG ("-allowMouseOpenFail",
|
||||
" start server even if the mouse can't be initialized", 1),
|
||||
XORG_UARG ("-bestRefresh",
|
||||
" choose modes with the best refresh rate", 1),
|
||||
XORG_UARG ("-ignoreABI",
|
||||
" make module ABI mismatches non-fatal", 1),
|
||||
XORG_UARG ("-isolateDevice",
|
||||
" bus_id restrict device resets to bus_id (PCI only)", 2),
|
||||
ARG (xglxProcessXorgVTArgument, "vtXX",
|
||||
" use the specified VT number"),
|
||||
XORG_UARG ("-keeptty",
|
||||
" don't detach controlling tty "
|
||||
"(for debugging only)", 1),
|
||||
XORG_UARG ("-novtswitch", " don't immediately switch to new VT",
|
||||
1),
|
||||
XORG_UARG ("-sharevts", " share VTs with another X server",
|
||||
1),
|
||||
ARG (xglxProcessXorgAcArgument, "-xorgAc",
|
||||
" disable access control restrictions"),
|
||||
ARG (xglxProcessXorgProgArgument, "-xorgProgram",
|
||||
" server program"),
|
||||
ARG (xglxProcessXorgDisplayArgument, "-xorgDisplay",
|
||||
" server display"),
|
||||
ARG (xglxProcessXorgVersionArgument, "-xorgVersion",
|
||||
" show the server version")
|
||||
};
|
||||
|
||||
xglxArgRec sharedArgs[] = {
|
||||
XORG_ARG ("-br", 1)
|
||||
};
|
||||
|
||||
void
|
||||
xglxUseXorgMsg (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
ErrorF ("\nXorg usage:\n");
|
||||
|
||||
if (getuid () == 0)
|
||||
{
|
||||
for (i = 0; i < sizeof (xorgUid0Args) / sizeof (xglxArgRec); i++)
|
||||
ErrorF ("%s%s\n", xorgUid0Args[i].name, xorgUid0Args[i].usage);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < sizeof (xorgUidArgs) / sizeof (xglxArgRec); i++)
|
||||
ErrorF ("%s%s\n", xorgUidArgs[i].name, xorgUidArgs[i].usage);
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof (xorgArgs) / sizeof (xglxArgRec); i++)
|
||||
ErrorF ("%s%s\n", xorgArgs[i].name, xorgArgs[i].usage);
|
||||
}
|
||||
|
||||
int
|
||||
xglxProcessXorgArgument (int argc,
|
||||
char **argv,
|
||||
int i)
|
||||
{
|
||||
int skip, j;
|
||||
|
||||
if (nXorgArgv == 0)
|
||||
{
|
||||
if (!xglxAddXorgArguments (&xorgProg, 1))
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (getuid () == 0)
|
||||
{
|
||||
for (j = 0; j < sizeof (xorgUid0Args) / sizeof (xglxArgRec); j++)
|
||||
{
|
||||
skip = (*xorgUid0Args[j].processArgument) (&xorgUid0Args[j],
|
||||
argc, argv, i);
|
||||
if (skip)
|
||||
return skip;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (j = 0; j < sizeof (xorgUidArgs) / sizeof (xglxArgRec); j++)
|
||||
{
|
||||
skip = (*xorgUidArgs[j].processArgument) (&xorgUidArgs[j],
|
||||
argc, argv, i);
|
||||
if (skip)
|
||||
return skip;
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 0; j < sizeof (xorgArgs) / sizeof (xorgArgs[0]); j++)
|
||||
{
|
||||
skip = (*xorgArgs[j].processArgument) (&xorgArgs[j], argc, argv, i);
|
||||
if (skip)
|
||||
return skip;
|
||||
}
|
||||
|
||||
for (j = 0; j < sizeof (sharedArgs) / sizeof (sharedArgs[0]); j++)
|
||||
{
|
||||
skip = (*sharedArgs[j].processArgument) (&sharedArgs[j], argc, argv, i);
|
||||
if (skip)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
sigAlarm (int sig)
|
||||
{
|
||||
ErrorF ("%s won't die, killing it\n", basename (xorgProg));
|
||||
|
||||
kill (xorgPid, SIGKILL);
|
||||
if (xorgPid)
|
||||
while (waitpid (xorgPid, NULL, 0) == -1 && errno == EINTR);
|
||||
}
|
||||
|
||||
void
|
||||
xglxAbortXorg (void)
|
||||
{
|
||||
sighandler_t oldSigAlarm;
|
||||
unsigned int oldAlarm;
|
||||
int status = 0;
|
||||
char *name;
|
||||
|
||||
if (!xorgPid)
|
||||
return;
|
||||
|
||||
name = basename (xorgProg);
|
||||
|
||||
oldAlarm = alarm (0);
|
||||
oldSigAlarm = signal (SIGALRM, sigAlarm);
|
||||
|
||||
kill (xorgPid, SIGTERM);
|
||||
|
||||
alarm (XORG_DIE_TIMEOUT);
|
||||
while (waitpid (xorgPid, &status, 0) == -1 && errno == EINTR);
|
||||
alarm (0);
|
||||
|
||||
signal (SIGALRM, oldSigAlarm);
|
||||
alarm (oldAlarm);
|
||||
|
||||
if (WIFEXITED (status))
|
||||
{
|
||||
if (WEXITSTATUS (status))
|
||||
ErrorF ("%s died, exit status %d\n", name, WEXITSTATUS (status));
|
||||
}
|
||||
else if (WIFSIGNALED (status))
|
||||
ErrorF ("%s died, signal %d\n", name, WTERMSIG (status));
|
||||
else
|
||||
ErrorF ("%s died, dubious exit\n", name);
|
||||
|
||||
if (xorgAuth)
|
||||
unlink (xorgAuth);
|
||||
}
|
||||
|
||||
static void
|
||||
sigUsr1Waiting (int sig)
|
||||
{
|
||||
signal (sig, sigUsr1Waiting);
|
||||
receivedUsr1++;
|
||||
}
|
||||
|
||||
static void
|
||||
sigUsr1Jump (int sig)
|
||||
{
|
||||
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
sigset_t set;
|
||||
#endif
|
||||
|
||||
signal (sig, sigUsr1Waiting);
|
||||
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
sigemptyset (&set);
|
||||
sigaddset (&set, SIGUSR1);
|
||||
sigprocmask (SIG_UNBLOCK, &set, NULL);
|
||||
#endif
|
||||
|
||||
longjmp (jumpbuf, 1);
|
||||
}
|
||||
|
||||
#define AUTH_DATA_LEN 16 /* bytes of authorization data */
|
||||
|
||||
static Bool
|
||||
xglxSetupAuth (char *name, int authFd)
|
||||
{
|
||||
Xauth auth;
|
||||
int randomFd;
|
||||
ssize_t bytes, size;
|
||||
char authHost[256];
|
||||
char authData[AUTH_DATA_LEN];
|
||||
FILE *file;
|
||||
|
||||
auth.family = FamilyLocal;
|
||||
|
||||
gethostname (authHost, sizeof (authHost));
|
||||
|
||||
auth.address = authHost;
|
||||
auth.address_length = strlen (authHost);
|
||||
|
||||
auth.number = strrchr (xorgDisplay, ':');
|
||||
if (!auth.number)
|
||||
{
|
||||
ErrorF ("Bad Xorg display name: %s\n", xorgDisplay);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
auth.number++;
|
||||
|
||||
auth.number_length = strlen (auth.number);
|
||||
if (!auth.number_length)
|
||||
{
|
||||
ErrorF ("Bad Xorg display name: %s\n", xorgDisplay);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
auth.name = "MIT-MAGIC-COOKIE-1";
|
||||
auth.name_length = strlen (auth.name);
|
||||
|
||||
randomFd = open (XORG_DEV_RANDOM, O_RDONLY);
|
||||
if (randomFd == -1)
|
||||
{
|
||||
ErrorF ("Failed to open " XORG_DEV_RANDOM "\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bytes = 0;
|
||||
do {
|
||||
size = read (randomFd, authData + bytes, AUTH_DATA_LEN - bytes);
|
||||
if (size <= 0)
|
||||
break;
|
||||
|
||||
bytes += size;
|
||||
} while (bytes != AUTH_DATA_LEN);
|
||||
|
||||
close (randomFd);
|
||||
|
||||
if (bytes != AUTH_DATA_LEN)
|
||||
{
|
||||
ErrorF ("Failed to read %d random bytes from " XORG_DEV_RANDOM "\n",
|
||||
AUTH_DATA_LEN);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
auth.data = authData;
|
||||
auth.data_length = AUTH_DATA_LEN;
|
||||
|
||||
file = fdopen (authFd, "w");
|
||||
if (!file)
|
||||
{
|
||||
ErrorF ("Failed to open authorization file: %s\n", name);
|
||||
close (authFd);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
XauWriteAuth (file, &auth);
|
||||
fclose (file);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *
|
||||
xglxInitXorg (void)
|
||||
{
|
||||
sighandler_t oldSigUsr1;
|
||||
pid_t pid;
|
||||
char *name;
|
||||
char *auth[] = { "-auth", xorgAuthBuf, "-nolisten", "tcp" };
|
||||
char *saver[] = { "-dpms", "-v", "-s", "0" };
|
||||
char *endArg = NULL;
|
||||
int authFd;
|
||||
int mask;
|
||||
|
||||
if (xorgPid)
|
||||
return xorgDisplay;
|
||||
|
||||
if (!xorgProg)
|
||||
{
|
||||
struct stat buf;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeof (xorgProgs) / sizeof (char *); i++)
|
||||
{
|
||||
if (stat (xorgProgs[i], &buf) == 0)
|
||||
{
|
||||
xorgProg = xorgProgs[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!xorgProg)
|
||||
FatalError ("Can't find Xorg executable\n");
|
||||
}
|
||||
|
||||
strcpy (xorgAuthBuf, xorgAuthTempl);
|
||||
mask = umask (0077);
|
||||
authFd = mkstemp (xorgAuthBuf);
|
||||
umask (mask);
|
||||
if (authFd == -1)
|
||||
FatalError ("Failed to generate unique authorization file\n");
|
||||
|
||||
xorgAuth = xorgAuthBuf;
|
||||
|
||||
if (nXorgArgv == 0)
|
||||
{
|
||||
if (!xglxAddXorgArguments (&xorgProg, 1))
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
xorgArgv[0] = xorgProg;
|
||||
}
|
||||
|
||||
if (!xglxAddXorgArguments (auth, sizeof (auth) / sizeof (char *)))
|
||||
return 0;
|
||||
|
||||
if (!xglxAddXorgArguments (saver, sizeof (saver) / sizeof (char *)))
|
||||
return 0;
|
||||
|
||||
if (!xglxAddXorgArguments (&xorgDisplay, 1))
|
||||
return 0;
|
||||
|
||||
if (!xglxAddXorgArguments (&xorgTerminate, 1))
|
||||
return 0;
|
||||
|
||||
if (!xglxAddXorgArguments (&endArg, 1))
|
||||
return 0;
|
||||
|
||||
name = basename (xorgProg);
|
||||
|
||||
if (!xglxSetupAuth (xorgAuth, authFd))
|
||||
FatalError ("Failed to set up authorization: %s\n", xorgAuth);
|
||||
|
||||
oldSigUsr1 = signal (SIGUSR1, sigUsr1Waiting);
|
||||
|
||||
pid = fork ();
|
||||
|
||||
switch (pid) {
|
||||
case -1:
|
||||
perror ("fork");
|
||||
FatalError ("fork");
|
||||
break;
|
||||
case 0:
|
||||
signal (SIGUSR1, SIG_IGN);
|
||||
execv (xorgArgv[0], xorgArgv);
|
||||
perror (xorgArgv[0]);
|
||||
exit (2);
|
||||
break;
|
||||
default:
|
||||
xorgPid = pid;
|
||||
break;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int status;
|
||||
|
||||
signal (SIGUSR1, sigUsr1Waiting);
|
||||
if (setjmp (jumpbuf) && !waitAndExit)
|
||||
break;
|
||||
|
||||
signal (SIGUSR1, sigUsr1Jump);
|
||||
if (receivedUsr1 && !waitAndExit)
|
||||
break;
|
||||
|
||||
if (waitpid (xorgPid, &status, 0) != -1)
|
||||
{
|
||||
if (WIFEXITED (status))
|
||||
{
|
||||
if (waitAndExit)
|
||||
{
|
||||
if (WEXITSTATUS (status))
|
||||
FatalError ("%s died, exit status %d\n", name,
|
||||
WEXITSTATUS (status));
|
||||
|
||||
exit (WEXITSTATUS (status));
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalError ("%s died, exit status %d\n", name,
|
||||
WEXITSTATUS (status));
|
||||
}
|
||||
}
|
||||
else if (WIFSIGNALED (status))
|
||||
FatalError ("%s died, signal %d\n", name, WTERMSIG (status));
|
||||
else
|
||||
FatalError ("%s died, dubious exit\n", name);
|
||||
}
|
||||
}
|
||||
|
||||
signal (SIGUSR1, oldSigUsr1);
|
||||
|
||||
setenv ("XAUTHORITY", xorgAuth, 1);
|
||||
|
||||
return xorgDisplay;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#include "xglmodule.h"
|
||||
|
||||
char *
|
||||
moduleVersion (void)
|
||||
{
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
Bool
|
||||
moduleInit (const char *module)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#ifndef _XGL_GLXEXT_H_
|
||||
#define _XGL_GLXEXT_H_
|
||||
|
||||
#include "scrnintstr.h"
|
||||
|
||||
Bool
|
||||
xglInitVisualConfigs (ScreenPtr pScreen);
|
||||
|
||||
#ifndef NGLXEXTLOG
|
||||
|
||||
void
|
||||
xglInitGlxLog (void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _XGL_GLXEXT_H_ */
|
||||
134
hw/xgl/xglhash.c
134
hw/xgl/xglhash.c
|
|
@ -1,134 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#include "xgl.h"
|
||||
|
||||
#define SYM(ptr, name) { (void **) &(ptr), (name) }
|
||||
|
||||
typedef struct _xglHashFunc {
|
||||
xglHashTablePtr (*NewHashTable) (void);
|
||||
void (*DeleteHashTable) (xglHashTablePtr pTable);
|
||||
void *(*HashLookup) (const xglHashTablePtr pTable,
|
||||
unsigned int key);
|
||||
void (*HashInsert) (xglHashTablePtr pTable,
|
||||
unsigned int key,
|
||||
void *data);
|
||||
void (*HashRemove) (xglHashTablePtr pTable,
|
||||
unsigned int key);
|
||||
unsigned int (*HashFirstEntry) (xglHashTablePtr pTable);
|
||||
unsigned int (*HashNextEntry) (const xglHashTablePtr pTable,
|
||||
unsigned int key);
|
||||
unsigned int (*HashFindFreeKeyBlock) (xglHashTablePtr pTable,
|
||||
unsigned int numKeys);
|
||||
} xglHashFuncRec;
|
||||
|
||||
static xglHashFuncRec __hashFunc;
|
||||
|
||||
static void *hashHandle = 0;
|
||||
|
||||
Bool
|
||||
xglLoadHashFuncs (void *handle)
|
||||
{
|
||||
|
||||
#ifdef XGL_MODULAR
|
||||
xglSymbolRec sym[] = {
|
||||
SYM (__hashFunc.NewHashTable, "_mesa_NewHashTable"),
|
||||
SYM (__hashFunc.DeleteHashTable, "_mesa_DeleteHashTable"),
|
||||
SYM (__hashFunc.HashLookup, "_mesa_HashLookup"),
|
||||
SYM (__hashFunc.HashInsert, "_mesa_HashInsert"),
|
||||
SYM (__hashFunc.HashRemove, "_mesa_HashRemove"),
|
||||
SYM (__hashFunc.HashFirstEntry, "_mesa_HashFirstEntry"),
|
||||
SYM (__hashFunc.HashNextEntry, "_mesa_HashNextEntry"),
|
||||
SYM (__hashFunc.HashFindFreeKeyBlock, "_mesa_HashFindFreeKeyBlock")
|
||||
};
|
||||
|
||||
if (!xglLookupSymbols (handle, sym, sizeof (sym) / sizeof (sym[0])))
|
||||
return FALSE;
|
||||
|
||||
hashHandle = handle;
|
||||
|
||||
return TRUE;
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
xglHashTablePtr
|
||||
xglNewHashTable (void)
|
||||
{
|
||||
if (!hashHandle)
|
||||
return 0;
|
||||
|
||||
return (*__hashFunc.NewHashTable) ();
|
||||
}
|
||||
|
||||
void
|
||||
xglDeleteHashTable (xglHashTablePtr pTable)
|
||||
{
|
||||
(*__hashFunc.DeleteHashTable) (pTable);
|
||||
}
|
||||
|
||||
void *
|
||||
xglHashLookup (const xglHashTablePtr pTable,
|
||||
unsigned int key)
|
||||
{
|
||||
return (*__hashFunc.HashLookup) (pTable, key);
|
||||
}
|
||||
|
||||
void
|
||||
xglHashInsert (xglHashTablePtr pTable,
|
||||
unsigned int key,
|
||||
void *data)
|
||||
{
|
||||
(*__hashFunc.HashInsert) (pTable, key, data);
|
||||
}
|
||||
|
||||
void
|
||||
xglHashRemove (xglHashTablePtr pTable,
|
||||
unsigned int key)
|
||||
{
|
||||
(*__hashFunc.HashRemove) (pTable, key);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
xglHashFirstEntry (xglHashTablePtr pTable)
|
||||
{
|
||||
return (*__hashFunc.HashFirstEntry) (pTable);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
xglHashNextEntry (const xglHashTablePtr pTable,
|
||||
unsigned int key)
|
||||
{
|
||||
return (*__hashFunc.HashNextEntry) (pTable, key);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
xglHashFindFreeKeyBlock (xglHashTablePtr pTable,
|
||||
unsigned int numKeys)
|
||||
{
|
||||
return (*__hashFunc.HashFindFreeKeyBlock) (pTable, numKeys);
|
||||
}
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#include "xgl.h"
|
||||
#include "xglmodule.h"
|
||||
|
||||
#ifdef XGL_MODULAR
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#define SYM(ptr, name) { (void **) &(ptr), (name) }
|
||||
|
||||
void *
|
||||
xglLoadModule (const char *name,
|
||||
int flag)
|
||||
{
|
||||
ModuleVersionProcPtr moduleVersion;
|
||||
ModuleInitProcPtr moduleInit;
|
||||
void *handle = 0;
|
||||
char *module;
|
||||
xglSymbolRec mSym[] = {
|
||||
SYM (moduleVersion, "moduleVersion"),
|
||||
SYM (moduleInit, "moduleInit")
|
||||
};
|
||||
|
||||
module = malloc (strlen (XGL_MODULE_PATH "/lib.so") + strlen (name) + 1);
|
||||
if (!module)
|
||||
return 0;
|
||||
|
||||
sprintf (module, XGL_MODULE_PATH "/lib%s.so", name);
|
||||
|
||||
handle = dlopen (module, flag);
|
||||
if (handle)
|
||||
{
|
||||
if (xglLookupSymbols (handle, mSym, sizeof (mSym) / sizeof (mSym[0])))
|
||||
{
|
||||
const char *version;
|
||||
|
||||
version = (*moduleVersion) ();
|
||||
if (strcmp (VERSION, version) == 0)
|
||||
{
|
||||
if (!(*moduleInit) (module))
|
||||
{
|
||||
dlclose (handle);
|
||||
handle = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ErrorF ("Module version mismatch. "
|
||||
"%s is %s Xserver is" VERSION "\n",
|
||||
module, version);
|
||||
|
||||
dlclose (handle);
|
||||
handle = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dlclose (handle);
|
||||
handle = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
ErrorF ("dlopen: %s\n", dlerror ());
|
||||
|
||||
free (module);
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
void
|
||||
xglUnloadModule (void *handle)
|
||||
{
|
||||
dlclose (handle);
|
||||
}
|
||||
|
||||
Bool
|
||||
xglLookupSymbols (void *handle,
|
||||
xglSymbolPtr sym,
|
||||
int nSym)
|
||||
{
|
||||
void *symbol;
|
||||
char *error;
|
||||
int i;
|
||||
|
||||
/* avoid previous error */
|
||||
dlerror ();
|
||||
|
||||
for (i = 0; i < nSym; i++)
|
||||
{
|
||||
symbol = dlsym (handle, sym[i].name);
|
||||
if (!symbol)
|
||||
{
|
||||
error = dlerror ();
|
||||
if (error != 0)
|
||||
ErrorF ("dlsym: %s: %s\n", sym[i].name, error);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*(sym[i].ptr) = symbol;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2005 Novell, 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
|
||||
* Novell, Inc. not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* Novell, Inc. makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* NOVELL, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL NOVELL, INC. 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#ifndef _XGL_MODULE_H_
|
||||
#define _XGL_MODULE_H_
|
||||
|
||||
#include <xgl-config.h>
|
||||
|
||||
#include <X11/Xdefs.h>
|
||||
#include "misc.h"
|
||||
|
||||
#define VERSION "0.0.1"
|
||||
|
||||
typedef const char *(*ModuleVersionProcPtr) (void);
|
||||
typedef Bool (*ModuleInitProcPtr) (const char *module);
|
||||
|
||||
char *
|
||||
moduleVersion (void);
|
||||
|
||||
Bool
|
||||
moduleInit (const char *module);
|
||||
|
||||
#endif /* _XGL_MODULE_H_ */
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2004 David Reveman
|
||||
*
|
||||
* 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
|
||||
* David Reveman not be used in advertising or publicity pertaining to
|
||||
* distribution of the software without specific, written prior permission.
|
||||
* David Reveman makes no representations about the suitability of this
|
||||
* software for any purpose. It is provided "as is" without express or
|
||||
* implied warranty.
|
||||
*
|
||||
* DAVID REVEMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
* NO EVENT SHALL DAVID REVEMAN 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: David Reveman <davidr@novell.com>
|
||||
*/
|
||||
|
||||
#include "xgl.h"
|
||||
|
||||
#include <mivalidate.h>
|
||||
#include <dixstruct.h>
|
||||
|
||||
typedef struct _xglDepth {
|
||||
CARD8 depth;
|
||||
CARD8 bpp;
|
||||
} xglDepthRec, *xglDepthPtr;
|
||||
|
||||
static xglDepthRec xglDepths[] = {
|
||||
{ 1, 1 },
|
||||
{ 4, 4 },
|
||||
{ 8, 8 },
|
||||
{ 15, 16 },
|
||||
{ 16, 16 },
|
||||
{ 24, 32 },
|
||||
{ 32, 32 }
|
||||
};
|
||||
|
||||
#define NUM_XGL_DEPTHS (sizeof (xglDepths) / sizeof (xglDepths[0]))
|
||||
|
||||
void
|
||||
xglSetPixmapFormats (ScreenInfo *pScreenInfo)
|
||||
{
|
||||
int i;
|
||||
|
||||
pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
|
||||
pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
|
||||
pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
|
||||
pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
|
||||
pScreenInfo->numPixmapFormats = 0;
|
||||
|
||||
for (i = 0; i < NUM_XGL_DEPTHS; i++)
|
||||
{
|
||||
PixmapFormatRec *format;
|
||||
|
||||
format = &pScreenInfo->formats[pScreenInfo->numPixmapFormats++];
|
||||
|
||||
format->depth = xglDepths[i].depth;
|
||||
format->bitsPerPixel = xglDepths[i].bpp;
|
||||
format->scanlinePad = BITMAP_SCANLINE_PAD;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
xglSetRootClip (ScreenPtr pScreen,
|
||||
Bool enable)
|
||||
{
|
||||
WindowPtr pWin = WindowTable[pScreen->myNum];
|
||||
WindowPtr pChild;
|
||||
Bool wasViewable;
|
||||
Bool anyMarked = FALSE;
|
||||
RegionPtr pOldClip = 0;
|
||||
|
||||
#ifdef DO_SAVE_UNDERS
|
||||
Bool dosave = FALSE;
|
||||
#endif
|
||||
|
||||
WindowPtr pLayerWin;
|
||||
BoxRec box;
|
||||
|
||||
if (!pWin)
|
||||
return;
|
||||
|
||||
wasViewable = (Bool) (pWin->viewable);
|
||||
if (wasViewable)
|
||||
{
|
||||
for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib)
|
||||
{
|
||||
(void) (*pScreen->MarkOverlappedWindows) (pChild,
|
||||
pChild,
|
||||
&pLayerWin);
|
||||
}
|
||||
|
||||
(*pScreen->MarkWindow) (pWin);
|
||||
anyMarked = TRUE;
|
||||
|
||||
if (pWin->valdata)
|
||||
{
|
||||
if (HasBorder (pWin))
|
||||
{
|
||||
RegionPtr borderVisible;
|
||||
|
||||
borderVisible = REGION_CREATE (pScreen, NullBox, 1);
|
||||
REGION_SUBTRACT (pScreen, borderVisible,
|
||||
&pWin->borderClip, &pWin->winSize);
|
||||
pWin->valdata->before.borderVisible = borderVisible;
|
||||
}
|
||||
pWin->valdata->before.resized = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (enable)
|
||||
{
|
||||
box.x1 = 0;
|
||||
box.y1 = 0;
|
||||
box.x2 = pScreen->width;
|
||||
box.y2 = pScreen->height;
|
||||
|
||||
pWin->drawable.width = pScreen->width;
|
||||
pWin->drawable.height = pScreen->height;
|
||||
|
||||
REGION_INIT (pScreen, &pWin->winSize, &box, 1);
|
||||
REGION_INIT (pScreen, &pWin->borderSize, &box, 1);
|
||||
REGION_RESET (pScreen, &pWin->borderClip, &box);
|
||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
||||
}
|
||||
else
|
||||
{
|
||||
REGION_EMPTY (pScreen, &pWin->borderClip);
|
||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
||||
}
|
||||
|
||||
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
||||
|
||||
if (wasViewable)
|
||||
{
|
||||
if (pWin->firstChild)
|
||||
{
|
||||
anyMarked |= (*pScreen->MarkOverlappedWindows) (pWin->firstChild,
|
||||
pWin->firstChild,
|
||||
(WindowPtr *) 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
(*pScreen->MarkWindow) (pWin);
|
||||
anyMarked = TRUE;
|
||||
}
|
||||
|
||||
#ifdef DO_SAVE_UNDERS
|
||||
if (DO_SAVE_UNDERS (pWin))
|
||||
dosave = (*pScreen->ChangeSaveUnder) (pLayerWin, pLayerWin);
|
||||
#endif
|
||||
|
||||
if (anyMarked)
|
||||
(*pScreen->ValidateTree)(pWin, NullWindow, VTOther);
|
||||
}
|
||||
|
||||
if (wasViewable)
|
||||
{
|
||||
if (anyMarked)
|
||||
(*pScreen->HandleExposures) (pWin);
|
||||
|
||||
#ifdef DO_SAVE_UNDERS
|
||||
if (dosave)
|
||||
(*pScreen->PostChangeSaveUnder) (pLayerWin, pLayerWin);
|
||||
#endif
|
||||
|
||||
if (anyMarked && pScreen->PostValidateTree)
|
||||
(*pScreen->PostValidateTree) (pWin, NullWindow, VTOther);
|
||||
}
|
||||
|
||||
if (pWin->realized)
|
||||
WindowsRestructured ();
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@ is" without express or implied warranty.
|
|||
#include "cursorstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "servermd.h"
|
||||
#include "mipointrst.h"
|
||||
|
||||
#include "Xnest.h"
|
||||
|
||||
|
|
@ -35,8 +36,10 @@ is" without express or implied warranty.
|
|||
#include "Keyboard.h"
|
||||
#include "Args.h"
|
||||
|
||||
xnestCursorFuncRec xnestCursorFuncs = {NULL};
|
||||
|
||||
Bool
|
||||
xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
||||
xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||
{
|
||||
XImage *ximage;
|
||||
Pixmap source, mask;
|
||||
|
|
@ -116,7 +119,7 @@ xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
|||
}
|
||||
|
||||
Bool
|
||||
xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
|
||||
xnestUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||
{
|
||||
XFreeCursor(xnestDisplay, xnestCursor(pCursor, pScreen));
|
||||
xfree(xnestGetCursorPriv(pCursor, pScreen));
|
||||
|
|
@ -141,7 +144,7 @@ xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed)
|
|||
&fg_color, &bg_color);
|
||||
}
|
||||
|
||||
void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
|
||||
void xnestSetCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
|
||||
{
|
||||
if (pCursor)
|
||||
{
|
||||
|
|
@ -152,6 +155,29 @@ void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
|
|||
}
|
||||
|
||||
void
|
||||
xnestMoveCursor (ScreenPtr pScreen, int x, int y)
|
||||
xnestMoveCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
|
||||
{
|
||||
}
|
||||
|
||||
Bool
|
||||
xnestDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
|
||||
{
|
||||
xnestCursorFuncPtr pScreenPriv;
|
||||
|
||||
pScreenPriv = (xnestCursorFuncPtr)
|
||||
dixLookupPrivate(&pScreen->devPrivates, xnestCursorScreenKey);
|
||||
|
||||
pScreenPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
xnestDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
|
||||
{
|
||||
xnestCursorFuncPtr pScreenPriv;
|
||||
|
||||
pScreenPriv = (xnestCursorFuncPtr)
|
||||
dixLookupPrivate(&pScreen->devPrivates, xnestCursorScreenKey);
|
||||
|
||||
pScreenPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ is" without express or implied warranty.
|
|||
|
||||
CARD32 lastEventTime = 0;
|
||||
|
||||
extern xEvent *xnestEvents;
|
||||
extern EventList *xnestEvents;
|
||||
|
||||
void
|
||||
ProcessInputEvents()
|
||||
|
|
@ -106,10 +106,11 @@ xnestQueueKeyEvent(int type, unsigned int keycode)
|
|||
{
|
||||
int i, n;
|
||||
|
||||
GetEventList(&xnestEvents);
|
||||
lastEventTime = GetTimeInMillis();
|
||||
n = GetKeyboardEvents(xnestEvents, xnestKeyboardDevice, type, keycode);
|
||||
for (i = 0; i < n; i++)
|
||||
mieqEnqueue(xnestKeyboardDevice, xnestEvents + i);
|
||||
mieqEnqueue(xnestKeyboardDevice, (xnestEvents + i)->event);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -119,6 +120,7 @@ xnestCollectEvents(void)
|
|||
xEvent x;
|
||||
int i, n, valuators[2];
|
||||
ScreenPtr pScreen;
|
||||
GetEventList(&xnestEvents);
|
||||
|
||||
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
|
||||
switch (X.type) {
|
||||
|
|
@ -138,7 +140,7 @@ xnestCollectEvents(void)
|
|||
n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonPress,
|
||||
X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL);
|
||||
for (i = 0; i < n; i++)
|
||||
mieqEnqueue(xnestPointerDevice, xnestEvents + i);
|
||||
mieqEnqueue(xnestPointerDevice, (xnestEvents + i)->event);
|
||||
break;
|
||||
|
||||
case ButtonRelease:
|
||||
|
|
@ -147,7 +149,7 @@ xnestCollectEvents(void)
|
|||
n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonRelease,
|
||||
X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL);
|
||||
for (i = 0; i < n; i++)
|
||||
mieqEnqueue(xnestPointerDevice, xnestEvents + i);
|
||||
mieqEnqueue(xnestPointerDevice, (xnestEvents + i)->event);
|
||||
break;
|
||||
|
||||
case MotionNotify:
|
||||
|
|
@ -157,7 +159,7 @@ xnestCollectEvents(void)
|
|||
n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify,
|
||||
0, POINTER_ABSOLUTE, 0, 2, valuators);
|
||||
for (i = 0; i < n; i++)
|
||||
mieqEnqueue(xnestPointerDevice, xnestEvents + i);
|
||||
mieqEnqueue(xnestPointerDevice, (xnestEvents + i)->event);
|
||||
break;
|
||||
|
||||
case FocusIn:
|
||||
|
|
@ -190,7 +192,7 @@ xnestCollectEvents(void)
|
|||
n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify,
|
||||
0, POINTER_ABSOLUTE, 0, 2, valuators);
|
||||
for (i = 0; i < n; i++)
|
||||
mieqEnqueue(xnestPointerDevice, xnestEvents + i);
|
||||
mieqEnqueue(xnestPointerDevice, (xnestEvents + i)->event);
|
||||
xnestDirectInstallColormaps(pScreen);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ is" without express or implied warranty.
|
|||
|
||||
Bool xnestDoFullGeneration = True;
|
||||
|
||||
xEvent *xnestEvents = NULL;
|
||||
EventList *xnestEvents = NULL;
|
||||
|
||||
void
|
||||
InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
|
||||
|
|
@ -92,10 +92,7 @@ InitInput(int argc, char *argv[])
|
|||
xnestPointerDevice = AddInputDevice(serverClient, xnestPointerProc, TRUE);
|
||||
xnestKeyboardDevice = AddInputDevice(serverClient, xnestKeyboardProc, TRUE);
|
||||
|
||||
if (!xnestEvents)
|
||||
xnestEvents = (xEvent *) xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||
if (!xnestEvents)
|
||||
FatalError("couldn't allocate room for events\n");
|
||||
GetEventList(&xnestEvents);
|
||||
|
||||
RegisterPointerDevice(xnestPointerDevice);
|
||||
RegisterKeyboardDevice(xnestKeyboardDevice);
|
||||
|
|
|
|||
|
|
@ -41,9 +41,11 @@ is" without express or implied warranty.
|
|||
#include "Init.h"
|
||||
#include "mipointer.h"
|
||||
#include "Args.h"
|
||||
#include "mipointrst.h"
|
||||
|
||||
Window xnestDefaultWindows[MAXSCREENS];
|
||||
Window xnestScreenSaverWindows[MAXSCREENS];
|
||||
DevPrivateKey xnestCursorScreenKey = &xnestCursorScreenKey;
|
||||
|
||||
ScreenPtr
|
||||
xnestScreen(Window window)
|
||||
|
|
@ -124,6 +126,8 @@ static miPointerSpriteFuncRec xnestPointerSpriteFuncs =
|
|||
xnestUnrealizeCursor,
|
||||
xnestSetCursor,
|
||||
xnestMoveCursor,
|
||||
xnestDeviceCursorInitialize,
|
||||
xnestDeviceCursorCleanup
|
||||
};
|
||||
|
||||
Bool
|
||||
|
|
@ -139,6 +143,7 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
|||
XSizeHints sizeHints;
|
||||
VisualID defaultVisual;
|
||||
int rootDepth;
|
||||
miPointerScreenPtr PointPriv;
|
||||
|
||||
if (!dixRequestPrivate(xnestWindowPrivateKey, sizeof(xnestPrivWin)))
|
||||
return False;
|
||||
|
|
@ -305,8 +310,11 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
|
|||
pScreen->blockData = NULL;
|
||||
pScreen->wakeupData = NULL;
|
||||
|
||||
miPointerInitialize (pScreen, &xnestPointerSpriteFuncs,
|
||||
&xnestPointerCursorFuncs, True);
|
||||
miDCInitialize(pScreen, &xnestPointerCursorFuncs); /* init SW rendering */
|
||||
PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
|
||||
xnestCursorFuncs.spriteFuncs = PointPriv->spriteFuncs;
|
||||
dixSetPrivate(&pScreen->devPrivates, xnestCursorScreenKey, &xnestCursorFuncs);
|
||||
PointPriv->spriteFuncs = &xnestPointerSpriteFuncs;
|
||||
|
||||
pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay,
|
||||
DefaultScreen(xnestDisplay)) /
|
||||
|
|
|
|||
|
|
@ -15,6 +15,15 @@ is" without express or implied warranty.
|
|||
#ifndef XNESTCURSOR_H
|
||||
#define XNESTCURSOR_H
|
||||
|
||||
#include "mipointrst.h"
|
||||
|
||||
typedef struct {
|
||||
miPointerSpriteFuncPtr spriteFuncs;
|
||||
} xnestCursorFuncRec, *xnestCursorFuncPtr;
|
||||
|
||||
extern DevPrivateKey xnestCursorScreenKey;
|
||||
extern xnestCursorFuncRec xnestCursorFuncs;
|
||||
|
||||
typedef struct {
|
||||
Cursor cursor;
|
||||
} xnestPrivCursor;
|
||||
|
|
@ -28,10 +37,22 @@ typedef struct {
|
|||
#define xnestCursor(pCursor, pScreen) \
|
||||
(xnestGetCursorPriv(pCursor, pScreen)->cursor)
|
||||
|
||||
Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||
Bool xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor);
|
||||
void xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed);
|
||||
void xnestSetCursor (ScreenPtr pScreen, CursorPtr pCursor, int x, int y);
|
||||
void xnestMoveCursor (ScreenPtr pScreen, int x, int y);
|
||||
|
||||
Bool xnestRealizeCursor(DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor);
|
||||
Bool xnestUnrealizeCursor(DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor);
|
||||
void xnestRecolorCursor(ScreenPtr pScreen,
|
||||
CursorPtr pCursor,
|
||||
Bool displayed);
|
||||
void xnestSetCursor (DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
CursorPtr pCursor,
|
||||
int x, int y);
|
||||
void xnestMoveCursor (DeviceIntPtr pDev,
|
||||
ScreenPtr pScreen,
|
||||
int x, int y);
|
||||
Bool xnestDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
|
||||
void xnestDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
|
||||
#endif /* XNESTCURSOR_H */
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@ AM_CPPFLAGS = \
|
|||
-DINXQUARTZ \
|
||||
-DUSE_NEW_CLUT \
|
||||
-DXFree86Server \
|
||||
-I$(top_srcdir)/miext/rootless \
|
||||
-DNEW_LAUNCH_METHOD
|
||||
-I$(top_srcdir)/miext/rootless
|
||||
|
||||
SUBDIRS = bundle . GL xpr mach-startup doc
|
||||
|
||||
|
|
@ -26,7 +25,6 @@ libXquartz_la_SOURCES = \
|
|||
quartz.c \
|
||||
quartzAudio.c \
|
||||
quartzCocoa.m \
|
||||
quartzForeground.c \
|
||||
quartzKeyboard.c \
|
||||
quartzPasteboard.c \
|
||||
quartzStartup.c \
|
||||
|
|
@ -44,7 +42,6 @@ EXTRA_DIST = \
|
|||
quartz.h \
|
||||
quartzAudio.h \
|
||||
quartzCommon.h \
|
||||
quartzForeground.h \
|
||||
quartzKeyboard.h \
|
||||
quartzPasteboard.h \
|
||||
sanitizedCarbon.h \
|
||||
|
|
|
|||
|
|
@ -37,7 +37,5 @@ Copyright © 2003-2008, X.org Foundation, Inc.
|
|||
<string>main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>X11Application</string>
|
||||
<key>LSBackgroundOnly</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -350,6 +350,10 @@ Bool DarwinEQInit(void) {
|
|||
|
||||
QuartzModeEQInit();
|
||||
|
||||
/* Note that this *could* cause a potential async issue, since we're checking
|
||||
* darwinEvents without holding the lock, but darwinEvents is only ever set
|
||||
* here, so I don't bother.
|
||||
*/
|
||||
if (!darwinEvents) {
|
||||
darwinEvents = (xEvent *)xcalloc(sizeof(xEvent), GetMaximumEventsNum());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
AM_CPPFLAGS = \
|
||||
-DBUILD_DATE=\"$(BUILD_DATE)\" \
|
||||
-DXSERVER_VERSION=\"$(VERSION)\" \
|
||||
-DNEW_LAUNCH_METHOD -DNEW_LAUNCH_METHOD_2
|
||||
-DXSERVER_VERSION=\"$(VERSION)\"
|
||||
|
||||
x11appdir = $(APPLE_APPLICATIONS_DIR)/X11.app/Contents/MacOS
|
||||
x11app_PROGRAMS = X11
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ static pthread_t create_thread(void *func, void *arg) {
|
|||
return tid;
|
||||
}
|
||||
|
||||
#ifdef NEW_LAUNCH_METHOD
|
||||
/*** Mach-O IPC Stuffs ***/
|
||||
|
||||
union MaxMsgSize {
|
||||
|
|
@ -278,25 +277,13 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
|
|||
}
|
||||
|
||||
int startup_trigger(int argc, char **argv, char **envp) {
|
||||
#else
|
||||
void *add_launchd_display_thread(void *data);
|
||||
|
||||
int main(int argc, char **argv, char **envp) {
|
||||
#endif
|
||||
Display *display;
|
||||
const char *s;
|
||||
|
||||
size_t i;
|
||||
#ifndef NEW_LAUNCH_METHOD
|
||||
fprintf(stderr, "X11.app: main(): argc=%d\n", argc);
|
||||
for(i=0; i < argc; i++) {
|
||||
fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Take care of the case where we're called like a normal DDX */
|
||||
if(argc > 1 && argv[1][0] == ':') {
|
||||
#ifdef NEW_LAUNCH_METHOD
|
||||
kern_return_t kr;
|
||||
mach_port_t mp;
|
||||
string_array_t newenvp;
|
||||
|
|
@ -336,10 +323,6 @@ int main(int argc, char **argv, char **envp) {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
exit(EXIT_SUCCESS);
|
||||
#else
|
||||
create_thread(add_launchd_display_thread, NULL);
|
||||
return server_main(argc, argv, envp);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If we have a process serial number and it's our only arg, act as if
|
||||
|
|
@ -369,7 +352,6 @@ int main(int argc, char **argv, char **envp) {
|
|||
return execute(command_from_prefs("startx_script", DEFAULT_STARTX));
|
||||
}
|
||||
|
||||
#ifdef NEW_LAUNCH_METHOD
|
||||
/*** Main ***/
|
||||
int main(int argc, char **argv, char **envp) {
|
||||
Bool listenOnly = FALSE;
|
||||
|
|
@ -411,16 +393,6 @@ int main(int argc, char **argv, char **envp) {
|
|||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#else
|
||||
void *add_launchd_display_thread(void *data) {
|
||||
/* Start listening on the launchd fd */
|
||||
int launchd_fd = launchd_display_fd();
|
||||
if(launchd_fd != -1) {
|
||||
DarwinListenOnOpenFD(launchd_fd);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int execute(const char *command) {
|
||||
const char *newargv[7];
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ static void set_x11_path() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef NEW_LAUNCH_METHOD
|
||||
static int create_socket(char *filename_out) {
|
||||
struct sockaddr_un servaddr_un;
|
||||
struct sockaddr *servaddr;
|
||||
|
|
@ -201,10 +200,8 @@ static void send_fd_handoff(int handoff_fd, int launchd_fd) {
|
|||
close(connected_fd);
|
||||
fprintf(stderr, "send %d %d %d %s\n", handoff_fd, launchd_fd, errno, strerror(errno));
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv, char **envp) {
|
||||
#ifdef NEW_LAUNCH_METHOD
|
||||
int envpc;
|
||||
kern_return_t kr;
|
||||
mach_port_t mp;
|
||||
|
|
@ -213,7 +210,7 @@ int main(int argc, char **argv, char **envp) {
|
|||
size_t i;
|
||||
int launchd_fd;
|
||||
string_t handoff_socket_filename;
|
||||
#endif
|
||||
sig_t handler;
|
||||
|
||||
if(argc == 2 && !strcmp(argv[1], "-version")) {
|
||||
fprintf(stderr, "X.org Release 7.3\n");
|
||||
|
|
@ -222,7 +219,15 @@ int main(int argc, char **argv, char **envp) {
|
|||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef NEW_LAUNCH_METHOD
|
||||
/* We don't have a mechanism in place to handle this interrupt driven
|
||||
* server-start notification, so just send the signal now, so xinit doesn't
|
||||
* time out waiting for it and will just poll for the server.
|
||||
*/
|
||||
handler = signal(SIGUSR1, SIG_IGN);
|
||||
if(handler == SIG_IGN)
|
||||
kill(getppid(), SIGUSR1);
|
||||
signal(SIGUSR1, handler);
|
||||
|
||||
/* Get the $DISPLAY FD */
|
||||
launchd_fd = launchd_display_fd();
|
||||
|
||||
|
|
@ -303,10 +308,4 @@ int main(int argc, char **argv, char **envp) {
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
|
||||
#else
|
||||
set_x11_path();
|
||||
argv[0] = x11_path;
|
||||
return execvp(x11_path, argv);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
/* foreground.c - Push the current process into the foreground.
|
||||
|
||||
This is in a separate file because of Quartz/X type conflicts.
|
||||
|
||||
Copyright (c) 2007 Jeremy Huddleston
|
||||
|
||||
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 ABOVE LISTED COPYRIGHT
|
||||
HOLDER(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(s) of the above
|
||||
copyright holders shall not be used in advertising or otherwise to
|
||||
promote the sale, use or other dealings in this Software without
|
||||
prior written authorization. */
|
||||
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "quartzForeground.h"
|
||||
|
||||
int QuartzMoveToForeground() {
|
||||
ProcessSerialNumber psn = { 0, kCurrentProcess };
|
||||
OSStatus returnCode = TransformProcessType(& psn, kProcessTransformToForegroundApplication);
|
||||
if( returnCode == 0) {
|
||||
/* fprintf(stderr, "TransformProcessType: Success\n"); */
|
||||
SetFrontProcess(&psn);
|
||||
} else {
|
||||
fprintf(stderr, "TransformProcessType: Failure\n");
|
||||
}
|
||||
return (int)returnCode;
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
/* foreground.h - Push the current process into the foreground.
|
||||
|
||||
This is in a separate file because of Quartz/X type conflicts.
|
||||
|
||||
Copyright (c) 2007 Jeremy Huddleston
|
||||
|
||||
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 ABOVE LISTED COPYRIGHT
|
||||
HOLDER(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(s) of the above
|
||||
copyright holders shall not be used in advertising or otherwise to
|
||||
promote the sale, use or other dealings in this Software without
|
||||
prior written authorization. */
|
||||
|
||||
#ifndef _QUARTZ_FOREGROUND_H_
|
||||
#define _QUARTZ_FOREGROUND_H_
|
||||
|
||||
int QuartzMoveToForeground(void);
|
||||
|
||||
#endif /* _QUARTZ_FOREGROUND_H_ */
|
||||
|
|
@ -121,7 +121,6 @@ int server_main(int argc, char **argv, char **envp) {
|
|||
/* Create the audio mutex */
|
||||
QuartzAudioInit();
|
||||
|
||||
QuartzMoveToForeground();
|
||||
X11ControllerMain(argc, argv, envp);
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -506,11 +506,6 @@ extern Bool RegisterPairingClient(ClientPtr client);
|
|||
extern DeviceIntPtr GuessFreePointerDevice(void);
|
||||
extern DeviceIntPtr NextFreePointerDevice(void);
|
||||
|
||||
extern void CopyGetMasterEvent(DeviceIntPtr mdev,
|
||||
xEvent* original,
|
||||
xEvent** master,
|
||||
int count);
|
||||
|
||||
extern int AllocMasterDevice(ClientPtr client,
|
||||
char* name,
|
||||
DeviceIntPtr* ptr,
|
||||
|
|
|
|||
|
|
@ -29,12 +29,6 @@ Except as contained in this notice, the name of The Open Group shall not be
|
|||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from The Open Group.
|
||||
*/
|
||||
/*
|
||||
* MPX additions:
|
||||
* Copyright © 2006 Peter Hutterer
|
||||
* Author: Peter Hutterer <peter@cs.unisa.edu.au>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ ChangeDeviceID(DeviceIntPtr dev, xEvent* event)
|
|||
* @param master The event after being copied
|
||||
* @param count Number of events in original.
|
||||
*/
|
||||
void
|
||||
static void
|
||||
CopyGetMasterEvent(DeviceIntPtr mdev, xEvent* original,
|
||||
xEvent** master, int count)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ extern int miPointerGetMotionEvents(
|
|||
ScreenPtr /*pScreen*/
|
||||
);
|
||||
|
||||
/* Deprecated in favour of miSetPointerPosition. */
|
||||
/* Deprecated in favour of miPointerSetPosition. */
|
||||
extern void miPointerDeltaCursor(
|
||||
int /*dx*/,
|
||||
int /*dy*/,
|
||||
|
|
@ -134,7 +134,7 @@ extern void miPointerAbsoluteCursor(
|
|||
unsigned long /*time*/
|
||||
) _X_DEPRECATED;
|
||||
|
||||
/* Deprecated in favour of miGetPointerPosition. */
|
||||
/* Deprecated in favour of miPointerGetPosition. */
|
||||
extern void miPointerPosition(
|
||||
int * /*x*/,
|
||||
int * /*y*/
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ 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"
|
||||
|
||||
|
|
@ -50,3 +53,4 @@ typedef struct {
|
|||
Bool waitForUpdate; /* don't move cursor in SIGIO */
|
||||
Bool showTransparent; /* show empty cursors */
|
||||
} miPointerScreenRec, *miPointerScreenPtr;
|
||||
#endif /* MIPOINTRST_H */
|
||||
|
|
|
|||
|
|
@ -268,7 +268,6 @@ static Bool
|
|||
miSpriteCloseScreen (int i, ScreenPtr pScreen)
|
||||
{
|
||||
miSpriteScreenPtr pScreenPriv;
|
||||
DeviceIntPtr pDev;
|
||||
|
||||
pScreenPriv = (miSpriteScreenPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||
miSpriteScreenKey);
|
||||
|
|
|
|||
|
|
@ -2658,7 +2658,7 @@ SProcRecordQueryVersion(ClientPtr client)
|
|||
} /* SProcRecordQueryVersion */
|
||||
|
||||
|
||||
static void
|
||||
static int
|
||||
SwapCreateRegister(xRecordRegisterClientsReq *stuff)
|
||||
{
|
||||
register char n;
|
||||
|
|
@ -2669,11 +2669,17 @@ SwapCreateRegister(xRecordRegisterClientsReq *stuff)
|
|||
swapl(&stuff->nClients, n);
|
||||
swapl(&stuff->nRanges, n);
|
||||
pClientID = (XID *)&stuff[1];
|
||||
if (stuff->nClients > stuff->length - (sz_xRecordRegisterClientsReq >> 2))
|
||||
return BadLength;
|
||||
for (i = 0; i < stuff->nClients; i++, pClientID++)
|
||||
{
|
||||
swapl(pClientID, n);
|
||||
}
|
||||
if (stuff->nRanges > stuff->length - (sz_xRecordRegisterClientsReq >> 2)
|
||||
- stuff->nClients)
|
||||
return BadLength;
|
||||
RecordSwapRanges((xRecordRange *)pClientID, stuff->nRanges);
|
||||
return Success;
|
||||
} /* SwapCreateRegister */
|
||||
|
||||
|
||||
|
|
@ -2681,11 +2687,13 @@ static int
|
|||
SProcRecordCreateContext(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRecordCreateContextReq);
|
||||
int status;
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq);
|
||||
SwapCreateRegister((pointer)stuff);
|
||||
if ((status = SwapCreateRegister((pointer)stuff)) != Success)
|
||||
return status;
|
||||
return ProcRecordCreateContext(client);
|
||||
} /* SProcRecordCreateContext */
|
||||
|
||||
|
|
@ -2694,11 +2702,13 @@ static int
|
|||
SProcRecordRegisterClients(ClientPtr client)
|
||||
{
|
||||
REQUEST(xRecordRegisterClientsReq);
|
||||
int status;
|
||||
register char n;
|
||||
|
||||
swaps(&stuff->length, n);
|
||||
REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq);
|
||||
SwapCreateRegister((pointer)stuff);
|
||||
if ((status = SwapCreateRegister((pointer)stuff)) != Success)
|
||||
return status;
|
||||
return ProcRecordRegisterClients(client);
|
||||
} /* SProcRecordRegisterClients */
|
||||
|
||||
|
|
|
|||
|
|
@ -409,8 +409,9 @@ PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format)
|
|||
(ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP);
|
||||
} else {
|
||||
VisualPtr pVisual = PictureFindVisual(pScreen, format->index.vid);
|
||||
if (!CreateColormap(FakeClientID (0), pScreen, pVisual,
|
||||
&format->index.pColormap, AllocNone, 0))
|
||||
if (CreateColormap(FakeClientID (0), pScreen, pVisual,
|
||||
&format->index.pColormap, AllocNone, 0)
|
||||
!= Success)
|
||||
return FALSE;
|
||||
}
|
||||
if (!ps->InitIndexed(pScreen, format))
|
||||
|
|
|
|||
|
|
@ -1128,9 +1128,16 @@ ProcRenderAddGlyphs (ClientPtr client)
|
|||
remain -= (sizeof (CARD32) + sizeof (xGlyphInfo)) * nglyphs;
|
||||
for (i = 0; i < nglyphs; i++)
|
||||
{
|
||||
size_t padded_width;
|
||||
glyph_new = &glyphs[i];
|
||||
size = gi[i].height * PixmapBytePad (gi[i].width,
|
||||
glyphSet->format->depth);
|
||||
|
||||
padded_width = PixmapBytePad (gi[i].width,
|
||||
glyphSet->format->depth);
|
||||
|
||||
if (gi[i].height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi[i].height)
|
||||
break;
|
||||
|
||||
size = gi[i].height * padded_width;
|
||||
if (remain < size)
|
||||
break;
|
||||
|
||||
|
|
@ -1573,6 +1580,8 @@ ProcRenderCreateCursor (ClientPtr client)
|
|||
pScreen = pSrc->pDrawable->pScreen;
|
||||
width = pSrc->pDrawable->width;
|
||||
height = pSrc->pDrawable->height;
|
||||
if (height && width > UINT32_MAX/(height*sizeof(CARD32)))
|
||||
return BadAlloc;
|
||||
if ( stuff->x > width
|
||||
|| stuff->y > height )
|
||||
return (BadMatch);
|
||||
|
|
@ -1998,6 +2007,8 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
|
|||
LEGAL_NEW_RESOURCE(stuff->pid, client);
|
||||
|
||||
len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq);
|
||||
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
return BadLength;
|
||||
if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
return BadLength;
|
||||
|
||||
|
|
@ -2586,18 +2597,18 @@ SProcRenderCreateSolidFill(ClientPtr client)
|
|||
return (*ProcRenderVector[stuff->renderReqType]) (client);
|
||||
}
|
||||
|
||||
static void swapStops(void *stuff, int n)
|
||||
static void swapStops(void *stuff, int num)
|
||||
{
|
||||
int i;
|
||||
int i, n;
|
||||
CARD32 *stops;
|
||||
CARD16 *colors;
|
||||
stops = (CARD32 *)(stuff);
|
||||
for (i = 0; i < n; ++i) {
|
||||
for (i = 0; i < num; ++i) {
|
||||
swapl(stops, n);
|
||||
++stops;
|
||||
}
|
||||
colors = (CARD16 *)(stops);
|
||||
for (i = 0; i < 4*n; ++i) {
|
||||
for (i = 0; i < 4*num; ++i) {
|
||||
swaps(stops, n);
|
||||
++stops;
|
||||
}
|
||||
|
|
@ -2620,6 +2631,8 @@ SProcRenderCreateLinearGradient (ClientPtr client)
|
|||
swapl(&stuff->nStops, n);
|
||||
|
||||
len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq);
|
||||
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
return BadLength;
|
||||
if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
return BadLength;
|
||||
|
||||
|
|
@ -2647,6 +2660,8 @@ SProcRenderCreateRadialGradient (ClientPtr client)
|
|||
swapl(&stuff->nStops, n);
|
||||
|
||||
len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq);
|
||||
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
return BadLength;
|
||||
if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
return BadLength;
|
||||
|
||||
|
|
@ -2671,6 +2686,8 @@ SProcRenderCreateConicalGradient (ClientPtr client)
|
|||
swapl(&stuff->nStops, n);
|
||||
|
||||
len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq);
|
||||
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
return BadLength;
|
||||
if (len != stuff->nStops*(sizeof(xFixed) + sizeof(xRenderColor)))
|
||||
return BadLength;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue