diff options
Diffstat (limited to 'hw/xnest')
35 files changed, 505 insertions, 567 deletions
diff --git a/hw/xnest/Args.c b/hw/xnest/Args.c index 197d6cbe1..488179d01 100644 --- a/hw/xnest/Args.c +++ b/hw/xnest/Args.c @@ -12,6 +12,8 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Args.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ + #include "X.h" #include "Xproto.h" #include "screenint.h" @@ -45,10 +47,8 @@ int xnestNumScreens = 0; Bool xnestDoDirectColormaps = False; Window xnestParentWindow = 0; -int ddxProcessArgument (argc, argv, i) - int argc; - char *argv[] ; - int i; +int +ddxProcessArgument (int argc, char *argv[], int i) { if (!strcmp(argv[i], "-display")) { if (++i < argc) { diff --git a/hw/xnest/Args.h b/hw/xnest/Args.h index 25e5cf8e8..dc2ac9de0 100644 --- a/hw/xnest/Args.h +++ b/hw/xnest/Args.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Args.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTARGC_H #define XNESTARGS_H @@ -34,5 +35,6 @@ extern Bool xnestUserBorderWidth; extern char *xnestWindowName; extern int xnestNumScreens; extern Bool xnestDoDirectColormaps; +extern Window xnestParentWindow; #endif /* XNESTARGS_H */ diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c index 61b560800..ae5ded5e3 100644 --- a/hw/xnest/Color.c +++ b/hw/xnest/Color.c @@ -12,6 +12,8 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Color.c,v 1.4 2003/11/16 05:05:20 dawes Exp $ */ + #include "X.h" #include "Xproto.h" #include "scrnintstr.h" @@ -32,8 +34,8 @@ is" without express or implied warranty. static ColormapPtr InstalledMaps[MAXSCREENS]; -Bool xnestCreateColormap(pCmap) - ColormapPtr pCmap; +Bool +xnestCreateColormap(ColormapPtr pCmap) { VisualPtr pVisual; XColor *colors; @@ -118,8 +120,8 @@ Bool xnestCreateColormap(pCmap) return True; } -void xnestDestroyColormap (pCmap) - ColormapPtr pCmap; +void +xnestDestroyColormap(ColormapPtr pCmap) { XFreeColormap(xnestDisplay, xnestColormap(pCmap)); xfree(pCmap->devPriv); @@ -128,9 +130,8 @@ void xnestDestroyColormap (pCmap) #define SEARCH_PREDICATE \ (xnestWindow(pWin) != None && wColormap(pWin) == icws->cmapIDs[i]) -static int xnestCountInstalledColormapWindows(pWin, ptr) - WindowPtr pWin; - pointer ptr; +static int +xnestCountInstalledColormapWindows(WindowPtr pWin, pointer ptr) { xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *)ptr; int i; @@ -144,9 +145,8 @@ static int xnestCountInstalledColormapWindows(pWin, ptr) return WT_WALKCHILDREN; } -static int xnestGetInstalledColormapWindows(pWin, ptr) - WindowPtr pWin; - pointer ptr; +static int +xnestGetInstalledColormapWindows(WindowPtr pWin, pointer ptr) { xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *)ptr; int i; @@ -163,9 +163,8 @@ static int xnestGetInstalledColormapWindows(pWin, ptr) static Window *xnestOldInstalledColormapWindows = NULL; static int xnestNumOldInstalledColormapWindows = 0; -static Bool xnestSameInstalledColormapWindows(windows, numWindows) - Window *windows; - int numWindows; +static Bool +xnestSameInstalledColormapWindows(Window *windows, int numWindows) { if (xnestNumOldInstalledColormapWindows != numWindows) return False; @@ -183,8 +182,8 @@ static Bool xnestSameInstalledColormapWindows(windows, numWindows) return True; } -void xnestSetInstalledColormapWindows(pScreen) - ScreenPtr pScreen; +void +xnestSetInstalledColormapWindows(ScreenPtr pScreen) { xnestInstalledColormapWindows icws; int numWindows; @@ -262,8 +261,8 @@ void xnestSetInstalledColormapWindows(pScreen) if (icws.windows) xfree(icws.windows); } -void xnestSetScreenSaverColormapWindow(pScreen) - ScreenPtr pScreen; +void +xnestSetScreenSaverColormapWindow(ScreenPtr pScreen) { if (xnestOldInstalledColormapWindows) xfree(xnestOldInstalledColormapWindows); @@ -288,8 +287,8 @@ void xnestSetScreenSaverColormapWindow(pScreen) xnestDirectUninstallColormaps(pScreen); } -void xnestDirectInstallColormaps(pScreen) - ScreenPtr pScreen; +void +xnestDirectInstallColormaps(ScreenPtr pScreen) { int i, n; Colormap pCmapIDs[MAXCMAPS]; @@ -307,8 +306,8 @@ void xnestDirectInstallColormaps(pScreen) } } -void xnestDirectUninstallColormaps(pScreen) - ScreenPtr pScreen; +void +xnestDirectUninstallColormaps(ScreenPtr pScreen) { int i, n; Colormap pCmapIDs[MAXCMAPS]; @@ -326,8 +325,8 @@ void xnestDirectUninstallColormaps(pScreen) } } -void xnestInstallColormap(pCmap) - ColormapPtr pCmap; +void +xnestInstallColormap(ColormapPtr pCmap) { int index; ColormapPtr pOldCmap; @@ -351,8 +350,8 @@ void xnestInstallColormap(pCmap) } } -void xnestUninstallColormap(pCmap) - ColormapPtr pCmap; +void +xnestUninstallColormap(ColormapPtr pCmap) { int index; ColormapPtr pCurCmap; @@ -373,9 +372,8 @@ void xnestUninstallColormap(pCmap) static Bool xnestInstalledDefaultColormap = False; -int xnestListInstalledColormaps(pScreen, pCmapIDs) - ScreenPtr pScreen; - Colormap *pCmapIDs; +int +xnestListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIDs) { if (xnestInstalledDefaultColormap) { *pCmapIDs = InstalledMaps[pScreen->myNum]->mid; @@ -385,10 +383,8 @@ int xnestListInstalledColormaps(pScreen, pCmapIDs) return 0; } -void xnestStoreColors(pCmap, nColors, pColors) - ColormapPtr pCmap; - int nColors; - xColorItem *pColors; +void +xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors) { if (pCmap->pVisual->class & DynamicClass) #ifdef _XSERVER64 @@ -413,11 +409,9 @@ void xnestStoreColors(pCmap, nColors, pColors) #endif } -void xnestResolveColor(pRed, pGreen, pBlue, pVisual) - unsigned short *pRed; - unsigned short *pGreen; - unsigned short *pBlue; - VisualPtr pVisual; +void +xnestResolveColor(unsigned short *pRed, unsigned short *pGreen, + unsigned short *pBlue, VisualPtr pVisual) { int shift; unsigned int lim; @@ -465,8 +459,8 @@ void xnestResolveColor(pRed, pGreen, pBlue, pVisual) } } -Bool xnestCreateDefaultColormap(pScreen) - ScreenPtr pScreen; +Bool +xnestCreateDefaultColormap(ScreenPtr pScreen) { VisualPtr pVisual; ColormapPtr pCmap; diff --git a/hw/xnest/Color.h b/hw/xnest/Color.h index 6ba6cd97a..0b3c22581 100644 --- a/hw/xnest/Color.h +++ b/hw/xnest/Color.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Color.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTCOLOR_H #define XNESTCOLOR_H @@ -40,17 +41,18 @@ typedef struct { #define xnestPixel(pixel) (pixel) -Bool xnestCreateColormap(); -void xnestDestroyColormap (); -void xnestSetInstalledColormapWindows(); -void xnestSetScreenSaverColormapWindow(); -void xnestDirectInstallColormaps(); -void xnestDirectUninstallColormaps(); -void xnestInstallColormap(); -void xnestUninstallColormap(); -int xnestListInstalledColormaps(); -void xnestStoreColors(); -void xnestResolveColor(); -Bool xnestCreateDefaultColormap(); +Bool xnestCreateColormap(ColormapPtr pCmap); +void xnestDestroyColormap(ColormapPtr pCmap); +void xnestSetInstalledColormapWindows(ScreenPtr pScreen); +void xnestSetScreenSaverColormapWindow(ScreenPtr pScreen); +void xnestDirectInstallColormaps(ScreenPtr pScreen); +void xnestDirectUninstallColormaps(ScreenPtr pScreen); +void xnestInstallColormap(ColormapPtr pCmap); +void xnestUninstallColormap(ColormapPtr pCmap); +int xnestListInstalledColormaps(ScreenPtr pScreen, Colormap *pCmapIDs); +void xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem *pColors); +void xnestResolveColor(unsigned short *pRed, unsigned short *pGreen, + unsigned short *pBlue, VisualPtr pVisual); +Bool xnestCreateDefaultColormap(ScreenPtr pScreen); #endif /* XNESTCOLOR_H */ diff --git a/hw/xnest/Cursor.c b/hw/xnest/Cursor.c index c20ec940a..52ba867cf 100644 --- a/hw/xnest/Cursor.c +++ b/hw/xnest/Cursor.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Cursor.c,v 1.3 2002/11/23 19:27:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Cursor.c,v 1.4 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xproto.h" @@ -33,9 +33,8 @@ is" without express or implied warranty. #include "Keyboard.h" #include "Args.h" -void xnestConstrainCursor(pScreen, pBox) - ScreenPtr pScreen; - BoxPtr pBox; +void +xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox) { #ifdef _XSERVER64 Window64 wroot; @@ -71,18 +70,15 @@ void xnestConstrainCursor(pScreen, pBox) } } -void xnestCursorLimits(pScreen, pCursor, pHotBox, pTopLeftBox) - ScreenPtr pScreen; - CursorPtr pCursor; - BoxPtr pHotBox; - BoxPtr pTopLeftBox; +void +xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, + BoxPtr pTopLeftBox) { *pTopLeftBox = *pHotBox; } -Bool xnestDisplayCursor(pScreen, pCursor) - ScreenPtr pScreen; - CursorPtr pCursor; +Bool +xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor) { XDefineCursor(xnestDisplay, xnestDefaultWindows[pScreen->myNum], @@ -90,9 +86,8 @@ Bool xnestDisplayCursor(pScreen, pCursor) return True; } -Bool xnestRealizeCursor(pScreen, pCursor) - ScreenPtr pScreen; - CursorPtr pCursor; +Bool +xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) { XImage *ximage; Pixmap source, mask; @@ -171,19 +166,16 @@ Bool xnestRealizeCursor(pScreen, pCursor) return True; } -Bool xnestUnrealizeCursor(pScreen, pCursor) - ScreenPtr pScreen; - CursorPtr pCursor; +Bool +xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) { XFreeCursor(xnestDisplay, xnestCursor(pCursor, pScreen)); xfree(xnestCursorPriv(pCursor, pScreen)); return True; } -void xnestRecolorCursor(pScreen, pCursor, displayed) - ScreenPtr pScreen; - CursorPtr pCursor; - Bool displayed; +void +xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed) { XColor fg_color, bg_color; @@ -200,10 +192,8 @@ void xnestRecolorCursor(pScreen, pCursor, displayed) &fg_color, &bg_color); } -Bool xnestSetCursorPosition(pScreen, x, y, generateEvent) - ScreenPtr pScreen; - int x, y; - Bool generateEvent; +Bool +xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool generateEvent) { int i; diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c index d8cefcc6f..1a8703063 100644 --- a/hw/xnest/Display.c +++ b/hw/xnest/Display.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Display.c,v 3.4 2001/10/28 03:34:10 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Display.c,v 3.5 2003/11/16 05:05:20 dawes Exp $ */ #include <X11/X.h> @@ -51,14 +51,12 @@ XlibGC xnestBitmapGC; Window xnestConfineWindow; unsigned long xnestEventMask; -void xnestOpenDisplay(argc, argv) - int argc; - char *argv[]; +void +xnestOpenDisplay(int argc, char *argv[]) { XVisualInfo vi; long mask; int i, j; - extern Window xnestParentWindow; if (!xnestDoFullGeneration) return; @@ -183,7 +181,8 @@ void xnestOpenDisplay(argc, argv) DefaultScreen(xnestDisplay))); } -void xnestCloseDisplay() +void +xnestCloseDisplay() { if (!xnestDoFullGeneration || !xnestDisplay) return; diff --git a/hw/xnest/Display.h b/hw/xnest/Display.h index 14ed0bb0a..044f8f131 100644 --- a/hw/xnest/Display.h +++ b/hw/xnest/Display.h @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Display.h,v 1.6 2001/01/17 22:36:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Display.h,v 1.7 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTCOMMON_H #define XNESTCOMMON_H @@ -41,7 +41,7 @@ extern XlibGC xnestBitmapGC; extern Window xnestConfineWindow; extern unsigned long xnestEventMask; -void xnestOpenDisplay(); -void xnestCloseDisplay(); +void xnestOpenDisplay(int argc, char *argv[]); +void xnestCloseDisplay(void); #endif /* XNESTCOMMON_H */ diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c index 729296f22..1b7b3935f 100644 --- a/hw/xnest/Events.c +++ b/hw/xnest/Events.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Events.c,v 1.2 2001/08/01 00:44:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Events.c,v 1.3 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #define NEED_EVENTS @@ -28,6 +28,7 @@ is" without express or implied warranty. #include "Xnest.h" +#include "Args.h" #include "Color.h" #include "Display.h" #include "Screen.h" @@ -36,40 +37,40 @@ is" without express or implied warranty. CARD32 lastEventTime = 0; -void ProcessInputEvents() +void +ProcessInputEvents() { mieqProcessInputEvents(); } -int TimeSinceLastInputEvent() +int +TimeSinceLastInputEvent() { if (lastEventTime == 0) lastEventTime = GetTimeInMillis(); return GetTimeInMillis() - lastEventTime; } -void SetTimeSinceLastInputEvent() +void +SetTimeSinceLastInputEvent() { lastEventTime = GetTimeInMillis(); } -static Bool xnestExposurePredicate(display, event, args) - Display *display; - XEvent *event; - char *args; +static Bool +xnestExposurePredicate(Display *display, XEvent *event, char *args) { return (event->type == Expose || event->type == ProcessedExpose); } -static Bool xnestNotExposurePredicate(display, event, args) - Display *display; - XEvent *event; - char *args; +static Bool +xnestNotExposurePredicate(Display *display, XEvent *event, char *args) { return !xnestExposurePredicate(display, event, args); } -void xnestCollectExposures() +void +xnestCollectExposures() { XEvent X; WindowPtr pWin; @@ -92,12 +93,12 @@ void xnestCollectExposures() } } -void xnestCollectEvents() +void +xnestCollectEvents() { XEvent X; xEvent x; ScreenPtr pScreen; - extern Window xnestParentWindow; while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) { switch (X.type) { diff --git a/hw/xnest/Events.h b/hw/xnest/Events.h index dfb44acf5..ed0fbb830 100644 --- a/hw/xnest/Events.h +++ b/hw/xnest/Events.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Events.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTEVENTS_H #define XNESTEVENTS_H @@ -22,7 +23,8 @@ is" without express or implied warranty. extern CARD32 lastEventTime; -void xnestCollectExposures(); -void xnestCollectEvents(); +void SetTimeSinceLastInputEvent(void); +void xnestCollectExposures(void); +void xnestCollectEvents(void); #endif /* XNESTEVENTS_H */ diff --git a/hw/xnest/Font.c b/hw/xnest/Font.c index b30cf45bf..f70848854 100644 --- a/hw/xnest/Font.c +++ b/hw/xnest/Font.c @@ -12,13 +12,13 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Font.c,v 3.5 2001/01/17 22:36:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Font.c,v 3.7 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xatom.h" #include "Xproto.h" #include "misc.h" -#include "miscstruct.h" +#include "regionstr.h" #include "font.h" #include "fontstruct.h" #include "scrnintstr.h" @@ -30,9 +30,8 @@ is" without express or implied warranty. int xnestFontPrivateIndex; -Bool xnestRealizeFont(pScreen, pFont) - ScreenPtr pScreen; - FontPtr pFont; +Bool +xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont) { pointer priv; Atom name_atom, value_atom; @@ -75,9 +74,8 @@ Bool xnestRealizeFont(pScreen, pFont) } -Bool xnestUnrealizeFont(pScreen, pFont) - ScreenPtr pScreen; - FontPtr pFont; +Bool +xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont) { if (xnestFontPriv(pFont)) { if (xnestFontStruct(pFont)) diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c index 0816957de..972849d9a 100644 --- a/hw/xnest/GC.c +++ b/hw/xnest/GC.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/GC.c,v 3.6 2001/10/28 03:34:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/GC.c,v 3.7 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xproto.h" @@ -68,8 +68,8 @@ static GCOps xnestOps = { xnestPushPixels }; -Bool xnestCreateGC(pGC) - GCPtr pGC; +Bool +xnestCreateGC(GCPtr pGC) { pGC->clientClipType = CT_NONE; pGC->clientClip = NULL; @@ -87,18 +87,15 @@ Bool xnestCreateGC(pGC) return True; } -void xnestValidateGC(pGC, changes, pDrawable) - GCPtr pGC; - unsigned long changes; - DrawablePtr pDrawable; +void +xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { pGC->lastWinOrg.x = pDrawable->x; pGC->lastWinOrg.y = pDrawable->y; } -void xnestChangeGC(pGC, mask) - GC *pGC; - unsigned long mask; +void +xnestChangeGC(GCPtr pGC, unsigned long mask) { XGCValues values; @@ -182,25 +179,20 @@ void xnestChangeGC(pGC, mask) XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values); } -void xnestCopyGC(pGCSrc, mask, pGCDst) - GCPtr pGCSrc; - unsigned long mask; - GCPtr pGCDst; +void +xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) { XCopyGC(xnestDisplay, xnestGC(pGCSrc), mask, xnestGC(pGCDst)); } -void xnestDestroyGC(pGC) - GC *pGC; +void +xnestDestroyGC(GCPtr pGC) { XFreeGC(xnestDisplay, xnestGC(pGC)); } -void xnestChangeClip(pGC, type, pValue, nRects) - GCPtr pGC; - int type; - pointer pValue; - int nRects; +void +xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) { int i, size; BoxPtr pBox; @@ -296,8 +288,8 @@ void xnestChangeClip(pGC, type, pValue, nRects) xnestGCPriv(pGC)->nClipRects = nRects; } -void xnestDestroyClip(pGC) - GCPtr pGC; +void +xnestDestroyClip(GCPtr pGC) { xnestDestroyClipHelper(pGC); @@ -308,8 +300,8 @@ void xnestDestroyClip(pGC) xnestGCPriv(pGC)->nClipRects = 0; } -void xnestDestroyClipHelper(pGC) - GCPtr pGC; +void +xnestDestroyClipHelper(GCPtr pGC) { switch (pGC->clientClipType) { @@ -323,9 +315,8 @@ void xnestDestroyClipHelper(pGC) } } -void xnestCopyClip(pGCDst, pGCSrc) - GCPtr pGCSrc; - GCPtr pGCDst; +void +xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc) { RegionPtr pRgn; diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c index 3af24c35a..b43695c96 100644 --- a/hw/xnest/GCOps.c +++ b/hw/xnest/GCOps.c @@ -12,11 +12,11 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.c,v 3.4 2001/01/17 22:36:55 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.c,v 3.6 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xproto.h" -#include "miscstruct.h" +#include "regionstr.h" #include "fontstruct.h" #include "gcstruct.h" #include "scrnintstr.h" @@ -35,45 +35,30 @@ is" without express or implied warranty. #include "Drawable.h" #include "Visual.h" -void xnestFillSpans(pDrawable, pGC, nSpans, pPoints, pWidths, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - int nSpans; - xPoint *pPoints; - int *pWidths; - int fSorted; +void +xnestFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans, xPoint *pPoints, + int *pWidths, int fSorted) { ErrorF("xnest warning: function xnestFillSpans not implemented\n"); } -void xnestSetSpans(pDrawable, pGC, pSrc, pPoints, pWidths, nSpans, fSorted) - DrawablePtr pDrawable; - GCPtr pGC; - unsigned char * pSrc; - xPoint *pPoints; - int *pWidths; - int nSpans; - int fSorted; +void +xnestSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc, + xPoint *pPoints, int *pWidths, int nSpans, int fSorted) { ErrorF("xnest warning: function xnestSetSpans not implemented\n"); } -void xnestGetSpans(pDrawable, maxWidth, pPoints, pWidths, nSpans, pBuffer) - DrawablePtr pDrawable; - int maxWidth; - xPoint *pPoints; - int *pWidths; - int nSpans; - int *pBuffer; +void +xnestGetSpans(DrawablePtr pDrawable, int maxWidth, DDXPointPtr pPoints, + int *pWidths, int nSpans, char *pBuffer) { ErrorF("xnest warning: function xnestGetSpans not implemented\n"); } -void xnestQueryBestSize(class, pWidth, pHeight, pScreen) - int class; - short *pWidth; - short *pHeight; - ScreenPtr pScreen; +void +xnestQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight, + ScreenPtr pScreen) { unsigned int width, height; @@ -88,13 +73,9 @@ void xnestQueryBestSize(class, pWidth, pHeight, pScreen) *pHeight = height; } -void xnestPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, pImage) - DrawablePtr pDrawable; - GCPtr pGC; - int depth, x, y, w, h; - int leftPad; - unsigned int format; - unsigned char *pImage; +void +xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, + int w, int h, int leftPad, int format, char *pImage) { XImage *ximage; @@ -111,12 +92,10 @@ void xnestPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, pImage) } } -void xnestGetImage(pDrawable, x, y, w, h, format, planeMask, pImage) - DrawablePtr pDrawable; - int x, y, w, h; - unsigned int format; - unsigned long planeMask; - unsigned char *pImage; +void +xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, + unsigned int format, unsigned long planeMask, + char *pImage) { XImage *ximage; int length; @@ -133,16 +112,14 @@ void xnestGetImage(pDrawable, x, y, w, h, format, planeMask, pImage) } } -static Bool xnestBitBlitPredicate(display, event, args) - Display *display; - XEvent *event; - char *args; +static Bool +xnestBitBlitPredicate(Display *display, XEvent *event, char *args) { return (event->type == GraphicsExpose || event->type == NoExpose); } -RegionPtr xnestBitBlitHelper(pGC) - GC *pGC; +static RegionPtr +xnestBitBlitHelper(GCPtr pGC) { if (!pGC->graphicsExposures) return NullRegion; @@ -183,14 +160,10 @@ RegionPtr xnestBitBlitHelper(pGC) } } -RegionPtr xnestCopyArea(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty) - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - GC *pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; +RegionPtr +xnestCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, + GCPtr pGC, int srcx, int srcy, int width, int height, + int dstx, int dsty) { XCopyArea(xnestDisplay, xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable), @@ -199,15 +172,10 @@ RegionPtr xnestCopyArea(pSrcDrawable, pDstDrawable, return xnestBitBlitHelper(pGC); } -RegionPtr xnestCopyPlane(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, plane) - DrawablePtr pSrcDrawable; - DrawablePtr pDstDrawable; - GC *pGC; - int srcx, srcy; - int width, height; - int dstx, dsty; - unsigned long plane; +RegionPtr +xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, + GCPtr pGC, int srcx, int srcy, int width, int height, + int dstx, int dsty, unsigned long plane) { XCopyPlane(xnestDisplay, xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable), @@ -216,96 +184,71 @@ RegionPtr xnestCopyPlane(pSrcDrawable, pDstDrawable, return xnestBitBlitHelper(pGC); } -void xnestPolyPoint(pDrawable, pGC, mode, nPoints, pPoints) - DrawablePtr pDrawable; - GCPtr pGC; - int mode; - int nPoints; - XPoint *pPoints; +void +xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints, + DDXPointPtr pPoints) { XDrawPoints(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - pPoints, nPoints, mode); + (XPoint *)pPoints, nPoints, mode); } -void xnestPolylines(pDrawable, pGC, mode, nPoints, pPoints) - DrawablePtr pDrawable; - GCPtr pGC; - int mode; - int nPoints; - XPoint *pPoints; +void +xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints, + DDXPointPtr pPoints) { XDrawLines(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - pPoints, nPoints, mode); + (XPoint *)pPoints, nPoints, mode); } -void xnestPolySegment(pDrawable, pGC, nSegments, pSegments) - DrawablePtr pDrawable; - GCPtr pGC; - int nSegments; - XSegment *pSegments; +void +xnestPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments, + xSegment *pSegments) { XDrawSegments(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - pSegments, nSegments); + (XSegment *)pSegments, nSegments); } -void xnestPolyRectangle(pDrawable, pGC, nRectangles, pRectangles) - DrawablePtr pDrawable; - GCPtr pGC; - int nRectangles; - XRectangle *pRectangles; +void +xnestPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles, + xRectangle *pRectangles) { XDrawRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - pRectangles, nRectangles); + (XRectangle *)pRectangles, nRectangles); } -void xnestPolyArc(pDrawable, pGC, nArcs, pArcs) - DrawablePtr pDrawable; - GCPtr pGC; - int nArcs; - XArc *pArcs; +void +xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs) { XDrawArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - pArcs, nArcs); + (XArc *)pArcs, nArcs); } -void xnestFillPolygon(pDrawable, pGC, shape, mode, nPoints, pPoints) - DrawablePtr pDrawable; - GCPtr pGC; - int shape; - int mode; - int nPoints; - XPoint *pPoints; +void +xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode, + int nPoints, DDXPointPtr pPoints) { XFillPolygon(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - pPoints, nPoints, shape, mode); + (XPoint *)pPoints, nPoints, shape, mode); } -void xnestPolyFillRect(pDrawable, pGC, nRectangles, pRectangles) - DrawablePtr pDrawable; - GCPtr pGC; - int nRectangles; - XRectangle *pRectangles; +void +xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles, + xRectangle *pRectangles) { XFillRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - pRectangles, nRectangles); + (XRectangle *)pRectangles, nRectangles); } -void xnestPolyFillArc(pDrawable, pGC, nArcs, pArcs) - DrawablePtr pDrawable; - GCPtr pGC; - int nArcs; - XArc *pArcs; +void +xnestPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs) { XFillArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - pArcs, nArcs); + (XArc *)pArcs, nArcs); } -int xnestPolyText8(pDrawable, pGC, x, y, count, string) - DrawablePtr pDrawable; - GCPtr pGC; - int x, y; - int count; - char *string; +int +xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, + char *string) { int width; @@ -317,73 +260,55 @@ int xnestPolyText8(pDrawable, pGC, x, y, count, string) return width + x; } -int xnestPolyText16(pDrawable, pGC, x, y, count, string) - DrawablePtr pDrawable; - GCPtr pGC; - int x, y; - int count; - XChar2b *string; +int +xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, + unsigned short *string) { int width; XDrawString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - x, y, string, count); + x, y, (XChar2b *)string, count); - width = XTextWidth16(xnestFontStruct(pGC->font), string, count); + width = XTextWidth16(xnestFontStruct(pGC->font), (XChar2b *)string, count); return width + x; } -void xnestImageText8(pDrawable, pGC, x, y, count, string) - DrawablePtr pDrawable; - GCPtr pGC; - int x, y; - int count; - char *string; +void +xnestImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, + char *string) { XDrawImageString(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), x, y, string, count); } -void xnestImageText16(pDrawable, pGC, x, y, count, string) - DrawablePtr pDrawable; - GCPtr pGC; - int x, y; - int count; - XChar2b *string; +void +xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, + unsigned short *string) { XDrawImageString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), - x, y, string, count); + x, y, (XChar2b *)string, count); } -void xnestImageGlyphBlt(pDrawable, pGC, x, y, nGlyphs, pCharInfo, pGlyphBase) - DrawablePtr pDrawable; - GC pGC; - int x, y; - int nGlyphs; - CharInfoPtr pCharInfo; - char pGlyphBase; +void +xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, + unsigned int nGlyphs, CharInfoPtr *pCharInfo, + pointer pGlyphBase) { ErrorF("xnest warning: function xnestImageGlyphBlt not implemented\n"); } -void xnestPolyGlyphBlt(pDrawable, pGC, x, y, nGlyphs, pCharInfo, pGlyphBase) - DrawablePtr pDrawable; - GC pGC; - int x, y; - int nGlyphs; - CharInfoPtr pCharInfo; - char pGlyphBase; +void +xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, + unsigned int nGlyphs, CharInfoPtr *pCharInfo, + pointer pGlyphBase) { ErrorF("xnest warning: function xnestPolyGlyphBlt not implemented\n"); } -void xnestPushPixels(pDrawable, pGC, pBitmap, width, height, x, y) - DrawablePtr pDrawable; - GC pGC; - PixmapPtr pBitmap; - int width, height; - int x, y; +void +xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDst, + int width, int height, int x, int y) { ErrorF("xnest warning: function xnestPushPixels not implemented\n"); } diff --git a/hw/xnest/GCOps.h b/hw/xnest/GCOps.h index 3d4f3d2d4..722dde470 100644 --- a/hw/xnest/GCOps.h +++ b/hw/xnest/GCOps.h @@ -12,32 +12,59 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTGCOPS_H #define XNESTGCOPS_H -void xnestFillSpans(); -void xnestSetSpans(); -void xnestGetSpans(); -void xnestPutImage(); -void xnestGetImage(); -RegionPtr xnestCopyArea(); -RegionPtr xnestCopyPlane(); -void xnestQueryBestSize(); -void xnestPolyPoint(); -void xnestPolylines(); -void xnestPolySegment(); -void xnestPolyRectangle(); -void xnestPolyArc(); -void xnestFillPolygon(); -void xnestPolyFillRect(); -void xnestPolyFillArc(); -int xnestPolyText8(); -int xnestPolyText16(); -void xnestImageText8(); -void xnestImageText16(); -void xnestImageGlyphBlt(); -void xnestPolyGlyphBlt(); -void xnestPushPixels(); +void xnestFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nSpans, + xPoint *pPoints, int *pWidths, int fSorted); +void xnestSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *pSrc, + xPoint *pPoints, int *pWidths, int nSpans, int fSorted); +void xnestGetSpans(DrawablePtr pDrawable, int maxWidth, DDXPointPtr pPoints, + int *pWidths, int nSpans, char *pBuffer); +void xnestQueryBestSize(int class, unsigned short *pWidth, + unsigned short *pHeight, ScreenPtr pScreen); +void xnestPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, + int w, int h, int leftPad, int format, char *pImage); +void xnestGetImage(DrawablePtr pDrawable, int x, int y, int w, int h, + unsigned int format, unsigned long planeMask, + char *pImage); +RegionPtr xnestCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, + GCPtr pGC, int srcx, int srcy, int width, int height, + int dstx, int dsty); +RegionPtr xnestCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, + GCPtr pGC, int srcx, int srcy, int width, int height, + int dstx, int dsty, unsigned long plane); +void xnestPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints, + DDXPointPtr pPoints); +void xnestPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints, + DDXPointPtr pPoints); +void xnestPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nSegments, + xSegment *pSegments); +void xnestPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nRectangles, + xRectangle *pRectangles); +void xnestPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs); +void xnestFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, int mode, + int nPoints, DDXPointPtr pPoints); +void xnestPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nRectangles, + xRectangle *pRectangles); +void xnestPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs); +int xnestPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, + char *string); +int xnestPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, + unsigned short *string); +void xnestImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, + char *string); +void xnestImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, + unsigned short *string); +void xnestImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, + unsigned int nGlyphs, CharInfoPtr *pCharInfo, + pointer pGlyphBase); +void xnestPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, int x, int y, + unsigned int nGlyphs, CharInfoPtr *pCharInfo, + pointer pGlyphBase); +void xnestPushPixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, + int width, int height, int x, int y); #endif /* XNESTGCOPS_H */ diff --git a/hw/xnest/GetTime.c b/hw/xnest/GetTime.c index 5fdef2a12..3db9b8596 100644 --- a/hw/xnest/GetTime.c +++ b/hw/xnest/GetTime.c @@ -28,12 +28,14 @@ other dealings in this Software without prior written authorization from the X Consortium. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/GetTime.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #include "Xos.h" +#include "os.h" #include <time.h> -long +CARD32 GetTimeInMillis() { struct timeval tp; diff --git a/hw/xnest/Handlers.c b/hw/xnest/Handlers.c index d65116b0d..693c7296b 100644 --- a/hw/xnest/Handlers.c +++ b/hw/xnest/Handlers.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Handlers.c,v 1.2 2001/08/01 00:44:57 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Handlers.c,v 1.3 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xproto.h" @@ -29,18 +29,15 @@ is" without express or implied warranty. #include "Events.h" #include "Handlers.h" -void xnestBlockHandler(blockData, pTimeout, pReadMask) - pointer blockData; - pointer pTimeout; - pointer pReadMask; +void +xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask) { xnestCollectExposures(); XFlush(xnestDisplay); } -void xnestWakeupHandler(result, pReadMask) - int result; - pointer pReadMask; +void +xnestWakeupHandler(pointer blockData, int result, pointer pReadMask) { xnestCollectEvents(); } diff --git a/hw/xnest/Handlers.h b/hw/xnest/Handlers.h index b33e9890d..ae92352d1 100644 --- a/hw/xnest/Handlers.h +++ b/hw/xnest/Handlers.h @@ -12,11 +12,13 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Handlers.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTHANDLERS_H #define XNESTHANDLERS_H -void xnestBlockHandler(); -void xnestWakeupHandler(); +void xnestBlockHandler(pointer blockData, OSTimePtr pTimeout, + pointer pReadMask); +void xnestWakeupHandler(pointer blockData, int result, pointer pReadMask); #endif /* XNESTHANDLERS_H */ diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index 665aec182..6b3c4f19f 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Init.c,v 3.24 2003/01/15 02:34:14 torrey Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Init.c,v 3.25 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xproto.h" @@ -37,13 +37,14 @@ is" without express or implied warranty. #include "Drawable.h" #include "XNGC.h" #include "XNFont.h" +#ifdef DPMSExtension +#include "dpmsproc.h" +#endif Bool xnestDoFullGeneration = True; -void InitOutput(screenInfo, argc, argv) - ScreenInfo *screenInfo; - int argc; - char *argv[]; +void +InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) { int i, j; @@ -83,9 +84,8 @@ void InitOutput(screenInfo, argc, argv) xnestDoFullGeneration = xnestFullGeneration; } -void InitInput(argc, argv) - int argc; - char *argv[]; +void +InitInput(int argc, char *argv[]) { pointer ptr, kbd; @@ -163,18 +163,19 @@ int SelectWaitTime = 10000; /* usec */ * ***************************************************************/ -void DPMSSet (level) - int level; +void +DPMSSet(int level) { } -int DPMSGet (level) - int* level; +int +DPMSGet(int *level) { return -1; } -Bool DPMSSupported () +Bool +DPMSSupported() { return FALSE; } diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index 107caee90..eb9291878 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.8 2001/10/28 03:34:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.c,v 1.10 2003/11/16 05:05:20 dawes Exp $ */ #define NEED_EVENTS #include "X.h" @@ -36,31 +36,26 @@ is" without express or implied warranty. #include <X11/extensions/XKBsrv.h> #include <X11/extensions/XKBconfig.h> -extern Bool XkbQueryExtension( -#if NeedFunctionPrototypes +extern Bool +XkbQueryExtension( Display * /* dpy */, int * /* opcodeReturn */, int * /* eventBaseReturn */, int * /* errorBaseReturn */, int * /* majorRtrn */, int * /* minorRtrn */ -#endif ); extern XkbDescPtr XkbGetKeyboard( -#if NeedFunctionPrototypes Display * /* dpy */, unsigned int /* which */, unsigned int /* deviceSpec */ -#endif ); extern Status XkbGetControls( -#if NeedFunctionPrototypes Display * /* dpy */, unsigned long /* which */, XkbDescPtr /* desc */ -#endif ); #ifndef XKB_BASE_DIRECTORY @@ -85,21 +80,16 @@ extern Status XkbGetControls( #define XKB_DFLT_KB_OPTIONS NULL #endif -extern Bool noXkbExtension; #endif -void xnestBell(volume, pDev, ctrl, cls) - int volume; - DeviceIntPtr pDev; - pointer ctrl; - int cls; +void +xnestBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls) { XBell(xnestDisplay, volume); } -void xnestChangeKeyboardControl(pDev, ctrl) - DeviceIntPtr pDev; - KeybdCtrl *ctrl; +void +xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl) { #if 0 unsigned long value_mask; @@ -136,10 +126,8 @@ void xnestChangeKeyboardControl(pDev, ctrl) #endif } -int xnestKeyboardProc(pDev, onoff, argc, argv) - DevicePtr pDev; - int onoff, argc; - char *argv[]; +int +xnestKeyboardProc(DeviceIntPtr pDev, int onoff) { XModifierKeymap *modifier_keymap; KeySym *keymap; @@ -202,7 +190,7 @@ XkbError: memmove((char *) defaultKeyboardControl.autoRepeats, (char *) values.auto_repeats, sizeof(values.auto_repeats)); - InitKeyboardDeviceStruct(pDev, &keySyms, modmap, + InitKeyboardDeviceStruct(&pDev->public, &keySyms, modmap, xnestBell, xnestChangeKeyboardControl); #ifdef XKB } else { @@ -260,9 +248,9 @@ XkbError: } XkbSetRulesDflts(rules, model, layout, variants, options); - XkbInitKeyboardDeviceStruct((pointer)pDev, &names, &keySyms, modmap, + XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modmap, xnestBell, xnestChangeKeyboardControl); - XkbDDXChangeControls((pointer)pDev, xkb->ctrls, xkb->ctrls); + XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); XkbFreeKeyboard(xkb, 0, False); } #endif @@ -288,9 +276,8 @@ XkbError: return Success; } -Bool LegalModifier(key, pDev) - unsigned int key; - DevicePtr pDev; +Bool +LegalModifier(unsigned int key, DevicePtr pDev) { return TRUE; } diff --git a/hw/xnest/Keyboard.h b/hw/xnest/Keyboard.h index 44feb300d..5f8dc3cb4 100644 --- a/hw/xnest/Keyboard.h +++ b/hw/xnest/Keyboard.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Keyboard.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTKEYBOARD_H #define XNESTKEYBOARD_H @@ -19,8 +20,8 @@ is" without express or implied warranty. #define XNEST_KEYBOARD_EVENT_MASK \ (KeyPressMask | KeyReleaseMask | FocusChangeMask | KeymapStateMask) -void xnestBell(); -void xnestChangeKeyboardControl(); -int xnestKeyboardProc(); +void xnestBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls); +void xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl); +int xnestKeyboardProc(DeviceIntPtr pDev, int onoff); #endif /* XNESTKEYBOARD_H */ diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c index f93dcac52..b82dfa49b 100644 --- a/hw/xnest/Pixmap.c +++ b/hw/xnest/Pixmap.c @@ -12,11 +12,11 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Pixmap.c,v 3.6 2003/01/10 13:29:40 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Pixmap.c,v 3.8 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xproto.h" -#include "miscstruct.h" +#include "regionstr.h" #include "pixmapstr.h" #include "scrnintstr.h" #include "regionstr.h" @@ -34,11 +34,8 @@ is" without express or implied warranty. int xnestPixmapPrivateIndex; #endif -PixmapPtr xnestCreatePixmap(pScreen, width, height, depth) - ScreenPtr pScreen; - int width; - int height; - int depth; +PixmapPtr +xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) { PixmapPtr pPixmap; @@ -75,8 +72,8 @@ PixmapPtr xnestCreatePixmap(pScreen, width, height, depth) return pPixmap; } -Bool xnestDestroyPixmap(pPixmap) - PixmapPtr pPixmap; +Bool +xnestDestroyPixmap(PixmapPtr pPixmap) { if(--pPixmap->refcnt) return TRUE; @@ -85,8 +82,8 @@ Bool xnestDestroyPixmap(pPixmap) return TRUE; } -RegionPtr xnestPixmapToRegion(pPixmap) - PixmapPtr pPixmap; +RegionPtr +xnestPixmapToRegion(PixmapPtr pPixmap) { XImage *ximage; register RegionPtr pReg, pTmpReg; diff --git a/hw/xnest/Pointer.c b/hw/xnest/Pointer.c index 741989652..1af5f02ec 100644 --- a/hw/xnest/Pointer.c +++ b/hw/xnest/Pointer.c @@ -12,9 +12,12 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Pointer.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ + #include "X.h" #include "Xproto.h" #include "screenint.h" +#include "inputstr.h" #include "input.h" #include "misc.h" #include "scrnintstr.h" @@ -28,18 +31,15 @@ is" without express or implied warranty. #include "Pointer.h" #include "Args.h" -void xnestChangePointerControl(pDev, ctrl) - DeviceIntPtr pDev; - PtrCtrl *ctrl; +void +xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) { XChangePointerControl(xnestDisplay, True, True, ctrl->num, ctrl->den, ctrl->threshold); } -int xnestPointerProc(pDev, onoff, argc, argv) - DevicePtr pDev; - int onoff, argc; - char *argv[]; +int +xnestPointerProc(DeviceIntPtr pDev, int onoff) { CARD8 map[MAXBUTTONS]; int nmap; @@ -51,7 +51,7 @@ int xnestPointerProc(pDev, onoff, argc, argv) nmap = XGetPointerMapping(xnestDisplay, map, MAXBUTTONS); for (i = 0; i <= nmap; i++) map[i] = i; /* buttons are already mapped */ - InitPointerDeviceStruct(pDev, map, nmap, + InitPointerDeviceStruct(&pDev->public, map, nmap, miPointerGetMotionEvents, xnestChangePointerControl, miPointerGetMotionBufferSize()); diff --git a/hw/xnest/Pointer.h b/hw/xnest/Pointer.h index 2fced12e2..0b06e5021 100644 --- a/hw/xnest/Pointer.h +++ b/hw/xnest/Pointer.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Pointer.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTPOINTER_H #define XNESTPOINTER_H @@ -22,7 +23,7 @@ is" without express or implied warranty. (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \ EnterWindowMask | LeaveWindowMask) -void xnestChangePointerControl(); -int xnestPointerProc(); +void xnestChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl); +int xnestPointerProc(DeviceIntPtr pDev, int onoff); #endif /* XNESTPOINTER_H */ diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index bef6a75dd..686884555 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.c,v 3.11 2003/01/10 13:29:40 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.c,v 3.13 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xproto.h" @@ -20,6 +20,7 @@ is" without express or implied warranty. #include "dix.h" #include "mi.h" #include "mibstore.h" +#include "micmap.h" #include "colormapst.h" #include "resource.h" @@ -39,17 +40,19 @@ is" without express or implied warranty. #include "mipointer.h" #include "Args.h" -extern Window xnestParentWindow; - Window xnestDefaultWindows[MAXSCREENS]; Window xnestScreenSaverWindows[MAXSCREENS]; +#ifdef GLXEXT +extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); +#endif + #ifdef PIXPRIV int xnestScreenGeneration = -1; #endif -ScreenPtr xnestScreen(window) - Window window; +ScreenPtr +xnestScreen(Window window) { int i; @@ -60,8 +63,8 @@ ScreenPtr xnestScreen(window) return NULL; } -static int offset(mask) - unsigned long mask; +static int +offset(unsigned long mask) { int count; @@ -71,9 +74,8 @@ static int offset(mask) return count; } -static Bool xnestSaveScreen(pScreen, what) - ScreenPtr pScreen; - int what; +static Bool +xnestSaveScreen(ScreenPtr pScreen, int what) { if (xnestSoftwareScreenSaver) return False; @@ -105,17 +107,13 @@ static Bool xnestSaveScreen(pScreen, what) } static Bool -xnestCursorOffScreen (ppScreen, x, y) - ScreenPtr *ppScreen; - int *x, *y; +xnestCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) { return FALSE; } static void -xnestCrossScreen (pScreen, entering) - ScreenPtr pScreen; - Bool entering; +xnestCrossScreen(ScreenPtr pScreen, Bool entering) { } @@ -126,11 +124,8 @@ static miPointerScreenFuncRec xnestPointerCursorFuncs = miPointerWarpCursor }; -Bool xnestOpenScreen(index, pScreen, argc, argv) - int index; - register ScreenPtr pScreen; - int argc; - char *argv[]; +Bool +xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) { VisualPtr visuals; DepthPtr depths; @@ -140,6 +135,8 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) XSetWindowAttributes attributes; XWindowAttributes gattributes; XSizeHints sizeHints; + VisualID defaultVisual; + int rootDepth; if (!(AllocateWindowPrivate(pScreen, xnestWindowPrivateIndex, sizeof(xnestPrivWin)) && @@ -168,7 +165,6 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) numDepths = 1; for (i = 0; i < xnestNumVisuals; i++) { - visuals[numVisuals].vid = FakeClientID(0); visuals[numVisuals].class = xnestVisuals[i].class; visuals[numVisuals].bitsPerRGBValue = xnestVisuals[i].bits_per_rgb; visuals[numVisuals].ColormapEntries = xnestVisuals[i].colormap_size; @@ -179,7 +175,26 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) visuals[numVisuals].offsetRed = offset(xnestVisuals[i].red_mask); visuals[numVisuals].offsetGreen = offset(xnestVisuals[i].green_mask); visuals[numVisuals].offsetBlue = offset(xnestVisuals[i].blue_mask); - + + /* Check for and remove duplicates. */ + for (j = 0; j < numVisuals; j++) { + if (visuals[numVisuals].class == visuals[j].class && + visuals[numVisuals].bitsPerRGBValue == visuals[j].bitsPerRGBValue && + visuals[numVisuals].ColormapEntries == visuals[j].ColormapEntries && + visuals[numVisuals].nplanes == visuals[j].nplanes && + visuals[numVisuals].redMask == visuals[j].redMask && + visuals[numVisuals].greenMask == visuals[j].greenMask && + visuals[numVisuals].blueMask == visuals[j].blueMask && + visuals[numVisuals].offsetRed == visuals[j].offsetRed && + visuals[numVisuals].offsetGreen == visuals[j].offsetGreen && + visuals[numVisuals].offsetBlue == visuals[j].offsetBlue) + break; + } + if (j < numVisuals) + break; + + visuals[numVisuals].vid = FakeClientID(0); + depthIndex = UNDEFINED; for (j = 0; j < numDepths; j++) if (depths[j].depth == xnestVisuals[i].depth) { @@ -204,6 +219,21 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) numVisuals++; } + visuals = (VisualPtr)xrealloc(visuals, numVisuals * sizeof(VisualRec)); + + defaultVisual = visuals[xnestDefaultVisualIndex].vid; + rootDepth = visuals[xnestDefaultVisualIndex].nplanes; + +#ifdef GLXEXT + { + miInitVisualsProcPtr proc = NULL; + + GlxWrapInitVisuals(&proc); + /* GlxInitVisuals ignores the last three arguments. */ + proc(&visuals, &depths, &numVisuals, &numDepths, + &rootDepth, &defaultVisual, 0, 0, 0); + } +#endif if (xnestParentWindow != 0) { XGetWindowAttributes(xnestDisplay, xnestParentWindow, &gattributes); @@ -214,9 +244,9 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) /* myNum */ /* id */ miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth, - visuals[xnestDefaultVisualIndex].nplanes, /* rootDepth */ + rootDepth, numDepths, depths, - visuals[xnestDefaultVisualIndex].vid, /* root visual */ + defaultVisual, /* root visual */ numVisuals, visuals); miInitializeBackingStore(pScreen); @@ -257,8 +287,8 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) pScreen->SaveScreen = xnestSaveScreen; pScreen->GetImage = xnestGetImage; pScreen->GetSpans = xnestGetSpans; - pScreen->PointerNonInterestBox = (void (*)()) 0; - pScreen->SourceValidate = (void (*)()) 0; + pScreen->PointerNonInterestBox = NULL; + pScreen->SourceValidate = NULL; /* Window Procedures */ @@ -268,7 +298,7 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) pScreen->ChangeWindowAttributes = xnestChangeWindowAttributes; pScreen->RealizeWindow = xnestRealizeWindow; pScreen->UnrealizeWindow = xnestUnrealizeWindow; - pScreen->PostValidateTree = (void (*)()) 0; + pScreen->PostValidateTree = NULL; pScreen->WindowExposures = xnestWindowExposures; pScreen->PaintWindowBackground = xnestPaintWindowBackground; pScreen->PaintWindowBorder = xnestPaintWindowBorder; @@ -282,12 +312,12 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) /* Backing store procedures */ - pScreen->SaveDoomedAreas = (void (*)()) 0; - pScreen->RestoreAreas = (RegionPtr (*)()) 0; - pScreen->ExposeCopy = (void (*)()) 0; - pScreen->TranslateBackingStore = (RegionPtr (*)()) 0; - pScreen->ClearBackingStore = (RegionPtr (*)()) 0; - pScreen->DrawGuarantee = (void (*)()) 0; + pScreen->SaveDoomedAreas = NULL; + pScreen->RestoreAreas = NULL; + pScreen->ExposeCopy = NULL; + pScreen->TranslateBackingStore = NULL; + pScreen->ClearBackingStore = NULL; + pScreen->DrawGuarantee = NULL; /* Font procedures */ @@ -322,10 +352,10 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) /* OS layer procedures */ - pScreen->BlockHandler = (void (*)())NoopDDA; - pScreen->WakeupHandler = (void (*)())NoopDDA; - pScreen->blockData = (pointer)0; - pScreen->wakeupData = (pointer)0; + pScreen->BlockHandler = (ScreenBlockHandlerProcPtr)NoopDDA; + pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr)NoopDDA; + pScreen->blockData = NULL; + pScreen->wakeupData = NULL; if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL)) return FALSE; @@ -397,9 +427,8 @@ Bool xnestOpenScreen(index, pScreen, argc, argv) return True; } -Bool xnestCloseScreen(index, pScreen) - int index; - ScreenPtr pScreen; +Bool +xnestCloseScreen(int index, ScreenPtr pScreen) { int i; diff --git a/hw/xnest/Screen.h b/hw/xnest/Screen.h index 7c8115d8a..96260435b 100644 --- a/hw/xnest/Screen.h +++ b/hw/xnest/Screen.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTSCREEN_H #define XNESTSCREEN_H @@ -19,8 +20,8 @@ is" without express or implied warranty. extern Window xnestDefaultWindows[MAXSCREENS]; extern Window xnestScreenSaverWindows[MAXSCREENS]; -ScreenPtr xnestScreen(); -Bool xnestOpenScreen(); -Bool xnestCloseScreen(); +ScreenPtr xnestScreen(Window window); +Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]); +Bool xnestCloseScreen(int index, ScreenPtr pScreen); #endif /* XNESTSCREEN_H */ diff --git a/hw/xnest/TestExt.c b/hw/xnest/TestExt.c index 7f5a5907d..f153b5b2c 100644 --- a/hw/xnest/TestExt.c +++ b/hw/xnest/TestExt.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/TestExt.c,v 3.5 2001/08/27 17:41:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/TestExt.c,v 3.6 2003/11/16 05:05:20 dawes Exp $ */ #include <X11/X.h> #include <X11/Xproto.h> @@ -26,12 +26,12 @@ is" without express or implied warranty. #include "mipointer.h" #define XTestSERVER_SIDE #include "xtestext1.h" +#include "xtest1dd.h" extern CARD32 lastEventTime; -void XTestGetPointerPos(fmousex, fmousey) - short *fmousex; - short *fmousey; +void +XTestGetPointerPos(short *fmousex, short *fmousey) { int x,y; @@ -40,20 +40,15 @@ void XTestGetPointerPos(fmousex, fmousey) *fmousey = y; } -void XTestJumpPointer(jx, jy, dev_type) - int jx; - int jy; - int dev_type; +void +XTestJumpPointer(int jx, int jy, int dev_type) { miPointerAbsoluteCursor(jx, jy, GetTimeInMillis()); } -void XTestGenerateEvent(dev_type, keycode, keystate, mousex, mousey) - int dev_type; - int keycode; - int keystate; - int mousex; - int mousey; +void +XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex, + int mousey) { /* xEvent tevent; diff --git a/hw/xnest/Visual.c b/hw/xnest/Visual.c index d512dba95..bcf7881eb 100644 --- a/hw/xnest/Visual.c +++ b/hw/xnest/Visual.c @@ -12,6 +12,8 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Visual.c,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ + #include "X.h" #include "Xproto.h" #include "scrnintstr.h" @@ -23,8 +25,8 @@ is" without express or implied warranty. #include "Display.h" #include "Visual.h" -Visual *xnestVisual(pVisual) - VisualPtr pVisual; +Visual * +xnestVisual(VisualPtr pVisual) { int i; @@ -41,9 +43,8 @@ Visual *xnestVisual(pVisual) return NULL; } -Visual *xnestVisualFromID(pScreen, visual) - ScreenPtr pScreen; - VisualID visual; +Visual * +xnestVisualFromID(ScreenPtr pScreen, VisualID visual) { int i; @@ -54,8 +55,8 @@ Visual *xnestVisualFromID(pScreen, visual) return NULL; } -Colormap xnestDefaultVisualColormap(visual) - Visual *visual; +Colormap +xnestDefaultVisualColormap(Visual *visual) { int i; diff --git a/hw/xnest/Visual.h b/hw/xnest/Visual.h index 818393178..14e0085dc 100644 --- a/hw/xnest/Visual.h +++ b/hw/xnest/Visual.h @@ -12,13 +12,14 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Visual.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTVISUAL_H #define XNESTVISUAL_H -Visual *xnestVisual(); -Visual *xnestVisualFromID(); -Colormap xnestDefaultVisualColormap(); +Visual *xnestVisual(VisualPtr pVisual); +Visual *xnestVisualFromID(ScreenPtr pScreen, VisualID visual); +Colormap xnestDefaultVisualColormap(Visual *visual); #define xnestDefaultVisual(pScreen) \ xnestVisualFromID((pScreen), (pScreen)->rootVisual) diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index a5dfc2de1..14ddac082 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/Window.c,v 3.7 2001/10/28 03:34:11 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Window.c,v 3.8 2003/11/16 05:05:20 dawes Exp $ */ #include "X.h" #include "Xproto.h" @@ -39,9 +39,8 @@ is" without express or implied warranty. int xnestWindowPrivateIndex; -static int xnestFindWindowMatch(pWin, ptr) - WindowPtr pWin; - pointer ptr; +static int +xnestFindWindowMatch(WindowPtr pWin, pointer ptr) { xnestWindowMatch *wm = (xnestWindowMatch *)ptr; if (wm->window == xnestWindow(pWin)) { @@ -52,8 +51,8 @@ static int xnestFindWindowMatch(pWin, ptr) return WT_WALKCHILDREN; } -WindowPtr xnestWindowPtr(window) - Window window; +WindowPtr +xnestWindowPtr(Window window) { xnestWindowMatch wm; int i; @@ -69,8 +68,8 @@ WindowPtr xnestWindowPtr(window) return wm.pWin; } -Bool xnestCreateWindow(pWin) - WindowPtr pWin; +Bool +xnestCreateWindow(WindowPtr pWin) { unsigned long mask; XSetWindowAttributes attributes; @@ -143,8 +142,8 @@ Bool xnestCreateWindow(pWin) return True; } -Bool xnestDestroyWindow(pWin) - WindowPtr pWin; +Bool +xnestDestroyWindow(WindowPtr pWin) { if (pWin->nextSib) xnestWindowPriv(pWin->nextSib)->sibling_above = @@ -164,9 +163,8 @@ Bool xnestDestroyWindow(pWin) return True; } -Bool xnestPositionWindow(pWin, x, y) - WindowPtr pWin; - int x, y; +Bool +xnestPositionWindow(WindowPtr pWin, int x, int y) { xnestConfigureWindow(pWin, CWParent | @@ -177,9 +175,8 @@ Bool xnestPositionWindow(pWin, x, y) return True; } -void xnestConfigureWindow(pWin, mask) - WindowPtr pWin; - unsigned int mask; +void +xnestConfigureWindow(WindowPtr pWin, unsigned int mask) { unsigned int valuemask; XWindowChanges values; @@ -267,9 +264,8 @@ void xnestConfigureWindow(pWin, mask) } } -Bool xnestChangeWindowAttributes(pWin, mask) - WindowPtr pWin; - unsigned long mask; +Bool +xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask) { XSetWindowAttributes attributes; @@ -360,8 +356,8 @@ Bool xnestChangeWindowAttributes(pWin, mask) return True; } -Bool xnestRealizeWindow(pWin) - WindowPtr pWin; +Bool +xnestRealizeWindow(WindowPtr pWin) { xnestConfigureWindow(pWin, CWStackingOrder); #ifdef SHAPE @@ -372,18 +368,16 @@ Bool xnestRealizeWindow(pWin) return True; } -Bool xnestUnrealizeWindow(pWin) - WindowPtr pWin; +Bool +xnestUnrealizeWindow(WindowPtr pWin) { XUnmapWindow(xnestDisplay, xnestWindow(pWin)); return True; } -void xnestPaintWindowBackground(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; +void +xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) { int i; BoxPtr pBox; @@ -400,24 +394,19 @@ void xnestPaintWindowBackground(pWin, pRegion, what) False); } -void xnestPaintWindowBorder(pWin, pRegion, what) - WindowPtr pWin; - RegionPtr pRegion; - int what; +void +xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what) { xnestConfigureWindow(pWin, CWBorderWidth); } -void xnestCopyWindow(pWin, oldOrigin, oldRegion) - WindowPtr pWin; - xPoint oldOrigin; - RegionPtr oldRegion; +void +xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion) { } -void xnestClipNotify(pWin, dx, dy) - WindowPtr pWin; - int dx, dy; +void +xnestClipNotify(WindowPtr pWin, int dx, int dy) { xnestConfigureWindow(pWin, CWStackingOrder); #ifdef SHAPE @@ -425,17 +414,14 @@ void xnestClipNotify(pWin, dx, dy) #endif /* SHAPE */ } -static Bool xnestWindowExposurePredicate(display, event, ptr) - Display *display; - XEvent *event; - XPointer ptr; +static Bool +xnestWindowExposurePredicate(Display *display, XEvent *event, XPointer ptr) { return (event->type == Expose && event->xexpose.window == *(Window *)ptr); } -void xnestWindowExposures(pWin, pRgn, other_exposed) - WindowPtr pWin; - RegionPtr pRgn, other_exposed; +void +xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed) { XEvent event; Window window; @@ -463,8 +449,8 @@ void xnestWindowExposures(pWin, pRgn, other_exposed) } #ifdef SHAPE -static Bool xnestRegionEqual(pReg1, pReg2) - RegionPtr pReg1, pReg2; +static Bool +xnestRegionEqual(RegionPtr pReg1, RegionPtr pReg2) { BoxPtr pBox1, pBox2; unsigned int n1, n2; @@ -488,8 +474,8 @@ static Bool xnestRegionEqual(pReg1, pReg2) return True; } -void xnestShapeWindow(pWin) - WindowPtr pWin; +void +xnestShapeWindow(WindowPtr pWin) { Region reg; BoxPtr pBox; diff --git a/hw/xnest/XNCursor.h b/hw/xnest/XNCursor.h index 5bf362e77..7d9426d72 100644 --- a/hw/xnest/XNCursor.h +++ b/hw/xnest/XNCursor.h @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/XNCursor.h,v 1.2 2002/11/23 19:27:50 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/XNCursor.h,v 1.3 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTCURSOR_H #define XNESTCURSOR_H @@ -27,12 +27,14 @@ typedef struct { #define xnestCursor(pCursor, pScreen) \ (xnestCursorPriv(pCursor, pScreen)->cursor) -void xnestConstrainCursor(); -void xnestCursorLimits(); -Bool xnestDisplayCursor(); -Bool xnestRealizeCursor(); -Bool xnestUnrealizeCursor(); -void xnestRecolorCursor(); -Bool xnestSetCursorPosition(); +void xnestConstrainCursor(ScreenPtr pScreen, BoxPtr pBox); +void xnestCursorLimits(ScreenPtr pScreen, CursorPtr pCursor, BoxPtr pHotBox, + BoxPtr pTopLeftBox); +Bool xnestDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor); +Bool xnestRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); +Bool xnestUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor); +void xnestRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool displayed); +Bool xnestSetCursorPosition(ScreenPtr pScreen, int x, int y, + Bool generateEvent); #endif /* XNESTCURSOR_H */ diff --git a/hw/xnest/XNFont.h b/hw/xnest/XNFont.h index 2885517ac..34d236f3b 100644 --- a/hw/xnest/XNFont.h +++ b/hw/xnest/XNFont.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/XNFont.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTFONT_H @@ -30,7 +31,7 @@ extern int xnestFontPrivateIndex; #define xnestFont(pFont) (xnestFontStruct(pFont)->fid) -Bool xnestRealizeFont(); -Bool xnestUnrealizeFont(); +Bool xnestRealizeFont(ScreenPtr pScreen, FontPtr pFont); +Bool xnestUnrealizeFont(ScreenPtr pScreen, FontPtr pFont); #endif /* XNESTFONT_H */ diff --git a/hw/xnest/XNGC.h b/hw/xnest/XNGC.h index fe2d77de3..bbec67120 100644 --- a/hw/xnest/XNGC.h +++ b/hw/xnest/XNGC.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/XNGC.h,v 1.2 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTGC_H #define XNESTGC_H @@ -30,14 +31,14 @@ extern int xnestGCPrivateIndex; #define xnestGC(pGC) (xnestGCPriv(pGC)->gc) -Bool xnestCreateGC(); -void xnestValidateGC(); -void xnestChangeGC(); -void xnestCopyGC(); -void xnestDestroyGC(); -void xnestChangeClip(); -void xnestDestroyClip(); -void xnestDestroyClipHelper(); -void xnestCopyClip(); +Bool xnestCreateGC(GCPtr pGC); +void xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable); +void xnestChangeGC(GCPtr pGC, unsigned long mask); +void xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); +void xnestDestroyGC(GCPtr pGC); +void xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects); +void xnestDestroyClip(GCPtr pGC); +void xnestDestroyClipHelper(GCPtr pGC); +void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc); #endif /* XNESTGC_H */ diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h index 1657ae449..4e4d9c40c 100644 --- a/hw/xnest/XNPixmap.h +++ b/hw/xnest/XNPixmap.h @@ -12,7 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ -/* $XFree86: xc/programs/Xserver/hw/xnest/XNPixmap.h,v 1.3 2003/01/10 13:29:40 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/XNPixmap.h,v 1.4 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTPIXMAP_H #define XNESTPIXMAP_H @@ -37,8 +37,9 @@ typedef struct { #define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++) -PixmapPtr xnestCreatePixmap(); -Bool xnestDestroyPixmap(); -RegionPtr xnestPixmapToRegion(); +PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height, + int depth); +Bool xnestDestroyPixmap(PixmapPtr pPixmap); +RegionPtr xnestPixmapToRegion(PixmapPtr pPixmap); #endif /* XNESTPIXMAP_H */ diff --git a/hw/xnest/XNWindow.h b/hw/xnest/XNWindow.h index 28d95941e..8b5f39115 100644 --- a/hw/xnest/XNWindow.h +++ b/hw/xnest/XNWindow.h @@ -12,6 +12,7 @@ the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. */ +/* $XFree86: xc/programs/Xserver/hw/xnest/XNWindow.h,v 1.4 2003/11/16 05:05:20 dawes Exp $ */ #ifndef XNESTWINDOW_H #define XNESTWINDOW_H @@ -57,23 +58,22 @@ extern int xnestWindowPrivateIndex; #define CWParent CWSibling #define CWStackingOrder CWStackMode -extern WindowPtr *WindowTable; - -WindowPtr xnestWindowPtr(); -Bool xnestCreateWindow(); -Bool xnestDestroyWindow(); -Bool xnestPositionWindow(); -void xnestConfigureWindow(); -Bool xnestChangeWindowAttributes(); -Bool xnestRealizeWindow(); -Bool xnestUnrealizeWindow(); -void xnestPaintWindowBackground(); -void xnestPaintWindowBorder(); -void xnestCopyWindow(); -void xnestClipNotify(); -void xnestWindowExposures(); +WindowPtr xnestWindowPtr(Window window); +Bool xnestCreateWindow(WindowPtr pWin); +Bool xnestDestroyWindow(WindowPtr pWin); +Bool xnestPositionWindow(WindowPtr pWin, int x, int y); +void xnestConfigureWindow(WindowPtr pWin, unsigned int mask); +Bool xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask); +Bool xnestRealizeWindow(WindowPtr pWin); +Bool xnestUnrealizeWindow(WindowPtr pWin); +void xnestPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what); +void xnestPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what); +void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion); +void xnestClipNotify(WindowPtr pWin, int dx, int dy); +void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, + RegionPtr other_exposed); #ifdef SHAPE -void xnestShapeWindow(); +void xnestShapeWindow(WindowPtr pWin); #endif /* SHAPE */ #endif /* XNESTWINDOW_H */ diff --git a/hw/xnest/Xnest.man.pre b/hw/xnest/Xnest.man.pre index 474569a47..488489189 100644 --- a/hw/xnest/Xnest.man.pre +++ b/hw/xnest/Xnest.man.pre @@ -25,7 +25,7 @@ .\" other dealings in this Software without prior written authorization .\" from the X Consortium. .\" -.\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.6 2001/01/27 18:21:00 dawes Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xnest/Xnest.man,v 1.7 2003/10/24 17:22:33 dawes Exp $ .\" .TH XNEST 1 __xorgversion__ .SH NAME @@ -102,7 +102,7 @@ saver is software generated since \fIXnest\fP does not control any actual hardware. However, it is treated as a hardware screen saver within the sample server code. .TP 4 -.B \-geometry \fIW+H+X+Y\fP +.B \-geometry \fIWxH+X+Y\fP This option specifies geometry parameters for the top level \fIXnest\fP windows. These windows corresponds to the root windows of the nested server. The width and height specified with this option diff --git a/hw/xnest/os2Stub.c b/hw/xnest/os2Stub.c index b770f546f..15282d206 100644 --- a/hw/xnest/os2Stub.c +++ b/hw/xnest/os2Stub.c @@ -26,7 +26,7 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xnest/os2Stub.c,v 3.1 2002/05/31 18:46:04 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/os2Stub.c,v 3.2 2003/11/06 03:25:46 dawes Exp $ */ /* This below implements select() for calls in xnest. It has been */ /* somewhat optimized for improved performance, but assumes a few */ @@ -111,7 +111,7 @@ if(FirstTime){ } rc = DosResetEventSem(hPipeSem, &postCount); */ /* Done in xtrans code for servers*/ -fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeSem); + /*fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeSem);*/ FirstTime = FALSE; } @@ -153,7 +153,7 @@ fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeS } else if (np == -1) { return(-1); } while(!any_ready){ - rc = DosWaitEventSem(hPipeSem, timeout_ms); + rc = DosWaitEventSem(hPipeSem, 1L); /* if(rc) fprintf(stderr,"Sem-wait timeout, rc = %d\n",rc); */ if(rc == 640) { return(0); @@ -191,7 +191,8 @@ fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeS while (!any_ready && timeout_ms){ - rc = DosWaitEventSem(hPipeSem, 10L); + rc = DosWaitEventSem(hPipeSem, 1L); + if (rc==640) return(0); if(rc == 0){ np = os2_check_pipes(&sd,readfds,writefds); if(np > 0){ |