diff options
author | daryll <daryll> | 1999-12-05 00:59:08 +0000 |
---|---|---|
committer | daryll <daryll> | 1999-12-05 00:59:08 +0000 |
commit | fdec2a5e358ec6bb9857587680f00bd2c91413b6 (patch) | |
tree | 6969674a81da39a1fcd74421ece69c010c28012e /xc/programs/Xserver/hw/xnest | |
parent | 504880db5611bf0f57206abe44835959c2729147 (diff) |
Import XFree 3.9.16
Diffstat (limited to 'xc/programs/Xserver/hw/xnest')
41 files changed, 5935 insertions, 0 deletions
diff --git a/xc/programs/Xserver/hw/xnest/Args.c b/xc/programs/Xserver/hw/xnest/Args.c new file mode 100644 index 000000000..77ba9ac5b --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Args.c @@ -0,0 +1,188 @@ +/* $XConsortium: Args.c /main/3 1996/08/20 11:31:52 kaleb $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "screenint.h" +#include "input.h" +#include "misc.h" +#include "scrnintstr.h" +#include "servermd.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Args.h" + +char *xnestDisplayName = NULL; +Bool xnestSynchronize = False; +Bool xnestFullGeneration = False; +int xnestDefaultClass; +Bool xnestUserDefaultClass = False; +int xnestDefaultDepth; +Bool xnestUserDefaultDepth = False; +Bool xnestSoftwareScreenSaver = False; +int xnestX; +int xnestY; +unsigned int xnestWidth; +unsigned int xnestHeight; +int xnestUserGeometry = 0; +int xnestBorderWidth; +Bool xnestUserBorderWidth = False; +char *xnestWindowName = NULL; +int xnestNumScreens = 0; +Bool xnestDoDirectColormaps = False; +Window xnestParentWindow = 0; + +int ddxProcessArgument (argc, argv, i) + int argc; + char *argv[] ; + int i; +{ + if (!strcmp(argv[i], "-display")) { + if (++i < argc) { + xnestDisplayName = argv[i]; + return 2; + } + return 0; + } + if (!strcmp(argv[i], "-sync")) { + xnestSynchronize = True; + return 1; + } + if (!strcmp(argv[i], "-full")) { + xnestFullGeneration = True; + return 1; + } + if (!strcmp(argv[i], "-class")) { + if (++i < argc) { + if (!strcmp(argv[i], "StaticGray")) { + xnestDefaultClass = StaticGray; + xnestUserDefaultClass = True; + return 2; + } + else if (!strcmp(argv[i], "GrayScale")) { + xnestDefaultClass = GrayScale; + xnestUserDefaultClass = True; + return 2; + } + else if (!strcmp(argv[i], "StaticColor")) { + xnestDefaultClass = StaticColor; + xnestUserDefaultClass = True; + return 2; + } + else if (!strcmp(argv[i], "PseudoColor")) { + xnestDefaultClass = PseudoColor; + xnestUserDefaultClass = True; + return 2; + } + else if (!strcmp(argv[i], "TrueColor")) { + xnestDefaultClass = TrueColor; + xnestUserDefaultClass = True; + return 2; + } + else if (!strcmp(argv[i], "DirectColor")) { + xnestDefaultClass = DirectColor; + xnestUserDefaultClass = True; + return 2; + } + } + return 0; + } + if (!strcmp(argv[i], "-cc")) { + if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultClass) == 1) { + if (xnestDefaultClass >= 0 && xnestDefaultClass <= 5) { + xnestUserDefaultClass = True; + /* lex the OS layer process it as well, so return 0 */ + } + } + return 0; + } + if (!strcmp(argv[i], "-depth")) { + if (++i < argc && sscanf(argv[i], "%i", &xnestDefaultDepth) == 1) { + if (xnestDefaultDepth > 0) { + xnestUserDefaultDepth = True; + return 2; + } + } + return 0; + } + if (!strcmp(argv[i], "-sss")) { + xnestSoftwareScreenSaver = True; + return 1; + } + if (!strcmp(argv[i], "-geometry")) { + if (++i < argc) { + xnestUserGeometry = XParseGeometry(argv[i], + &xnestX, &xnestY, + &xnestWidth, &xnestHeight); + if (xnestUserGeometry) return 2; + } + return 0; + } + if (!strcmp(argv[i], "-bw")) { + if (++i < argc && sscanf(argv[i], "%i", &xnestBorderWidth) == 1) { + if (xnestBorderWidth >= 0) { + xnestUserBorderWidth = True; + return 2; + } + } + return 0; + } + if (!strcmp(argv[i], "-name")) { + if (++i < argc) { + xnestWindowName = argv[i]; + return 2; + } + return 0; + } + if (!strcmp(argv[i], "-scrns")) { + if (++i < argc && sscanf(argv[i], "%i", &xnestNumScreens) == 1) { + if (xnestNumScreens > 0) { + if (xnestNumScreens > MAXSCREENS) { + ErrorF("Maximum number of screens is %d.\n", MAXSCREENS); + xnestNumScreens = MAXSCREENS; + } + return 2; + } + } + return 0; + } + if (!strcmp(argv[i], "-install")) { + xnestDoDirectColormaps = True; + return 1; + } + if (!strcmp(argv[i], "-parent")) { + if (++i < argc) { + xnestParentWindow = (XID) strtol (argv[i], (char**)NULL, 0); + return 2; + } + } + return 0; +} + +void ddxUseMsg() +{ + ErrorF("-display string display name of the real server\n"); + ErrorF("-sync sinchronize with the real server\n"); + ErrorF("-full utilize full regeneration\n"); + ErrorF("-class string default visual class\n"); + ErrorF("-depth int default depth\n"); + ErrorF("-sss use software screen saver\n"); + ErrorF("-geometry WxH+X+Y window size and position\n"); + ErrorF("-bw int window border width\n"); + ErrorF("-name string window name\n"); + ErrorF("-scrns int number of screens to generate\n"); + ErrorF("-install instal colormaps directly\n"); +} diff --git a/xc/programs/Xserver/hw/xnest/Args.h b/xc/programs/Xserver/hw/xnest/Args.h new file mode 100644 index 000000000..3841bf182 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Args.h @@ -0,0 +1,38 @@ +/* $XConsortium: Args.h,v 1.1 93/07/12 15:27:56 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTARGC_H +#define XNESTARGS_H + +extern char *xnestDisplayName; +extern Bool xnestSynchronize; +extern Bool xnestFullGeneration; +extern int xnestDefaultClass; +extern Bool xnestUserDefaultClass; +extern int xnestDefaultDepth; +extern Bool xnestUserDefaultDepth; +extern Bool xnestSoftwareScreenSaver; +extern int xnestX; +extern int xnestY; +extern unsigned int xnestWidth; +extern unsigned int xnestHeight; +extern int xnestUserGeometry; +extern int xnestBorderWidth; +extern Bool xnestUserBorderWidth; +extern char *xnestWindowName; +extern int xnestNumScreens; +extern Bool xnestDoDirectColormaps; + +#endif /* XNESTARGS_H */ diff --git a/xc/programs/Xserver/hw/xnest/Color.c b/xc/programs/Xserver/hw/xnest/Color.c new file mode 100644 index 000000000..f5ad6d47e --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Color.c @@ -0,0 +1,499 @@ +/* $XConsortium: Color.c /main/8 1996/12/02 10:20:51 lehors $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "scrnintstr.h" +#include "window.h" +#include "windowstr.h" +#include "colormapst.h" +#include "resource.h" + +#include "Xnest.h" + + +#include "Display.h" +#include "Screen.h" +#include "Color.h" +#include "Visual.h" +#include "XNWindow.h" +#include "Args.h" + +static ColormapPtr InstalledMaps[MAXSCREENS]; + +Bool xnestCreateColormap(pCmap) + ColormapPtr pCmap; +{ + VisualPtr pVisual; + XColor *colors; + int i, ncolors; + Pixel red, green, blue; + Pixel redInc, greenInc, blueInc; + + pVisual = pCmap->pVisual; + ncolors = pVisual->ColormapEntries; + + pCmap->devPriv = (pointer)xalloc(sizeof(xnestPrivColormap)); + + xnestColormapPriv(pCmap)->colormap = + XCreateColormap(xnestDisplay, + xnestDefaultWindows[pCmap->pScreen->myNum], + xnestVisual(pVisual), + (pVisual->class & DynamicClass) ? + AllocAll : AllocNone); + + + switch (pVisual->class) { + case StaticGray: /* read only */ + colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + for (i = 0; i < ncolors; i++) + colors[i].pixel = i; + XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors); + for (i = 0; i < ncolors; i++) { + pCmap->red[i].co.local.red = colors[i].red; + pCmap->red[i].co.local.green = colors[i].red; + pCmap->red[i].co.local.blue = colors[i].red; + } + xfree(colors); + break; + + case StaticColor: /* read only */ + colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + for (i = 0; i < ncolors; i++) + colors[i].pixel = i; + XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors); + for (i = 0; i < ncolors; i++) { + pCmap->red[i].co.local.red = colors[i].red; + pCmap->red[i].co.local.green = colors[i].green; + pCmap->red[i].co.local.blue = colors[i].blue; + } + xfree(colors); + break; + + case TrueColor: /* read only */ + colors = (XColor *)xalloc(ncolors * sizeof(XColor)); + red = green = blue = 0L; + redInc = lowbit(pVisual->redMask); + greenInc = lowbit(pVisual->greenMask); + blueInc = lowbit(pVisual->blueMask); + for (i = 0; i < ncolors; i++) { + colors[i].pixel = red | green | blue; + red += redInc; + if (red > pVisual->redMask) red = 0L; + green += greenInc; + if (green > pVisual->greenMask) green = 0L; + blue += blueInc; + if (blue > pVisual->blueMask) blue = 0L; + } + XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors); + for (i = 0; i < ncolors; i++) { + pCmap->red[i].co.local.red = colors[i].red; + pCmap->green[i].co.local.green = colors[i].green; + pCmap->blue[i].co.local.blue = colors[i].blue; + } + xfree(colors); + break; + + case GrayScale: /* read and write */ + break; + + case PseudoColor: /* read and write */ + break; + + case DirectColor: /* read and write */ + break; + } + + return True; +} + +void xnestDestroyColormap (pCmap) + ColormapPtr pCmap; +{ + XFreeColormap(xnestDisplay, xnestColormap(pCmap)); + xfree(pCmap->devPriv); +} + +#define SEARCH_PREDICATE \ + (xnestWindow(pWin) != None && wColormap(pWin) == icws->cmapIDs[i]) + +static int xnestCountInstalledColormapWindows(pWin, ptr) + WindowPtr pWin; + pointer ptr; +{ + xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *)ptr; + int i; + + for (i = 0; i < icws->numCmapIDs; i++) + if (SEARCH_PREDICATE) { + icws->numWindows++; + return WT_DONTWALKCHILDREN; + } + + return WT_WALKCHILDREN; +} + +static int xnestGetInstalledColormapWindows(pWin, ptr) + WindowPtr pWin; + pointer ptr; +{ + xnestInstalledColormapWindows *icws = (xnestInstalledColormapWindows *)ptr; + int i; + + for (i = 0; i < icws->numCmapIDs; i++) + if (SEARCH_PREDICATE) { + icws->windows[icws->index++] = xnestWindow(pWin); + return WT_DONTWALKCHILDREN; + } + + return WT_WALKCHILDREN; +} + +static Window *xnestOldInstalledColormapWindows = NULL; +static int xnestNumOldInstalledColormapWindows = 0; + +static Bool xnestSameInstalledColormapWindows(windows, numWindows) + Window *windows; + int numWindows; +{ + if (xnestNumOldInstalledColormapWindows != numWindows) + return False; + + if (xnestOldInstalledColormapWindows == windows) + return True; + + if (xnestOldInstalledColormapWindows == NULL || windows == NULL) + return False; + + if (memcmp(xnestOldInstalledColormapWindows, windows, + numWindows * sizeof(Window))) + return False; + + return True; +} + +void xnestSetInstalledColormapWindows(pScreen) + ScreenPtr pScreen; +{ + xnestInstalledColormapWindows icws; + int numWindows; + + icws.cmapIDs = (Colormap *)xalloc(pScreen->maxInstalledCmaps * + sizeof(Colormap)); + icws.numCmapIDs = xnestListInstalledColormaps(pScreen, icws.cmapIDs); + icws.numWindows = 0; + WalkTree(pScreen, xnestCountInstalledColormapWindows, (pointer)&icws); + if (icws.numWindows) { + icws.windows = (Window *)xalloc((icws.numWindows + 1) * sizeof(Window)); + icws.index = 0; + WalkTree(pScreen, xnestGetInstalledColormapWindows, (pointer)&icws); + icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum]; + numWindows = icws.numWindows + 1; + } + else { + icws.windows = NULL; + numWindows = 0; + } + + xfree(icws.cmapIDs); + + if (!xnestSameInstalledColormapWindows(icws.windows, icws.numWindows)) { + if (xnestOldInstalledColormapWindows) + xfree(xnestOldInstalledColormapWindows); + +#ifdef _XSERVER64 + { + int i; + Window64 *windows = (Window64 *)xalloc(numWindows * sizeof(Window64)); + + for(i = 0; i < numWindows; ++i) + windows[i] = icws.windows[i]; + XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum], + windows, numWindows); + xfree(windows); + } +#else + XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum], + icws.windows, numWindows); +#endif + + xnestOldInstalledColormapWindows = icws.windows; + xnestNumOldInstalledColormapWindows = icws.numWindows; + +#ifdef DUMB_WINDOW_MANAGERS + /* + This code is for dumb window managers. + This will only work with default local visual colormaps. + */ + if (icws.numWindows) + { + WindowPtr pWin; + Visual *visual; + ColormapPtr pCmap; + + pWin = xnestWindowPtr(icws.windows[0]); + visual = xnestVisualFromID(pScreen, wVisual(pWin)); + + if (visual == xnestDefaultVisual(pScreen)) + pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), + RT_COLORMAP); + else + pCmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, + RT_COLORMAP); + + XSetWindowColormap(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + xnestColormap(pCmap)); + } +#endif /* DUMB_WINDOW_MANAGERS */ + } + else + if (icws.windows) xfree(icws.windows); +} + +void xnestSetScreenSaverColormapWindow(pScreen) + ScreenPtr pScreen; +{ + if (xnestOldInstalledColormapWindows) + xfree(xnestOldInstalledColormapWindows); + +#ifdef _XSERVER64 + { + Window64 window; + + window = xnestScreenSaverWindows[pScreen->myNum]; + XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum], + &window, 1); + xnestScreenSaverWindows[pScreen->myNum] = window; + } +#else + XSetWMColormapWindows(xnestDisplay, xnestDefaultWindows[pScreen->myNum], + &xnestScreenSaverWindows[pScreen->myNum], 1); +#endif /* _XSERVER64 */ + + xnestOldInstalledColormapWindows = NULL; + xnestNumOldInstalledColormapWindows = 0; + + xnestDirectUninstallColormaps(pScreen); +} + +void xnestDirectInstallColormaps(pScreen) + ScreenPtr pScreen; +{ + int i, n; + Colormap pCmapIDs[MAXCMAPS]; + + if (!xnestDoDirectColormaps) return; + + n = (*pScreen->ListInstalledColormaps)(pScreen, pCmapIDs); + + for (i = 0; i < n; i++) { + ColormapPtr pCmap; + + pCmap = (ColormapPtr)LookupIDByType(pCmapIDs[i], RT_COLORMAP); + if (pCmap) + XInstallColormap(xnestDisplay, xnestColormap(pCmap)); + } +} + +void xnestDirectUninstallColormaps(pScreen) + ScreenPtr pScreen; +{ + int i, n; + Colormap pCmapIDs[MAXCMAPS]; + + if (!xnestDoDirectColormaps) return; + + n = (*pScreen->ListInstalledColormaps)(pScreen, pCmapIDs); + + for (i = 0; i < n; i++) { + ColormapPtr pCmap; + + pCmap = (ColormapPtr)LookupIDByType(pCmapIDs[i], RT_COLORMAP); + if (pCmap) + XUninstallColormap(xnestDisplay, xnestColormap(pCmap)); + } +} + +void xnestInstallColormap(pCmap) + ColormapPtr pCmap; +{ + int index; + ColormapPtr pOldCmap; + + index = pCmap->pScreen->myNum; + pOldCmap = InstalledMaps[index]; + + if(pCmap != pOldCmap) + { + xnestDirectUninstallColormaps(pCmap->pScreen); + + /* Uninstall pInstalledMap. Notify all interested parties. */ + if(pOldCmap != (ColormapPtr)None) + WalkTree(pCmap->pScreen, TellLostMap, (pointer)&pOldCmap->mid); + + InstalledMaps[index] = pCmap; + WalkTree(pCmap->pScreen, TellGainedMap, (pointer)&pCmap->mid); + + xnestSetInstalledColormapWindows(pCmap->pScreen); + xnestDirectInstallColormaps(pCmap->pScreen); + } +} + +void xnestUninstallColormap(pCmap) + ColormapPtr pCmap; +{ + int index; + ColormapPtr pCurCmap; + + index = pCmap->pScreen->myNum; + pCurCmap = InstalledMaps[index]; + + if(pCmap == pCurCmap) + { + if (pCmap->mid != pCmap->pScreen->defColormap) + { + pCurCmap = (ColormapPtr)LookupIDByType(pCmap->pScreen->defColormap, + RT_COLORMAP); + (*pCmap->pScreen->InstallColormap)(pCurCmap); + } + } +} + +static Bool xnestInstalledDefaultColormap = False; + +int xnestListInstalledColormaps(pScreen, pCmapIDs) + ScreenPtr pScreen; + Colormap *pCmapIDs; +{ + if (xnestInstalledDefaultColormap) { + *pCmapIDs = InstalledMaps[pScreen->myNum]->mid; + return 1; + } + else + return 0; +} + +void xnestStoreColors(pCmap, nColors, pColors) + ColormapPtr pCmap; + int nColors; + xColorItem *pColors; +{ + if (pCmap->pVisual->class & DynamicClass) +#ifdef _XSERVER64 + { + int i; + XColor *pColors64 = (XColor *)xalloc(nColors * sizeof(XColor) ); + + for(i = 0; i < nColors; ++i) + { + pColors64[i].pixel = pColors[i].pixel; + pColors64[i].red = pColors[i].red; + pColors64[i].green = pColors[i].green; + pColors64[i].blue = pColors[i].blue; + pColors64[i].flags = pColors[i].flags; + } + XStoreColors(xnestDisplay, xnestColormap(pCmap), pColors64, nColors); + xfree(pColors64); + } +#else + XStoreColors(xnestDisplay, xnestColormap(pCmap), + (XColor *)pColors, nColors); +#endif +} + +void xnestResolveColor(pRed, pGreen, pBlue, pVisual) + unsigned short *pRed; + unsigned short *pGreen; + unsigned short *pBlue; + VisualPtr pVisual; +{ + int shift; + unsigned int lim; + + shift = 16 - pVisual->bitsPerRGBValue; + lim = (1 << pVisual->bitsPerRGBValue) - 1; + + if ((pVisual->class == PseudoColor) || (pVisual->class == DirectColor)) + { + /* rescale to rgb bits */ + *pRed = ((*pRed >> shift) * 65535) / lim; + *pGreen = ((*pGreen >> shift) * 65535) / lim; + *pBlue = ((*pBlue >> shift) * 65535) / lim; + } + else if (pVisual->class == GrayScale) + { + /* rescale to gray then rgb bits */ + *pRed = (30L * *pRed + 59L * *pGreen + 11L * *pBlue) / 100; + *pBlue = *pGreen = *pRed = ((*pRed >> shift) * 65535) / lim; + } + else if (pVisual->class == StaticGray) + { + unsigned int limg; + + limg = pVisual->ColormapEntries - 1; + /* rescale to gray then [0..limg] then [0..65535] then rgb bits */ + *pRed = (30L * *pRed + 59L * *pGreen + 11L * *pBlue) / 100; + *pRed = ((((*pRed * (limg + 1))) >> 16) * 65535) / limg; + *pBlue = *pGreen = *pRed = ((*pRed >> shift) * 65535) / lim; + } + else + { + unsigned limr, limg, limb; + + limr = pVisual->redMask >> pVisual->offsetRed; + limg = pVisual->greenMask >> pVisual->offsetGreen; + limb = pVisual->blueMask >> pVisual->offsetBlue; + /* rescale to [0..limN] then [0..65535] then rgb bits */ + *pRed = ((((((*pRed * (limr + 1)) >> 16) * + 65535) / limr) >> shift) * 65535) / lim; + *pGreen = ((((((*pGreen * (limg + 1)) >> 16) * + 65535) / limg) >> shift) * 65535) / lim; + *pBlue = ((((((*pBlue * (limb + 1)) >> 16) * + 65535) / limb) >> shift) * 65535) / lim; + } +} + +Bool xnestCreateDefaultColormap(pScreen) + ScreenPtr pScreen; +{ + VisualPtr pVisual; + ColormapPtr pCmap; + unsigned short zero = 0, ones = 0xFFFF; + Pixel wp, bp; + + for (pVisual = pScreen->visuals; + pVisual->vid != pScreen->rootVisual; + pVisual++); + + if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &pCmap, + (pVisual->class & DynamicClass) ? AllocNone : AllocAll, 0) + != Success) + return False; + + wp = pScreen->whitePixel; + bp = pScreen->blackPixel; + if ((AllocColor(pCmap, &ones, &ones, &ones, &wp, 0) != + Success) || + (AllocColor(pCmap, &zero, &zero, &zero, &bp, 0) != + Success)) + return FALSE; + pScreen->whitePixel = wp; + pScreen->blackPixel = bp; + (*pScreen->InstallColormap)(pCmap); + + xnestInstalledDefaultColormap = True; + + return True; +} diff --git a/xc/programs/Xserver/hw/xnest/Color.h b/xc/programs/Xserver/hw/xnest/Color.h new file mode 100644 index 000000000..1d0d7172f --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Color.h @@ -0,0 +1,56 @@ +/* $XConsortium: Color.h,v 1.1 93/07/12 15:28:00 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTCOLOR_H +#define XNESTCOLOR_H + +#define DUMB_WINDOW_MANAGERS + +#define MAXCMAPS 1 +#define MINCMAPS 1 + +typedef struct { + Colormap colormap; +} xnestPrivColormap; + +typedef struct { + int numCmapIDs; + Colormap *cmapIDs; + int numWindows; + Window *windows; + int index; +} xnestInstalledColormapWindows; + +#define xnestColormapPriv(pCmap) \ + ((xnestPrivColormap *)((pCmap)->devPriv)) + +#define xnestColormap(pCmap) (xnestColormapPriv(pCmap)->colormap) + +#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(); + +#endif /* XNESTCOLOR_H */ diff --git a/xc/programs/Xserver/hw/xnest/Cursor.c b/xc/programs/Xserver/hw/xnest/Cursor.c new file mode 100644 index 000000000..dd231df2f --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Cursor.c @@ -0,0 +1,214 @@ +/* $XConsortium: Cursor.c /main/5 1996/09/28 17:13:30 rws $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "screenint.h" +#include "input.h" +#include "misc.h" +#include "cursor.h" +#include "cursorstr.h" +#include "scrnintstr.h" +#include "servermd.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "Cursor.h" +#include "Visual.h" +#include "Keyboard.h" +#include "Args.h" + +void xnestConstrainCursor(pScreen, pBox) + ScreenPtr pScreen; + BoxPtr pBox; +{ +#ifdef _XSERVER64 + Window64 wroot; +#else + Window wroot; +#endif + + int wx, wy; + unsigned int wwidth, wheight; + unsigned int wborderwidth; + unsigned int wdepth; + + XGetGeometry(xnestDisplay, xnestDefaultWindows[pScreen->myNum], &wroot, + &wx, &wy, &wwidth, &wheight, &wborderwidth, &wdepth); + + if (pBox->x1 <= 0 && pBox->y1 <= 0 && + pBox->x2 >= wwidth && pBox->y2 >= wheight) + XUngrabPointer(xnestDisplay, CurrentTime); + else { + XReparentWindow(xnestDisplay, xnestConfineWindow, + xnestDefaultWindows[pScreen->myNum], + pBox->x1, pBox->y1); + XResizeWindow(xnestDisplay, xnestConfineWindow, + pBox->x2 - pBox->x1, pBox->y2 - pBox->y1); + + XGrabPointer(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + True, + xnestEventMask & (~XNEST_KEYBOARD_EVENT_MASK|KeymapStateMask), + GrabModeAsync, GrabModeAsync, + xnestConfineWindow, + None, CurrentTime); + } +} + +void xnestCursorLimits(pScreen, pCursor, pHotBox, pTopLeftBox) + ScreenPtr pScreen; + CursorPtr pCursor; + BoxPtr pHotBox; + BoxPtr pTopLeftBox; +{ + *pTopLeftBox = *pHotBox; +} + +Bool xnestDisplayCursor(pScreen, pCursor) + ScreenPtr pScreen; + CursorPtr pCursor; +{ + XDefineCursor(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + xnestCursor(pCursor, pScreen)); + return True; +} + +Bool xnestRealizeCursor(pScreen, pCursor) + ScreenPtr pScreen; + CursorPtr pCursor; +{ + XImage *ximage; + Pixmap source, mask; + XColor fg_color, bg_color; + unsigned long valuemask; + XGCValues values; + + valuemask = GCFunction | + GCPlaneMask | + GCForeground | + GCBackground | + GCClipMask; + + values.function = GXcopy; + values.plane_mask = AllPlanes; + values.foreground = 1L; + values.background = 0L; + values.clip_mask = None; + + XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values); + + source = XCreatePixmap(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + pCursor->bits->width, + pCursor->bits->height, + 1); + + mask = XCreatePixmap(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + pCursor->bits->width, + pCursor->bits->height, + 1); + + ximage = XCreateImage(xnestDisplay, + xnestDefaultVisual(pScreen), + 1, XYBitmap, 0, + (char *)pCursor->bits->source, + pCursor->bits->width, + pCursor->bits->height, + BitmapPad(xnestDisplay), 0); + + XPutImage(xnestDisplay, source, xnestBitmapGC, ximage, + 0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height); + + XFree(ximage); + + ximage = XCreateImage(xnestDisplay, + xnestDefaultVisual(pScreen), + 1, XYBitmap, 0, + (char *)pCursor->bits->mask, + pCursor->bits->width, + pCursor->bits->height, + BitmapPad(xnestDisplay), 0); + + XPutImage(xnestDisplay, mask, xnestBitmapGC, ximage, + 0, 0, 0, 0, pCursor->bits->width, pCursor->bits->height); + + XFree(ximage); + + fg_color.red = pCursor->foreRed; + fg_color.green = pCursor->foreGreen; + fg_color.blue = pCursor->foreBlue; + + bg_color.red = pCursor->backRed; + bg_color.green = pCursor->backGreen; + bg_color.blue = pCursor->backBlue; + + pCursor->devPriv[pScreen->myNum] = (pointer)xalloc(sizeof(xnestPrivCursor)); + xnestCursorPriv(pCursor, pScreen)->cursor = + XCreatePixmapCursor(xnestDisplay, source, mask, &fg_color, &bg_color, + pCursor->bits->xhot, pCursor->bits->yhot); + + XFreePixmap(xnestDisplay, source); + XFreePixmap(xnestDisplay, mask); + + return True; +} + +Bool xnestUnrealizeCursor(pScreen, pCursor) + 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; +{ + XColor fg_color, bg_color; + + fg_color.red = pCursor->foreRed; + fg_color.green = pCursor->foreGreen; + fg_color.blue = pCursor->foreBlue; + + bg_color.red = pCursor->backRed; + bg_color.green = pCursor->backGreen; + bg_color.blue = pCursor->backBlue; + + XRecolorCursor(xnestDisplay, + xnestCursor(pCursor, pScreen), + &fg_color, &bg_color); +} + +Bool xnestSetCursorPosition(pScreen, x, y, generateEvent) + ScreenPtr pScreen; + int x, y; + Bool generateEvent; +{ + int i; + + for (i = 0; i < xnestNumScreens; i++) + XWarpPointer(xnestDisplay, xnestDefaultWindows[i], + xnestDefaultWindows[pScreen->myNum], + 0, 0, 0, 0, x, y); + + return True; +} diff --git a/xc/programs/Xserver/hw/xnest/Cursor.h b/xc/programs/Xserver/hw/xnest/Cursor.h new file mode 100644 index 000000000..975200e04 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Cursor.h @@ -0,0 +1,37 @@ +/* $XConsortium: Cursor.h,v 1.1 93/07/12 15:28:04 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTCURSOR_H +#define XNESTCURSOR_H + +typedef struct { + Cursor cursor; +} xnestPrivCursor; + +#define xnestCursorPriv(pCursor, pScreen) \ + ((xnestPrivCursor *)((pCursor)->devPriv[pScreen->myNum])) + +#define xnestCursor(pCursor, pScreen) \ + (xnestCursorPriv(pCursor, pScreen)->cursor) + +void xnestConstrainCursor(); +void xnestCursorLimits(); +Bool xnestDisplayCursor(); +Bool xnestRealizeCursor(); +Bool xnestUnrealizeCursor(); +void xnestRecolorCursor(); +Bool xnestSetCursorPosition(); + +#endif /* XNESTCURSOR_H */ diff --git a/xc/programs/Xserver/hw/xnest/Display.c b/xc/programs/Xserver/hw/xnest/Display.c new file mode 100644 index 000000000..d0a2180b4 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Display.c @@ -0,0 +1,202 @@ +/* $XConsortium: Display.c /main/4 1996/08/20 11:31:58 kaleb $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Display.c,v 3.1 1996/12/23 07:09:11 dawes Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + + +#include "X.h" +#include "Xproto.h" +#include "screenint.h" +#include "input.h" +#include "misc.h" +#include "scrnintstr.h" +#include "servermd.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Init.h" +#include "Args.h" + +#include "icon" +#include "screensaver" + +Display *xnestDisplay = NULL; +XVisualInfo *xnestVisuals; +int xnestNumVisuals; +int xnestDefaultVisualIndex; +Colormap *xnestDefaultColormaps; +int xnestNumDefaultColormaps; +int *xnestDepths; +int xnestNumDepths; +XPixmapFormatValues *xnestPixmapFormats; +int xnestNumPixmapFormats; +Pixel xnestBlackPixel; +Pixel xnestWhitePixel; +Drawable xnestDefaultDrawables[MAXDEPTH + 1]; +Pixmap xnestIconBitmap; +Pixmap xnestScreenSaverPixmap; +XlibGC xnestBitmapGC; +Window xnestConfineWindow; +unsigned long xnestEventMask; + +void xnestOpenDisplay(argc, argv) + int argc; + char *argv[]; +{ + XVisualInfo vi; + long mask; + int i, j; + extern Window xnestParentWindow; + + if (!xnestDoFullGeneration) return; + + xnestCloseDisplay(); + + xnestDisplay = XOpenDisplay(xnestDisplayName); + if (xnestDisplay == NULL) + FatalError("Unable to open display \"%s\".\n", + XDisplayName(xnestDisplayName)); + + if (xnestSynchronize) + XSynchronize(xnestDisplay, True); + + mask = VisualScreenMask; + vi.screen = DefaultScreen(xnestDisplay); + xnestVisuals = XGetVisualInfo(xnestDisplay, mask, &vi, &xnestNumVisuals); + if (xnestNumVisuals == 0 || xnestVisuals == NULL) + FatalError("Unable to find any visuals.\n"); + + if (xnestUserDefaultClass || xnestUserDefaultDepth) { + xnestDefaultVisualIndex = UNDEFINED; + for (i = 0; i < xnestNumVisuals; i++) + if ((!xnestUserDefaultClass || + xnestVisuals[i].class == xnestDefaultClass) + && + (!xnestUserDefaultDepth || + xnestVisuals[i].depth == xnestDefaultDepth)) { + xnestDefaultVisualIndex = i; + break; + } + if (xnestDefaultVisualIndex == UNDEFINED) + FatalError("Unable to find desired default visual.\n"); + } + else { + vi.visualid = XVisualIDFromVisual(DefaultVisual(xnestDisplay, + DefaultScreen(xnestDisplay))); + xnestDefaultVisualIndex = 0; + for (i = 0; i < xnestNumVisuals; i++) + if (vi.visualid == xnestVisuals[i].visualid) + xnestDefaultVisualIndex = i; + } + + xnestNumDefaultColormaps = xnestNumVisuals; + xnestDefaultColormaps = (Colormap *)xalloc(xnestNumDefaultColormaps * + sizeof(Colormap)); + for (i = 0; i < xnestNumDefaultColormaps; i++) + xnestDefaultColormaps[i] = XCreateColormap(xnestDisplay, + DefaultRootWindow(xnestDisplay), + xnestVisuals[i].visual, + AllocNone); + + xnestDepths = XListDepths(xnestDisplay, DefaultScreen(xnestDisplay), + &xnestNumDepths); + + xnestPixmapFormats = XListPixmapFormats(xnestDisplay, + &xnestNumPixmapFormats); + + xnestBlackPixel = BlackPixel(xnestDisplay, DefaultScreen(xnestDisplay)); + xnestWhitePixel = WhitePixel(xnestDisplay, DefaultScreen(xnestDisplay)); + + if (xnestParentWindow != (Window) 0) + xnestEventMask = StructureNotifyMask; + else + xnestEventMask = 0L; + + for (i = 0; i <= MAXDEPTH; i++) + xnestDefaultDrawables[i] = None; + + for (i = 0; i < xnestNumPixmapFormats; i++) + for (j = 0; j < xnestNumDepths; j++) + if (xnestPixmapFormats[i].depth == 1 || + xnestPixmapFormats[i].depth == xnestDepths[j]) { + xnestDefaultDrawables[xnestPixmapFormats[i].depth] = + XCreatePixmap(xnestDisplay, DefaultRootWindow(xnestDisplay), + 1, 1, xnestPixmapFormats[i].depth); + } + + xnestBitmapGC = XCreateGC(xnestDisplay, xnestDefaultDrawables[1], 0L, NULL); + + xnestConfineWindow = XCreateWindow(xnestDisplay, + DefaultRootWindow(xnestDisplay), + 0, 0, 1, 1, 0, 0, + InputOnly, + CopyFromParent, + 0L, NULL); + + if (!(xnestUserGeometry & XValue)) + xnestX = 0; + + if (!(xnestUserGeometry & YValue)) + xnestY = 0; + + if (xnestParentWindow == 0) { + if (!(xnestUserGeometry & WidthValue)) + xnestWidth = 3 * DisplayWidth(xnestDisplay, + DefaultScreen(xnestDisplay)) / 4; + + if (!(xnestUserGeometry & HeightValue)) + xnestHeight = 3 * DisplayHeight(xnestDisplay, + DefaultScreen(xnestDisplay)) / 4; + } + + if (!xnestUserBorderWidth) + xnestBorderWidth = 1; + + xnestIconBitmap = + XCreateBitmapFromData(xnestDisplay, + DefaultRootWindow(xnestDisplay), + (char *)icon_bits, + icon_width, + icon_height); + + xnestScreenSaverPixmap = + XCreatePixmapFromBitmapData(xnestDisplay, + DefaultRootWindow(xnestDisplay), + (char *)screensaver_bits, + screensaver_width, + screensaver_height, + xnestWhitePixel, + xnestBlackPixel, + DefaultDepth(xnestDisplay, + DefaultScreen(xnestDisplay))); +} + +void xnestCloseDisplay() +{ + int i; + + if (!xnestDoFullGeneration || !xnestDisplay) return; + + /* + If xnestDoFullGeneration all x resources will be destroyed upon closing + the display connection. There is no need to generate extra protocol. + */ + + xfree(xnestDefaultColormaps); + XFree(xnestVisuals); + XFree(xnestDepths); + XFree(xnestPixmapFormats); + XCloseDisplay(xnestDisplay); +} diff --git a/xc/programs/Xserver/hw/xnest/Display.h b/xc/programs/Xserver/hw/xnest/Display.h new file mode 100644 index 000000000..c0d554fe4 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Display.h @@ -0,0 +1,47 @@ +/* $XConsortium: Display.h,v 1.2 94/02/06 17:51:43 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +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.3 1998/12/20 22:18:57 dawes Exp $ */ + +#ifndef XNESTCOMMON_H +#define XNESTCOMMON_H + +#define UNDEFINED -1 + +#define MAXDEPTH 32 +#define MAXVISUALSPERDEPTH 32 + +extern Display *xnestDisplay; +extern XVisualInfo *xnestVisuals; +extern int xnestNumVisuals; +extern int xnestDefaultVisualIndex; +extern Colormap *xnestDefaultColormaps; +extern int xnestNumDefaultClormaps; +extern int *xnestDepths; +extern int xnestNumDepths; +extern XPixmapFormatValues *xnestPixmapFormats; +extern int xnestNumPixmapFormats; +extern Pixel xnestBlackPixel; +extern Pixel xnestWhitePixel; +extern Drawable xnestDefaultDrawables[MAXDEPTH + 1]; +extern Pixmap xnestIconBitmap; +extern Pixmap xnestScreenSaverPixmap; +extern XlibGC xnestBitmapGC; +extern Window xnestConfineWindow; +extern unsigned long xnestEventMask; + +void xnestOpenDisplay(); +void xnestCloseDisplay(); + +#endif /* XNESTCOMMON_H */ diff --git a/xc/programs/Xserver/hw/xnest/Drawable.h b/xc/programs/Xserver/hw/xnest/Drawable.h new file mode 100644 index 000000000..a990b0ae0 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Drawable.h @@ -0,0 +1,27 @@ +/* $XConsortium: Drawable.h /main/2 1996/12/02 10:20:59 lehors $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTDRAWABLE_H +#define XNESTDRAWABLE_H + +#include "XNWindow.h" +#include "Pixmap.h" + +#define xnestDrawable(pDrawable) \ + ((pDrawable)->type == DRAWABLE_WINDOW ? \ + xnestWindow((WindowPtr)pDrawable) : \ + xnestPixmap((PixmapPtr)pDrawable)) + +#endif /* XNESTDRAWABLE_H */ diff --git a/xc/programs/Xserver/hw/xnest/Events.c b/xc/programs/Xserver/hw/xnest/Events.c new file mode 100644 index 000000000..c94d61794 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Events.c @@ -0,0 +1,189 @@ +/* $XConsortium: Events.c /main/6 1996/12/02 10:21:07 lehors $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#define NEED_EVENTS +#include "Xproto.h" +#include "screenint.h" +#include "input.h" +#include "misc.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "servermd.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "XNWindow.h" +#include "Events.h" + +CARD32 lastEventTime = 0; + +void ProcessInputEvents() +{ + mieqProcessInputEvents(); +} + +int TimeSinceLastInputEvent() +{ + if (lastEventTime == 0) + lastEventTime = GetTimeInMillis(); + return GetTimeInMillis() - lastEventTime; +} + +void SetTimeSinceLastInputEvent() +{ + lastEventTime = GetTimeInMillis(); +} + +static Bool xnestExposurePredicate(display, event, args) + 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; +{ + return !xnestExposurePredicate(display, event, args); +} + +void xnestCollectExposures() +{ + XEvent X; + WindowPtr pWin; + RegionRec Rgn; + BoxRec Box; + + while (XCheckIfEvent(xnestDisplay, &X, xnestExposurePredicate, NULL)) { + pWin = xnestWindowPtr(X.xexpose.window); + + if (pWin) { + Box.x1 = pWin->drawable.x + wBorderWidth(pWin) + X.xexpose.x; + Box.y1 = pWin->drawable.y + wBorderWidth(pWin) + X.xexpose.y; + Box.x2 = Box.x1 + X.xexpose.width; + Box.y2 = Box.y1 + X.xexpose.height; + + REGION_INIT(pWin->drawable.pScreen, &Rgn, &Box, 1); + + miWindowExposures(pWin, &Rgn, NullRegion); + } + } +} + +void xnestCollectEvents() +{ + XEvent X; + xEvent x; + ScreenPtr pScreen; + extern Window xnestParentWindow; + + while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) { + switch (X.type) { + case KeyPress: + x.u.u.type = KeyPress; + x.u.u.detail = X.xkey.keycode; + x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); + mieqEnqueue(&x); + break; + + case KeyRelease: + x.u.u.type = KeyRelease; + x.u.u.detail = X.xkey.keycode; + x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); + mieqEnqueue(&x); + break; + + case ButtonPress: + x.u.u.type = ButtonPress; + x.u.u.detail = X.xbutton.button; + x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); + mieqEnqueue(&x); + break; + + case ButtonRelease: + x.u.u.type = ButtonRelease; + x.u.u.detail = X.xbutton.button; + x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); + mieqEnqueue(&x); + break; + + case MotionNotify: + x.u.u.type = MotionNotify; + x.u.keyButtonPointer.rootX = X.xmotion.x; + x.u.keyButtonPointer.rootY = X.xmotion.y; + x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); + mieqEnqueue(&x); + break; + + case FocusIn: + if (X.xfocus.detail != NotifyInferior) { + pScreen = xnestScreen(X.xfocus.window); + if (pScreen) + xnestDirectInstallColormaps(pScreen); + } + break; + + case FocusOut: + if (X.xfocus.detail != NotifyInferior) { + pScreen = xnestScreen(X.xfocus.window); + if (pScreen) + xnestDirectUninstallColormaps(pScreen); + } + break; + + case KeymapNotify: + break; + + case EnterNotify: + if (X.xcrossing.detail != NotifyInferior) { + pScreen = xnestScreen(X.xcrossing.window); + if (pScreen) { + NewCurrentScreen(pScreen, X.xcrossing.x, X.xcrossing.y); + x.u.u.type = MotionNotify; + x.u.keyButtonPointer.rootX = X.xcrossing.x; + x.u.keyButtonPointer.rootY = X.xcrossing.y; + x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); + mieqEnqueue(&x); + xnestDirectInstallColormaps(pScreen); + } + } + break; + + case LeaveNotify: + if (X.xcrossing.detail != NotifyInferior) { + pScreen = xnestScreen(X.xcrossing.window); + if (pScreen) { + xnestDirectUninstallColormaps(pScreen); + } + } + break; + + case DestroyNotify: + if (xnestParentWindow != (Window) 0 && + X.xdestroywindow.window == xnestParentWindow) + exit (0); + break; + + default: + ErrorF("xnest warning: unhandled event\n"); + break; + } + } +} diff --git a/xc/programs/Xserver/hw/xnest/Events.h b/xc/programs/Xserver/hw/xnest/Events.h new file mode 100644 index 000000000..c5848f61d --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Events.h @@ -0,0 +1,28 @@ +/* $XConsortium: Events.h,v 1.2 93/09/23 18:57:02 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTEVENTS_H +#define XNESTEVENTS_H + +#include <X11/Xmd.h> + +#define ProcessedExpose (LASTEvent + 1) + +extern CARD32 lastEventTime; + +void xnestCollectExposures(); +void xnestCollectEvents(); + +#endif /* XNESTEVENTS_H */ diff --git a/xc/programs/Xserver/hw/xnest/Font.c b/xc/programs/Xserver/hw/xnest/Font.c new file mode 100644 index 000000000..47030ee46 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Font.c @@ -0,0 +1,88 @@ +/* $XConsortium: Font.c /main/4 1996/12/02 10:21:13 lehors $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Font.c,v 3.4 1996/12/27 07:07:48 dawes Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xatom.h" +#include "Xproto.h" +#include "misc.h" +#include "miscstruct.h" +#include "font.h" +#include "fontstruct.h" +#include "scrnintstr.h" + +#include "Xnest.h" + +#include "Display.h" +#include "XNFont.h" + +int xnestFontPrivateIndex; + +Bool xnestRealizeFont(pScreen, pFont) + ScreenPtr pScreen; + FontPtr pFont; +{ + pointer priv; + Atom name_atom, value_atom; + int nprops; + FontPropPtr props; + int i; + char *name; + + FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); + + if (requestingClient && XpClientIsPrintClient(requestingClient, NULL)) + return True; + + name_atom = MakeAtom("FONT", 4, True); + value_atom = 0L; + + nprops = pFont->info.nprops; + props = pFont->info.props; + + for (i = 0; i < nprops; i++) + if (props[i].name == name_atom) { + value_atom = props[i].value; + break; + } + + if (!value_atom) return False; + + name = (char *)NameForAtom(value_atom); + + if (!name) return False; + + priv = (pointer)xalloc(sizeof(xnestPrivFont)); + FontSetPrivate(pFont, xnestFontPrivateIndex, priv); + + xnestFontPriv(pFont)->font_struct = XLoadQueryFont(xnestDisplay, name); + + if (!xnestFontStruct(pFont)) return False; + + return True; +} + + +Bool xnestUnrealizeFont(pScreen, pFont) + ScreenPtr pScreen; + FontPtr pFont; +{ + if (xnestFontPriv(pFont)) { + if (xnestFontStruct(pFont)) + XFreeFont(xnestDisplay, xnestFontStruct(pFont)); + xfree(xnestFontPriv(pFont)); + FontSetPrivate(pFont, xnestFontPrivateIndex, NULL); + } + return True; +} diff --git a/xc/programs/Xserver/hw/xnest/GC.c b/xc/programs/Xserver/hw/xnest/GC.c new file mode 100644 index 000000000..4916bce9c --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/GC.c @@ -0,0 +1,346 @@ +/* $XConsortium: GC.c /main/8 1996/12/02 10:21:19 lehors $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/GC.c,v 3.3 1996/12/23 07:09:13 dawes Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "gcstruct.h" +#include "windowstr.h" +#include "pixmapstr.h" +#include "scrnintstr.h" +#include "fontstruct.h" +#include "mistruct.h" +#include "region.h" + +#include "Xnest.h" + +#include "Display.h" +#include "XNGC.h" +#include "GCOps.h" +#include "Drawable.h" +#include "XNFont.h" +#include "Color.h" + +int xnestGCPrivateIndex; + +static GCFuncs xnestFuncs = { + xnestValidateGC, + xnestChangeGC, + xnestCopyGC, + xnestDestroyGC, + xnestChangeClip, + xnestDestroyClip, + xnestCopyClip, +}; + +static GCOps xnestOps = { + xnestFillSpans, + xnestSetSpans, + xnestPutImage, + xnestCopyArea, + xnestCopyPlane, + xnestPolyPoint, + xnestPolylines, + xnestPolySegment, + xnestPolyRectangle, + xnestPolyArc, + xnestFillPolygon, + xnestPolyFillRect, + xnestPolyFillArc, + xnestPolyText8, + xnestPolyText16, + xnestImageText8, + xnestImageText16, + xnestImageGlyphBlt, + xnestPolyGlyphBlt, + xnestPushPixels +}; + +Bool xnestCreateGC(pGC) + GCPtr pGC; +{ + pGC->clientClipType = CT_NONE; + pGC->clientClip = NULL; + + pGC->funcs = &xnestFuncs; + pGC->ops = &xnestOps; + + pGC->miTranslate = 1; + + xnestGCPriv(pGC)->gc = XCreateGC(xnestDisplay, + xnestDefaultDrawables[pGC->depth], + 0L, NULL); + xnestGCPriv(pGC)->nClipRects = 0; + + return True; +} + +void xnestValidateGC(pGC, changes, pDrawable) + 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; +{ + XGCValues values; + + if (mask & GCFunction) + values.function = pGC->alu; + + if (mask & GCPlaneMask) + values.plane_mask = pGC->planemask; + + if (mask & GCForeground) + values.foreground = xnestPixel(pGC->fgPixel); + + if (mask & GCBackground) + values.background = xnestPixel(pGC->bgPixel); + + if (mask & GCLineWidth) + values.line_width = pGC->lineWidth; + + if (mask & GCLineStyle) + values.line_style = pGC->lineStyle; + + if (mask & GCCapStyle) + values.cap_style = pGC->capStyle; + + if (mask & GCJoinStyle) + values.join_style = pGC->joinStyle; + + if (mask & GCFillStyle) + values.fill_style = pGC->fillStyle; + + if (mask & GCFillRule) + values.fill_rule = pGC->fillRule; + + if (mask & GCTile) + if (pGC->tileIsPixel) + mask &= ~GCTile; + else + values.tile = xnestPixmap(pGC->tile.pixmap); + + if (mask & GCStipple) + values.stipple = xnestPixmap(pGC->stipple); + + if (mask & GCTileStipXOrigin) + values.ts_x_origin = pGC->patOrg.x; + + if (mask & GCTileStipYOrigin) + values.ts_y_origin = pGC->patOrg.y; + + if (mask & GCFont) + values.font = xnestFont(pGC->font); + + if (mask & GCSubwindowMode) + values.subwindow_mode = pGC->subWindowMode; + + if (mask & GCGraphicsExposures) + values.graphics_exposures = pGC->graphicsExposures; + + if (mask & GCClipXOrigin) + values.clip_x_origin = pGC->clipOrg.x; + + if (mask & GCClipYOrigin) + values.clip_y_origin = pGC->clipOrg.y; + + if (mask & GCClipMask) /* this is handled in change clip */ + mask &= ~GCClipMask; + + if (mask & GCDashOffset) + values.dash_offset = pGC->dashOffset; + + if (mask & GCDashList) { + mask &= ~GCDashList; + XSetDashes(xnestDisplay, xnestGC(pGC), + pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList); + } + + if (mask & GCArcMode) + values.arc_mode = pGC->arcMode; + + if (mask) + XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values); +} + +void xnestCopyGC(pGCSrc, mask, pGCDst) + GCPtr pGCSrc; + unsigned long mask; + GCPtr pGCDst; +{ + XCopyGC(xnestDisplay, xnestGC(pGCSrc), mask, xnestGC(pGCDst)); +} + +void xnestDestroyGC(pGC) + GC *pGC; +{ + XFreeGC(xnestDisplay, xnestGC(pGC)); +} + +void xnestChangeClip(pGC, type, pValue, nRects) + GCPtr pGC; + int type; + pointer pValue; + int nRects; +{ + int i, size; + BoxPtr pBox; + XRectangle *pRects; + + xnestDestroyClipHelper(pGC); + + switch(type) + { + case CT_NONE: + XSetClipMask(xnestDisplay, xnestGC(pGC), None); + break; + + case CT_REGION: + nRects = REGION_NUM_RECTS((RegionPtr)pValue); + size = nRects * sizeof(*pRects); + pRects = (XRectangle *) xalloc(size); + pBox = REGION_RECTS((RegionPtr)pValue); + for (i = nRects; i-- > 0; ) { + pRects[i].x = pBox[i].x1; + pRects[i].y = pBox[i].y1; + pRects[i].width = pBox[i].x2 - pBox[i].x1; + pRects[i].height = pBox[i].y2 - pBox[i].y1; + } + XSetClipRectangles(xnestDisplay, xnestGC(pGC), 0, 0, + pRects, nRects, Unsorted); + xfree((char *) pRects); + break; + + case CT_PIXMAP: + XSetClipMask(xnestDisplay, xnestGC(pGC), + xnestPixmap((PixmapPtr)pValue)); + /* + * Need to change into region, so subsequent uses are with + * current pixmap contents. + */ + pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr)pValue); + (*pGC->pScreen->DestroyPixmap)((PixmapPtr)pValue); + pValue = pGC->clientClip; + type = CT_REGION; + break; + + case CT_UNSORTED: + XSetClipRectangles(xnestDisplay, xnestGC(pGC), + pGC->clipOrg.x, pGC->clipOrg.y, + (XRectangle *)pValue, nRects, Unsorted); + break; + + case CT_YSORTED: + XSetClipRectangles(xnestDisplay, xnestGC(pGC), + pGC->clipOrg.x, pGC->clipOrg.y, + (XRectangle *)pValue, nRects, YSorted); + break; + + case CT_YXSORTED: + XSetClipRectangles(xnestDisplay, xnestGC(pGC), + pGC->clipOrg.x, pGC->clipOrg.y, + (XRectangle *)pValue, nRects, YXSorted); + break; + + case CT_YXBANDED: + XSetClipRectangles(xnestDisplay, xnestGC(pGC), + pGC->clipOrg.x, pGC->clipOrg.y, + (XRectangle *)pValue, nRects, YXBanded); + break; + } + + switch(type) + { + default: + break; + + case CT_UNSORTED: + case CT_YSORTED: + case CT_YXSORTED: + case CT_YXBANDED: + + /* + * other parts of server can only deal with CT_NONE, + * CT_PIXMAP and CT_REGION client clips. + */ + pGC->clientClip = (pointer) (*pGC->pScreen->RectsToRegion)(nRects, + (xRectangle *)pValue, + type); + xfree(pValue); + pValue = pGC->clientClip; + type = CT_REGION; + + break; + } + + pGC->clientClipType = type; + pGC->clientClip = pValue; + xnestGCPriv(pGC)->nClipRects = nRects; +} + +void xnestDestroyClip(pGC) + GCPtr pGC; +{ + xnestDestroyClipHelper(pGC); + + XSetClipMask(xnestDisplay, xnestGC(pGC), None); + + pGC->clientClipType = CT_NONE; + pGC->clientClip = NULL; + xnestGCPriv(pGC)->nClipRects = 0; +} + +void xnestDestroyClipHelper(pGC) + GCPtr pGC; +{ + switch (pGC->clientClipType) + { + default: + case CT_NONE: + break; + + case CT_REGION: + REGION_DESTROY(pGC->pScreen, pGC->clientClip); + break; + } +} + +void xnestCopyClip(pGCDst, pGCSrc) + GCPtr pGCSrc; + GCPtr pGCDst; +{ + RegionPtr pRgn; + int nRects, size; + xRectangle *pRects; + + switch (pGCSrc->clientClipType) + { + default: + case CT_NONE: + xnestDestroyClip(pGCDst); + break; + + case CT_REGION: + pRgn = REGION_CREATE(pGCDst->pScreen, NULL, 1); + REGION_COPY(pGCDst->pScreen, pRgn, pGCSrc->clientClip); + xnestChangeClip(pGCDst, CT_REGION, pRgn, 0); + break; + } +} diff --git a/xc/programs/Xserver/hw/xnest/GCOps.c b/xc/programs/Xserver/hw/xnest/GCOps.c new file mode 100644 index 000000000..977329608 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/GCOps.c @@ -0,0 +1,388 @@ +/* $XConsortium: GCOps.c /main/10 1996/12/02 10:21:24 lehors $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/GCOps.c,v 3.3 1996/12/23 07:09:14 dawes Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "miscstruct.h" +#include "fontstruct.h" +#include "gcstruct.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "pixmapstr.h" +#include "region.h" +#include "servermd.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "XNGC.h" +#include "XNFont.h" +#include "GCOps.h" +#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; +{ + 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; +{ + 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; +{ + ErrorF("xnest warning: function xnestGetSpans not implemented\n"); +} + +void xnestQueryBestSize(class, pWidth, pHeight, pScreen) + int class; + short *pWidth; + short *pHeight; + ScreenPtr pScreen; +{ + unsigned int width, height; + + width = *pWidth; + height = *pHeight; + + XQueryBestSize(xnestDisplay, class, + xnestDefaultWindows[pScreen->myNum], + width, height, &width, &height); + + *pWidth = width; + *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; +{ + XImage *ximage; + + ximage = XCreateImage(xnestDisplay, xnestDefaultVisual(pDrawable->pScreen), + depth, format, leftPad, (char *)pImage, + w, h, BitmapPad(xnestDisplay), + (format == ZPixmap) ? + PixmapBytePad(w, depth) : BitmapBytePad(w+leftPad)); + + if (ximage) { + XPutImage(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + ximage, 0, 0, x, y, w, h); + XFree(ximage); + } +} + +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; +{ + XImage *ximage; + int length; + + ximage = XGetImage(xnestDisplay, xnestDrawable(pDrawable), + x, y, w, h, planeMask, format); + + if (ximage) { + length = ximage->bytes_per_line * ximage->height; + + memmove(pImage, ximage->data, length); + + XDestroyImage(ximage); + } +} + +static Bool xnestBitBlitPredicate(display, event, args) + Display *display; + XEvent *event; + char *args; +{ + return (event->type == GraphicsExpose || event->type == NoExpose); +} + +RegionPtr xnestBitBlitHelper(pGC) + GC *pGC; +{ + if (!pGC->graphicsExposures) + return NullRegion; + else { + XEvent event; + RegionPtr pReg, pTmpReg; + BoxRec Box; + Bool pending, overlap; + + pReg = REGION_CREATE(pGC->pScreen, NULL, 1); + pTmpReg = REGION_CREATE(pGC->pScreen, NULL, 1); + if(!pReg || !pTmpReg) return NullRegion; + + pending = True; + while (pending) { + XIfEvent(xnestDisplay, &event, xnestBitBlitPredicate, NULL); + + switch (event.type) { + case NoExpose: + pending = False; + break; + + case GraphicsExpose: + Box.x1 = event.xgraphicsexpose.x; + Box.y1 = event.xgraphicsexpose.y; + Box.x2 = event.xgraphicsexpose.x + event.xgraphicsexpose.width; + Box.y2 = event.xgraphicsexpose.y + event.xgraphicsexpose.height; + REGION_RESET(pGC->pScreen, pTmpReg, &Box); + REGION_APPEND(pGC->pScreen, pReg, pTmpReg); + pending = event.xgraphicsexpose.count; + break; + } + } + + REGION_DESTROY(pGC->pScreen, pTmpReg); + REGION_VALIDATE(pGC->pScreen, pReg, &overlap); + return(pReg); + } +} + +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; +{ + XCopyArea(xnestDisplay, + xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable), + xnestGC(pGC), srcx, srcy, width, height, dstx, dsty); + + 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; +{ + XCopyPlane(xnestDisplay, + xnestDrawable(pSrcDrawable), xnestDrawable(pDstDrawable), + xnestGC(pGC), srcx, srcy, width, height, dstx, dsty, plane); + + return xnestBitBlitHelper(pGC); +} + +void xnestPolyPoint(pDrawable, pGC, mode, nPoints, pPoints) + DrawablePtr pDrawable; + GCPtr pGC; + int mode; + int nPoints; + XPoint *pPoints; +{ + XDrawPoints(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + pPoints, nPoints, mode); +} + +void xnestPolylines(pDrawable, pGC, mode, nPoints, pPoints) + DrawablePtr pDrawable; + GCPtr pGC; + int mode; + int nPoints; + XPoint *pPoints; +{ + XDrawLines(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + pPoints, nPoints, mode); +} + +void xnestPolySegment(pDrawable, pGC, nSegments, pSegments) + DrawablePtr pDrawable; + GCPtr pGC; + int nSegments; + XSegment *pSegments; +{ + XDrawSegments(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + pSegments, nSegments); +} + +void xnestPolyRectangle(pDrawable, pGC, nRectangles, pRectangles) + DrawablePtr pDrawable; + GCPtr pGC; + int nRectangles; + XRectangle *pRectangles; +{ + XDrawRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + pRectangles, nRectangles); +} + +void xnestPolyArc(pDrawable, pGC, nArcs, pArcs) + DrawablePtr pDrawable; + GCPtr pGC; + int nArcs; + XArc *pArcs; +{ + XDrawArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + pArcs, nArcs); +} + +void xnestFillPolygon(pDrawable, pGC, shape, mode, nPoints, pPoints) + DrawablePtr pDrawable; + GCPtr pGC; + int shape; + int mode; + int nPoints; + XPoint *pPoints; +{ + XFillPolygon(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + pPoints, nPoints, shape, mode); +} + +void xnestPolyFillRect(pDrawable, pGC, nRectangles, pRectangles) + DrawablePtr pDrawable; + GCPtr pGC; + int nRectangles; + XRectangle *pRectangles; +{ + XFillRectangles(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + pRectangles, nRectangles); +} + +void xnestPolyFillArc(pDrawable, pGC, nArcs, pArcs) + DrawablePtr pDrawable; + GCPtr pGC; + int nArcs; + XArc *pArcs; +{ + XFillArcs(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + pArcs, nArcs); +} + +int xnestPolyText8(pDrawable, pGC, x, y, count, string) + DrawablePtr pDrawable; + GCPtr pGC; + int x, y; + int count; + char *string; +{ + int width; + + XDrawString(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + x, y, string, count); + + width = XTextWidth(xnestFontStruct(pGC->font), string, count); + + return width + x; +} + +int xnestPolyText16(pDrawable, pGC, x, y, count, string) + DrawablePtr pDrawable; + GCPtr pGC; + int x, y; + int count; + XChar2b *string; +{ + int width; + + XDrawString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + x, y, string, count); + + width = XTextWidth16(xnestFontStruct(pGC->font), string, count); + + return width + x; +} + +void xnestImageText8(pDrawable, pGC, x, y, count, string) + DrawablePtr pDrawable; + GCPtr pGC; + int x, 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; +{ + XDrawImageString16(xnestDisplay, xnestDrawable(pDrawable), xnestGC(pGC), + x, y, string, count); +} + +void xnestImageGlyphBlt(pDrawable, pGC, x, y, nGlyphs, pCharInfo, pGlyphBase) + DrawablePtr pDrawable; + GC pGC; + int x, y; + int nGlyphs; + CharInfoPtr pCharInfo; + char 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; +{ + 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; +{ + ErrorF("xnest warning: function xnestPushPixels not implemented\n"); +} diff --git a/xc/programs/Xserver/hw/xnest/GCOps.h b/xc/programs/Xserver/hw/xnest/GCOps.h new file mode 100644 index 000000000..98c31205b --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/GCOps.h @@ -0,0 +1,43 @@ +/* $XConsortium: GCOps.h,v 1.2 93/09/20 20:18:48 dpw Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#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(); + +#endif /* XNESTGCOPS_H */ diff --git a/xc/programs/Xserver/hw/xnest/GetTime.c b/xc/programs/Xserver/hw/xnest/GetTime.c new file mode 100644 index 000000000..bd4df1777 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/GetTime.c @@ -0,0 +1,43 @@ +/* $XConsortium: GetTime.c,v 1.5 94/04/17 20:30:01 dpw Exp $ */ +/* + +Copyright (c) 1993 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + + +#include "Xos.h" +#include <time.h> + +long +GetTimeInMillis() +{ + struct timeval tp; + + X_GETTIMEOFDAY(&tp); + return(tp.tv_sec * 1000) + (tp.tv_usec / 1000); +} diff --git a/xc/programs/Xserver/hw/xnest/Handlers.c b/xc/programs/Xserver/hw/xnest/Handlers.c new file mode 100644 index 000000000..ecfd95ea8 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Handlers.c @@ -0,0 +1,43 @@ +/* $XConsortium: Handlers.c,v 1.2 95/07/10 17:42:22 ray Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "screenint.h" +#include "input.h" +#include "misc.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "servermd.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Handlers.h" + +void xnestBlockHandler(blockData, pTimeout, pReadMask) + pointer blockData; + pointer pTimeout; + pointer pReadMask; +{ + xnestCollectExposures(); + XFlush(xnestDisplay); +} + +void xnestWakeupHandler(result, pReadMask) + int result; + pointer pReadMask; +{ + xnestCollectEvents(); +} diff --git a/xc/programs/Xserver/hw/xnest/Handlers.h b/xc/programs/Xserver/hw/xnest/Handlers.h new file mode 100644 index 000000000..ef4380118 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Handlers.h @@ -0,0 +1,22 @@ +/* $XConsortium: Handlers.h,v 1.1 93/07/12 15:28:31 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTHANDLERS_H +#define XNESTHANDLERS_H + +void xnestBlockHandler(); +void xnestWakeupHandler(); + +#endif /* XNESTHANDLERS_H */ diff --git a/xc/programs/Xserver/hw/xnest/Imakefile b/xc/programs/Xserver/hw/xnest/Imakefile new file mode 100644 index 000000000..6820123af --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Imakefile @@ -0,0 +1,75 @@ +XCOMM $TOG: Imakefile /main/12 1997/11/03 14:13:20 kaleb $ +XCOMM $XFree86: xc/programs/Xserver/hw/xnest/Imakefile,v 3.13 1999/06/14 07:32:10 dawes Exp $ +#include <Server.tmpl> + +#ifdef OS2Architecture +SRCS1 = os2Stub.c +OBJS1 = os2Stub.o +#endif + +SRCS = Args.c \ + Color.c \ + Cursor.c \ + Display.c \ + Events.c \ + Font.c \ + GC.c \ + GCOps.c \ + GetTime.c \ + Handlers.c \ + Init.c \ + Keyboard.c \ + Pixmap.c \ + Pointer.c \ + Screen.c \ + TestExt.c \ + Visual.c \ + Window.c \ + stubs.c \ + miinitext.c $(SRCS1) + +OBJS = Args.o \ + Color.o \ + Cursor.o \ + Display.o \ + Events.o \ + Font.o \ + GC.o \ + GCOps.o \ + GetTime.o \ + Handlers.o \ + Init.o \ + Keyboard.o \ + Pixmap.o \ + Pointer.o \ + Screen.o \ + TestExt.o \ + Visual.o \ + Window.o \ + stubs.o \ + miinitext.o $(OBJS1) + + +INCLUDES = -I$(BUILDINCDIR) -I$(FONTINCSRC) \ + -I../../mi -I../../include -I../../os \ + -I$(EXTINCSRC) -I$(INCLUDESRC) -I. + +all:: $(OBJS) + +INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ + -I../../mi -I../../include -I../../os \ + -I$(EXTINCSRC) -I$(XINCLUDESRC) + +LinkSourceFile(stubs.c,$(SERVERSRC)/Xi) +SpecialCObjectRule(Init,$(ICONFIGFILES),$(EXT_DEFINES)) +LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) +SpecialCObjectRule(miinitext,$(ICONFIGFILES),$(OS_DEFINES) -UXINPUT \ + -UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UMITSHM -UDPMSExtension \ + -UXF86DRI) + +NormalLibraryObjectRule() +NormalLibraryTarget(xnest,$(OBJS)) + +InstallManPage(Xnest,$(MANDIR)) + +DependTarget() diff --git a/xc/programs/Xserver/hw/xnest/Init.c b/xc/programs/Xserver/hw/xnest/Init.c new file mode 100644 index 000000000..b0ee70b96 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Init.c @@ -0,0 +1,164 @@ +/* $TOG: Init.c /main/8 1997/11/12 14:38:50 kaleb $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +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.18 1999/05/14 14:11:22 dawes Exp $ */ + +#include "X.h" +#include "Xproto.h" +#include "screenint.h" +#include "input.h" +#include "misc.h" +#include "scrnintstr.h" +#include "windowstr.h" +#include "servermd.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "Pointer.h" +#include "Keyboard.h" +#include "Handlers.h" +#include "Init.h" +#include "Args.h" +#include "Drawable.h" +#include "XNGC.h" +#include "XNFont.h" + +#ifdef XFree86Server +/* + * when building the loader, we add some code that tries to + * switch bit ordering based on xf86bpp; since Xnest doesn't + * use that, we have to add this dummy here + */ +int xf86bpp = 8; +#endif + +Bool xnestDoFullGeneration = True; + +void InitOutput(screenInfo, argc, argv) + ScreenInfo *screenInfo; + int argc; + char *argv[]; +{ + int i, j; + + xnestOpenDisplay(argc, argv); + + screenInfo->imageByteOrder = ImageByteOrder(xnestDisplay); + screenInfo->bitmapScanlineUnit = BitmapUnit(xnestDisplay); + screenInfo->bitmapScanlinePad = BitmapPad(xnestDisplay); + screenInfo->bitmapBitOrder = BitmapBitOrder(xnestDisplay); + + screenInfo->numPixmapFormats = 0; + for (i = 0; i < xnestNumPixmapFormats; i++) + for (j = 0; j < xnestNumDepths; j++) + if ((xnestPixmapFormats[i].depth == 1) || + (xnestPixmapFormats[i].depth == xnestDepths[j])) { + screenInfo->formats[screenInfo->numPixmapFormats].depth = + xnestPixmapFormats[i].depth; + screenInfo->formats[screenInfo->numPixmapFormats].bitsPerPixel = + xnestPixmapFormats[i].bits_per_pixel; + screenInfo->formats[screenInfo->numPixmapFormats].scanlinePad = + xnestPixmapFormats[i].scanline_pad; + screenInfo->numPixmapFormats++; + } + + xnestWindowPrivateIndex = AllocateWindowPrivateIndex(); + xnestGCPrivateIndex = AllocateGCPrivateIndex(); + xnestFontPrivateIndex = AllocateFontPrivateIndex(); + + if (!xnestNumScreens) xnestNumScreens = 1; + + for (i = 0; i < xnestNumScreens; i++) + AddScreen(xnestOpenScreen, argc, argv); + + xnestNumScreens = screenInfo->numScreens; + + xnestDoFullGeneration = xnestFullGeneration; +} + +void InitInput(argc, argv) + int argc; + char *argv[]; +{ + DeviceIntPtr ptr, kbd; + + ptr = AddInputDevice(xnestPointerProc, TRUE); + kbd = AddInputDevice(xnestKeyboardProc, TRUE); + + RegisterPointerDevice(ptr); + RegisterKeyboardDevice(kbd); + + mieqInit(kbd, ptr); + + AddEnabledDevice(XConnectionNumber(xnestDisplay)); + + RegisterBlockAndWakeupHandlers(xnestBlockHandler, xnestWakeupHandler, NULL); +} + +/* + * DDX - specific abort routine. Called by AbortServer(). + */ +void AbortDDX() +{ + xnestDoFullGeneration = True; + xnestCloseDisplay(); +} + +/* Called by GiveUp(). */ +void ddxGiveUp() +{ + AbortDDX(); +} + +void OsVendorInit() +{ + return; +} + +void OsVendorFatalError() +{ + return; +} + +/* this is just to get the server to link on AIX */ +#ifdef AIXV3 +int SelectWaitTime = 10000; /* usec */ +#endif + +#ifdef DPMSExtension +/************************************************************** + * DPMSSet(), DPMSGet(), DPMSSupported() + * + * stubs + * + ***************************************************************/ + +void DPMSSet (level) + int level; +{ +} + +int DPMSGet (level) + int* level; +{ + return -1; +} + +Bool DPMSSupported () +{ + return FALSE; +} +#endif diff --git a/xc/programs/Xserver/hw/xnest/Init.h b/xc/programs/Xserver/hw/xnest/Init.h new file mode 100644 index 000000000..84a81bfd1 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Init.h @@ -0,0 +1,21 @@ +/* $XConsortium: Init.h,v 1.1 93/07/12 15:28:35 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTINIT_H +#define XNESTINIT_H + +extern Bool xnestDoFullGeneration; + +#endif /* XNESTINIT_H */ diff --git a/xc/programs/Xserver/hw/xnest/Keyboard.c b/xc/programs/Xserver/hw/xnest/Keyboard.c new file mode 100644 index 000000000..89c44a005 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Keyboard.c @@ -0,0 +1,165 @@ +/* $TOG: Keyboard.c /main/5 1998/04/21 09:19:15 msr $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#define NEED_EVENTS +#include "X.h" +#include "Xproto.h" +#include "keysym.h" +#include "screenint.h" +#include "inputstr.h" +#include "misc.h" +#include "scrnintstr.h" +#include "servermd.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "Keyboard.h" +#include "Args.h" + +void xnestBell(volume, pDev, ctrl, cls) + int volume; + DeviceIntPtr pDev; + pointer ctrl; + int cls; +{ + XBell(xnestDisplay, volume); +} + +void xnestChangeKeyboardControl(pDev, ctrl) + DeviceIntPtr pDev; + KeybdCtrl *ctrl; +{ + unsigned long value_mask; + XKeyboardControl values; + int i; + + value_mask = KBKeyClickPercent | + KBBellPercent | + KBBellPitch | + KBBellDuration | + KBAutoRepeatMode; + + values.key_click_percent = ctrl->click; + values.bell_percent = ctrl->bell; + values.bell_pitch = ctrl->bell_pitch; + values.bell_duration = ctrl->bell_duration; + values.auto_repeat_mode = ctrl->autoRepeat ? + AutoRepeatModeOn : AutoRepeatModeOff; + + XChangeKeyboardControl(xnestDisplay, value_mask, &values); + + /* + value_mask = KBKey | KBAutoRepeatMode; + At this point, we need to walk through the vector and compare it + to the current server vector. If there are differences, report them. + */ + + value_mask = KBLed | KBLedMode; + for (i = 1; i <= 32; i++) { + values.led = i; + values.led_mode = (ctrl->leds & (1 << (i - 1))) ? LedModeOn : LedModeOff; + XChangeKeyboardControl(xnestDisplay, value_mask, &values); + } +} + +int xnestKeyboardProc(pDev, onoff, argc, argv) + DevicePtr pDev; + int onoff, argc; + char *argv[]; +{ + XModifierKeymap *modifier_keymap; + KeySym *keymap; + int mapWidth; + int min_keycode, max_keycode; + KeySymsRec keySyms; + CARD8 modmap[256]; + int i, j; + XKeyboardState values; + + switch (onoff) + { + case DEVICE_INIT: + modifier_keymap = XGetModifierMapping(xnestDisplay); + XDisplayKeycodes(xnestDisplay, &min_keycode, &max_keycode); +#ifdef _XSERVER64 + { + KeySym64 *keymap64; + int i, len; + keymap64 = XGetKeyboardMapping(xnestDisplay, + min_keycode, + max_keycode - min_keycode + 1, + &mapWidth); + len = (max_keycode - min_keycode + 1) * mapWidth; + keymap = (KeySym *)xalloc(len * sizeof(KeySym)); + for(i = 0; i < len; ++i) + keymap[i] = keymap64[i]; + XFree(keymap64); + } +#else + keymap = XGetKeyboardMapping(xnestDisplay, + min_keycode, + max_keycode - min_keycode + 1, + &mapWidth); +#endif + + for (i = 0; i < 256; i++) + modmap[i] = 0; + for (j = 0; j < 8; j++) + for(i = 0; i < modifier_keymap->max_keypermod; i++) { + CARD8 keycode; + if (keycode = + modifier_keymap-> + modifiermap[j * modifier_keymap->max_keypermod + i]) + modmap[keycode] |= 1<<j; + } + XFreeModifiermap(modifier_keymap); + + keySyms.minKeyCode = min_keycode; + keySyms.maxKeyCode = max_keycode; + keySyms.mapWidth = mapWidth; + keySyms.map = keymap; + + XGetKeyboardControl(xnestDisplay, &values); + + memmove((char *) defaultKeyboardControl.autoRepeats, + (char *) values.auto_repeats, sizeof(values.auto_repeats)); + + InitKeyboardDeviceStruct(pDev, &keySyms, modmap, + xnestBell, xnestChangeKeyboardControl); + XFree(keymap); + break; + case DEVICE_ON: + xnestEventMask |= XNEST_KEYBOARD_EVENT_MASK; + for (i = 0; i < xnestNumScreens; i++) + XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); + break; + case DEVICE_OFF: + xnestEventMask &= ~XNEST_KEYBOARD_EVENT_MASK; + for (i = 0; i < xnestNumScreens; i++) + XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); + break; + case DEVICE_CLOSE: + break; + } + return Success; +} + +Bool LegalModifier(key, pDev) + unsigned int key; + DevicePtr pDev; +{ + return TRUE; +} diff --git a/xc/programs/Xserver/hw/xnest/Keyboard.h b/xc/programs/Xserver/hw/xnest/Keyboard.h new file mode 100644 index 000000000..99eeacb10 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Keyboard.h @@ -0,0 +1,26 @@ +/* $XConsortium: Keyboard.h,v 1.1 93/07/12 15:28:38 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTKEYBOARD_H +#define XNESTKEYBOARD_H + +#define XNEST_KEYBOARD_EVENT_MASK \ + (KeyPressMask | KeyReleaseMask | FocusChangeMask | KeymapStateMask) + +void xnestBell(); +void xnestChangeKeyboardControl(); +int xnestKeyboardProc(); + +#endif /* XNESTKEYBOARD_H */ diff --git a/xc/programs/Xserver/hw/xnest/Pixmap.c b/xc/programs/Xserver/hw/xnest/Pixmap.c new file mode 100644 index 000000000..98f1e3389 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Pixmap.c @@ -0,0 +1,130 @@ +/* $XConsortium: Pixmap.c,v 1.3 95/07/10 17:42:22 ray Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "miscstruct.h" +#include "pixmapstr.h" +#include "scrnintstr.h" +#include "regionstr.h" +#include "gc.h" +#include "servermd.h" +#include "mi.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "Pixmap.h" + +PixmapPtr xnestCreatePixmap(pScreen, width, height, depth) + ScreenPtr pScreen; + int width; + int height; + int depth; +{ + PixmapPtr pPixmap; + + pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + sizeof(xnestPrivPixmap)); + if (!pPixmap) + return NullPixmap; + pPixmap->drawable.type = DRAWABLE_PIXMAP; + pPixmap->drawable.class = 0; + pPixmap->drawable.depth = depth; + pPixmap->drawable.bitsPerPixel = depth; + pPixmap->drawable.id = 0; + pPixmap->drawable.x = 0; + pPixmap->drawable.y = 0; + pPixmap->drawable.width = width; + pPixmap->drawable.height = height; + pPixmap->drawable.pScreen = pScreen; + pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; + pPixmap->refcnt = 1; + pPixmap->devKind = PixmapBytePad(width, depth); + pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1); + if (width && height) + xnestPixmapPriv(pPixmap)->pixmap = + XCreatePixmap(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + width, height, depth); + else + xnestPixmapPriv(pPixmap)->pixmap = 0; + + return pPixmap; +} + +Bool xnestDestroyPixmap(pPixmap) + PixmapPtr pPixmap; +{ + if(--pPixmap->refcnt) + return TRUE; + XFreePixmap(xnestDisplay, xnestPixmap(pPixmap)); + xfree(pPixmap); + return TRUE; +} + +RegionPtr xnestPixmapToRegion(pPixmap) + PixmapPtr pPixmap; +{ + XImage *ximage; + register RegionPtr pReg, pTmpReg; + register int x, y; + unsigned long previousPixel, currentPixel; + BoxRec Box; + int nWidth; + Bool overlap; + + ximage = XGetImage(xnestDisplay, xnestPixmap(pPixmap), 0, 0, + pPixmap->drawable.width, pPixmap->drawable.height, + 1, XYPixmap); + + pReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1); + pTmpReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1); + if(!pReg || !pTmpReg) return NullRegion; + + for (y = 0; y < pPixmap->drawable.height; y++) { + Box.y1 = y; + Box.y2 = y + 1; + previousPixel = 0L; + for (x = 0; x < pPixmap->drawable.width; x++) { + currentPixel = XGetPixel(ximage, x, y); + if (previousPixel != currentPixel) { + if (previousPixel == 0L) { + /* left edge */ + Box.x1 = x; + } + else if (currentPixel == 0L) { + /* right edge */ + Box.x2 = x; + REGION_RESET(pPixmap->drawable.pScreen, pTmpReg, &Box); + REGION_APPEND(pPixmap->drawable.pScreen, pReg, pTmpReg); + } + previousPixel = currentPixel; + } + } + if (previousPixel != 0L) { + /* right edge because of the end of pixmap */ + Box.x2 = pPixmap->drawable.width; + REGION_RESET(pPixmap->drawable.pScreen, pTmpReg, &Box); + REGION_APPEND(pPixmap->drawable.pScreen, pReg, pTmpReg); + } + } + + REGION_DESTROY(pPixmap->drawable.pScreen, pTmpReg); + XDestroyImage(ximage); + + REGION_VALIDATE(pPixmap->drawable.pScreen, pReg, &overlap); + + return(pReg); +} diff --git a/xc/programs/Xserver/hw/xnest/Pixmap.h b/xc/programs/Xserver/hw/xnest/Pixmap.h new file mode 100644 index 000000000..3331bb306 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Pixmap.h @@ -0,0 +1,34 @@ +/* $XConsortium: Pixmap.h,v 1.1 93/07/12 15:28:41 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTPIXMAP_H +#define XNESTPIXMAP_H + +typedef struct { + Pixmap pixmap; +} xnestPrivPixmap; + +#define xnestPixmapPriv(pPixmap) \ + ((xnestPrivPixmap *)((pPixmap)->devPrivate.ptr)) + +#define xnestPixmap(pPixmap) (xnestPixmapPriv(pPixmap)->pixmap) + +#define xnestSharePixmap(pPixmap) ((pPixmap)->refcnt++) + +PixmapPtr xnestCreatePixmap(); +Bool xnestDestroyPixmap(); +RegionPtr xnestPixmapToRegion(); + +#endif /* XNESTPIXMAP_H */ diff --git a/xc/programs/Xserver/hw/xnest/Pointer.c b/xc/programs/Xserver/hw/xnest/Pointer.c new file mode 100644 index 000000000..8b82c1ed8 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Pointer.c @@ -0,0 +1,73 @@ +/* $XConsortium: Pointer.c /main/3 1996/09/28 17:13:56 rws $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "screenint.h" +#include "input.h" +#include "misc.h" +#include "scrnintstr.h" +#include "servermd.h" +#include "mipointer.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "Pointer.h" +#include "Args.h" + +void xnestChangePointerControl(pDev, ctrl) + 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[]; +{ + CARD8 map[MAXBUTTONS]; + int nmap; + int i; + + switch (onoff) + { + case DEVICE_INIT: + nmap = XGetPointerMapping(xnestDisplay, map, MAXBUTTONS); + for (i = 0; i <= nmap; i++) + map[i] = i; /* buttons are already mapped */ + InitPointerDeviceStruct(pDev, map, nmap, + miPointerGetMotionEvents, + xnestChangePointerControl, + miPointerGetMotionBufferSize()); + break; + case DEVICE_ON: + xnestEventMask |= XNEST_POINTER_EVENT_MASK; + for (i = 0; i < xnestNumScreens; i++) + XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); + break; + case DEVICE_OFF: + xnestEventMask &= ~XNEST_POINTER_EVENT_MASK; + for (i = 0; i < xnestNumScreens; i++) + XSelectInput(xnestDisplay, xnestDefaultWindows[i], xnestEventMask); + break; + case DEVICE_CLOSE: + break; + } + return Success; +} diff --git a/xc/programs/Xserver/hw/xnest/Pointer.h b/xc/programs/Xserver/hw/xnest/Pointer.h new file mode 100644 index 000000000..784c1fe21 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Pointer.h @@ -0,0 +1,28 @@ +/* $XConsortium: Pointer.h,v 1.1 93/07/12 15:28:44 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTPOINTER_H +#define XNESTPOINTER_H + +#define MAXBUTTONS 256 + +#define XNEST_POINTER_EVENT_MASK \ + (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \ + EnterWindowMask | LeaveWindowMask) + +void xnestChangePointerControl(); +int xnestPointerProc(); + +#endif /* XNESTPOINTER_H */ diff --git a/xc/programs/Xserver/hw/xnest/Screen.c b/xc/programs/Xserver/hw/xnest/Screen.c new file mode 100644 index 000000000..7e4b6b119 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Screen.c @@ -0,0 +1,378 @@ +/* $XConsortium: Screen.c /main/8 1996/12/02 10:21:46 lehors $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Screen.c,v 3.7 1998/12/20 11:57:54 dawes Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "scrnintstr.h" +#include "dix.h" +#include "mi.h" +#include "mibstore.h" +#include "colormapst.h" +#include "resource.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "Args.h" +#include "XNGC.h" +#include "GCOps.h" +#include "Drawable.h" +#include "XNFont.h" +#include "Color.h" +#include "Cursor.h" +#include "Visual.h" +#include "Events.h" +#include "Init.h" +#include "Args.h" + +extern Window xnestParentWindow; + +Window xnestDefaultWindows[MAXSCREENS]; +Window xnestScreenSaverWindows[MAXSCREENS]; + +ScreenPtr xnestScreen(window) + Window window; +{ + int i; + + for (i = 0; i < xnestNumScreens; i++) + if (xnestDefaultWindows[i] == window) + return screenInfo.screens[i]; + + return NULL; +} + +static int offset(mask) + unsigned long mask; +{ + int count; + + for (count = 0; !(mask & 1) && count < 32; count++) + mask >>= 1; + + return count; +} + +static Bool xnestSaveScreen(pScreen, what) + ScreenPtr pScreen; + int what; +{ + if (xnestSoftwareScreenSaver) + return False; + else { + switch (what) { + case SCREEN_SAVER_ON: + XMapRaised(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]); + xnestSetScreenSaverColormapWindow(pScreen); + break; + + case SCREEN_SAVER_OFF: + XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]); + xnestSetInstalledColormapWindows(pScreen); + break; + + case SCREEN_SAVER_FORCER: + lastEventTime = GetTimeInMillis(); + XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]); + xnestSetInstalledColormapWindows(pScreen); + break; + + case SCREEN_SAVER_CYCLE: + XUnmapWindow(xnestDisplay, xnestScreenSaverWindows[pScreen->myNum]); + xnestSetInstalledColormapWindows(pScreen); + break; + } + return True; + } +} + +Bool xnestOpenScreen(index, pScreen, argc, argv) + int index; + register ScreenPtr pScreen; + int argc; + char *argv[]; +{ + VisualPtr visuals; + DepthPtr depths; + int numVisuals, numDepths; + int i, j, depthIndex; + unsigned long valuemask; + XSetWindowAttributes attributes; + XWindowAttributes gattributes; + XSizeHints sizeHints; + + if (!(AllocateWindowPrivate(pScreen, xnestWindowPrivateIndex, + sizeof(xnestPrivWin)) && + AllocateGCPrivate(pScreen, xnestGCPrivateIndex, + sizeof(xnestPrivGC)))) + return False; + + visuals = (VisualPtr)xalloc(xnestNumVisuals * sizeof(VisualRec)); + numVisuals = 0; + + depths = (DepthPtr)xalloc(MAXDEPTH * sizeof(DepthRec)); + depths[0].depth = 1; + depths[0].numVids = 0; + depths[0].vids = (VisualID *)xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); + 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; + visuals[numVisuals].nplanes = xnestVisuals[i].depth; + visuals[numVisuals].redMask = xnestVisuals[i].red_mask; + visuals[numVisuals].greenMask = xnestVisuals[i].green_mask; + visuals[numVisuals].blueMask = xnestVisuals[i].blue_mask; + visuals[numVisuals].offsetRed = offset(xnestVisuals[i].red_mask); + visuals[numVisuals].offsetGreen = offset(xnestVisuals[i].green_mask); + visuals[numVisuals].offsetBlue = offset(xnestVisuals[i].blue_mask); + + depthIndex = UNDEFINED; + for (j = 0; j < numDepths; j++) + if (depths[j].depth == xnestVisuals[i].depth) { + depthIndex = j; + break; + } + + if (depthIndex == UNDEFINED) { + depthIndex = numDepths; + depths[depthIndex].depth = xnestVisuals[i].depth; + depths[depthIndex].numVids = 0; + depths[depthIndex].vids = + (VisualID *)xalloc(MAXVISUALSPERDEPTH * sizeof(VisualID)); + numDepths++; + } + if (depths[depthIndex].numVids >= MAXVISUALSPERDEPTH) { + FatalError("Visual table overflow"); + } + depths[depthIndex].vids[depths[depthIndex].numVids] = + visuals[numVisuals].vid; + depths[depthIndex].numVids++; + + numVisuals++; + } + + if (xnestParentWindow != 0) { + XGetWindowAttributes(xnestDisplay, xnestParentWindow, &gattributes); + xnestWidth = gattributes.width; + xnestHeight = gattributes.height; + } + + /* myNum */ + /* id */ + miScreenInit(pScreen, NULL, xnestWidth, xnestHeight, 1, 1, xnestWidth, + visuals[xnestDefaultVisualIndex].nplanes, /* rootDepth */ + numDepths, depths, + visuals[xnestDefaultVisualIndex].vid, /* root visual */ + numVisuals, visuals); + + miInitializeBackingStore(pScreen); + + pScreen->mmWidth = xnestWidth * DisplayWidthMM(xnestDisplay, + DefaultScreen(xnestDisplay)) / + DisplayWidth(xnestDisplay, + DefaultScreen(xnestDisplay)); + pScreen->mmHeight = xnestHeight * DisplayHeightMM(xnestDisplay, + DefaultScreen(xnestDisplay)) / + DisplayHeight(xnestDisplay, + DefaultScreen(xnestDisplay)); + + pScreen->defColormap = (Colormap) FakeClientID(0); + pScreen->minInstalledCmaps = MINCMAPS; + pScreen->maxInstalledCmaps = MAXCMAPS; + pScreen->backingStoreSupport = NotUseful; + pScreen->saveUnderSupport = NotUseful; + pScreen->whitePixel = xnestWhitePixel; + pScreen->blackPixel = xnestBlackPixel; + /* rgf */ + /* GCperDepth */ + /* PixmapPerDepth */ + pScreen->devPrivate = NULL; + /* WindowPrivateLen */ + /* WindowPrivateSizes */ + /* totalWindowSize */ + /* GCPrivateLen */ + /* GCPrivateSizes */ + /* totalGCSize */ + + /* Random screen procedures */ + + pScreen->CloseScreen = xnestCloseScreen; + pScreen->QueryBestSize = xnestQueryBestSize; + pScreen->SaveScreen = xnestSaveScreen; + pScreen->GetImage = xnestGetImage; + pScreen->GetSpans = xnestGetSpans; + pScreen->PointerNonInterestBox = (void (*)()) 0; + pScreen->SourceValidate = (void (*)()) 0; + + /* Window Procedures */ + + pScreen->CreateWindow = xnestCreateWindow; + pScreen->DestroyWindow = xnestDestroyWindow; + pScreen->PositionWindow = xnestPositionWindow; + pScreen->ChangeWindowAttributes = xnestChangeWindowAttributes; + pScreen->RealizeWindow = xnestRealizeWindow; + pScreen->UnrealizeWindow = xnestUnrealizeWindow; + pScreen->PostValidateTree = (void (*)()) 0; + pScreen->WindowExposures = xnestWindowExposures; + pScreen->PaintWindowBackground = xnestPaintWindowBackground; + pScreen->PaintWindowBorder = xnestPaintWindowBorder; + pScreen->CopyWindow = xnestCopyWindow; + pScreen->ClipNotify = xnestClipNotify; + + /* Pixmap procedures */ + + pScreen->CreatePixmap = xnestCreatePixmap; + pScreen->DestroyPixmap = xnestDestroyPixmap; + + /* 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; + + /* Font procedures */ + + pScreen->RealizeFont = xnestRealizeFont; + pScreen->UnrealizeFont = xnestUnrealizeFont; + + /* Cursor Procedures */ + + pScreen->ConstrainCursor = xnestConstrainCursor; + pScreen->CursorLimits = xnestCursorLimits; + pScreen->DisplayCursor = xnestDisplayCursor; + pScreen->RealizeCursor = xnestRealizeCursor; + pScreen->UnrealizeCursor = xnestUnrealizeCursor; + pScreen->RecolorCursor = xnestRecolorCursor; + pScreen->SetCursorPosition = xnestSetCursorPosition; + + /* GC procedures */ + + pScreen->CreateGC = xnestCreateGC; + + /* Colormap procedures */ + + pScreen->CreateColormap = xnestCreateColormap; + pScreen->DestroyColormap = xnestDestroyColormap; + pScreen->InstallColormap = xnestInstallColormap; + pScreen->UninstallColormap = xnestUninstallColormap; + pScreen->ListInstalledColormaps = xnestListInstalledColormaps; + pScreen->StoreColors = xnestStoreColors; + pScreen->ResolveColor = xnestResolveColor; + + pScreen->BitmapToRegion = xnestPixmapToRegion; + + /* OS layer procedures */ + + pScreen->BlockHandler = (void (*)())NoopDDA; + pScreen->WakeupHandler = (void (*)())NoopDDA; + pScreen->blockData = (pointer)0; + pScreen->wakeupData = (pointer)0; + if (!miScreenDevPrivateInit(pScreen, xnestWidth, NULL)) + return FALSE; + + /* devPrivates */ + +#define POSITION_OFFSET (pScreen->myNum * (xnestWidth + xnestHeight) / 32) + + if (xnestDoFullGeneration) { + + valuemask = CWBackPixel | CWEventMask | CWColormap; + attributes.background_pixel = xnestWhitePixel; + attributes.event_mask = xnestEventMask; + attributes.colormap = xnestDefaultVisualColormap(xnestDefaultVisual(pScreen)); + + if (xnestParentWindow != 0) { + xnestDefaultWindows[pScreen->myNum] = xnestParentWindow; + XSelectInput (xnestDisplay, xnestDefaultWindows[pScreen->myNum], + xnestEventMask); + } else + xnestDefaultWindows[pScreen->myNum] = + XCreateWindow(xnestDisplay, + DefaultRootWindow(xnestDisplay), + xnestX + POSITION_OFFSET, + xnestY + POSITION_OFFSET, + xnestWidth, xnestHeight, + xnestBorderWidth, + pScreen->rootDepth, + InputOutput, + xnestDefaultVisual(pScreen), + valuemask, &attributes); + + if (!xnestWindowName) + xnestWindowName = argv[0]; + + sizeHints.flags = PPosition | PSize | PMaxSize; + sizeHints.x = xnestX + POSITION_OFFSET; + sizeHints.y = xnestY + POSITION_OFFSET; + sizeHints.width = sizeHints.max_width = xnestWidth; + sizeHints.height = sizeHints.max_height = xnestHeight; + if (xnestUserGeometry & XValue || xnestUserGeometry & YValue) + sizeHints.flags |= USPosition; + if (xnestUserGeometry & WidthValue || xnestUserGeometry & HeightValue) + sizeHints.flags |= USSize; + XSetStandardProperties(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + xnestWindowName, + xnestWindowName, + xnestIconBitmap, + argv, argc, &sizeHints); + + XMapWindow(xnestDisplay, xnestDefaultWindows[pScreen->myNum]); + + valuemask = CWBackPixmap | CWColormap; + attributes.background_pixmap = xnestScreenSaverPixmap; + attributes.colormap = + DefaultColormap(xnestDisplay, DefaultScreen(xnestDisplay)); + xnestScreenSaverWindows[pScreen->myNum] = + XCreateWindow(xnestDisplay, + xnestDefaultWindows[pScreen->myNum], + 0, 0, xnestWidth, xnestHeight, 0, + DefaultDepth(xnestDisplay, DefaultScreen(xnestDisplay)), + InputOutput, + DefaultVisual(xnestDisplay, DefaultScreen(xnestDisplay)), + valuemask, &attributes); + } + + if (!xnestCreateDefaultColormap(pScreen)) return False; + + return True; +} + +Bool xnestCloseScreen(index, pScreen) + int index; + ScreenPtr pScreen; +{ + int i; + + for (i = 0; i < pScreen->numDepths; i++) + xfree(pScreen->allowedDepths[i].vids); + xfree(pScreen->allowedDepths); + xfree(pScreen->visuals); + xfree(pScreen->devPrivate); + + /* + If xnestDoFullGeneration all x resources will be destroyed upon closing + the display connection. There is no need to generate extra protocol. + */ + + return True; +} diff --git a/xc/programs/Xserver/hw/xnest/Screen.h b/xc/programs/Xserver/hw/xnest/Screen.h new file mode 100644 index 000000000..63b8d7085 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Screen.h @@ -0,0 +1,26 @@ +/* $XConsortium: Screen.h,v 1.1 93/07/12 15:28:49 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTSCREEN_H +#define XNESTSCREEN_H + +extern Window xnestDefaultWindows[MAXSCREENS]; +extern Window xnestScreenSaverWindows[MAXSCREENS]; + +ScreenPtr xnestScreen(); +Bool xnestOpenScreen(); +Bool xnestCloseScreen(); + +#endif /* XNESTSCREEN_H */ diff --git a/xc/programs/Xserver/hw/xnest/TestExt.c b/xc/programs/Xserver/hw/xnest/TestExt.c new file mode 100644 index 000000000..c1ff6618c --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/TestExt.c @@ -0,0 +1,68 @@ +/* $XConsortium: TestExt.c,v 1.3 94/10/28 20:47:10 dpw Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/TestExt.c,v 3.2 1996/01/07 10:46:49 dawes Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "Xlib.h" +#undef Bool +#include "screenint.h" +#include "input.h" +#include "misc.h" +#include "scrnintstr.h" +#include "servermd.h" +#define XTestSERVER_SIDE +#include "xtestext1.h" + +extern CARD32 lastEventTime; + +void XTestGetPointerPos(fmousex, fmousey) + short *fmousex; + short *fmousey; +{ + int x,y; + + miPointerPosition(&x, &y); + *fmousex = x; + *fmousey = y; +} + +void XTestJumpPointer(jx, jy, dev_type) + 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; +{ +/* + xEvent tevent; + + tevent.u.u.type = (dev_type == XE_POINTER) ? + (keystate == XTestKEY_UP) ? ButtonRelease : ButtonPress : + (keystate == XTestKEY_UP) ? KeyRelease : KeyPress; + tevent.u.u.detail = keycode; + tevent.u.keyButtonPointer.rootX = mousex; + tevent.u.keyButtonPointer.rootY = mousey; + tevent.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); + mieqEnqueue(&tevent); +*/ +} diff --git a/xc/programs/Xserver/hw/xnest/Visual.c b/xc/programs/Xserver/hw/xnest/Visual.c new file mode 100644 index 000000000..33e261502 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Visual.c @@ -0,0 +1,67 @@ +/* $XConsortium: Visual.c,v 1.2 95/07/10 17:42:22 ray Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "scrnintstr.h" +#include "dix.h" +#include "mi.h" +#include "mibstore.h" +#include "Xnest.h" + +#include "Display.h" +#include "Visual.h" + +Visual *xnestVisual(pVisual) + VisualPtr pVisual; +{ + int i; + + for (i = 0; i < xnestNumVisuals; i++) + if (pVisual->class == xnestVisuals[i].class && + pVisual->bitsPerRGBValue == xnestVisuals[i].bits_per_rgb && + pVisual->ColormapEntries == xnestVisuals[i].colormap_size && + pVisual->nplanes == xnestVisuals[i].depth && + pVisual->redMask == xnestVisuals[i].red_mask && + pVisual->greenMask == xnestVisuals[i].green_mask && + pVisual->blueMask == xnestVisuals[i].blue_mask) + return xnestVisuals[i].visual; + + return NULL; +} + +Visual *xnestVisualFromID(pScreen, visual) + ScreenPtr pScreen; + VisualID visual; +{ + int i; + + for (i = 0; i < pScreen->numVisuals; i++) + if (pScreen->visuals[i].vid == visual) + return xnestVisual(&pScreen->visuals[i]); + + return NULL; +} + +Colormap xnestDefaultVisualColormap(visual) + Visual *visual; +{ + int i; + + for (i = 0; i < xnestNumVisuals; i++) + if (xnestVisuals[i].visual == visual) + return xnestDefaultColormaps[i]; + + return None; +} diff --git a/xc/programs/Xserver/hw/xnest/Visual.h b/xc/programs/Xserver/hw/xnest/Visual.h new file mode 100644 index 000000000..44c87c88a --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Visual.h @@ -0,0 +1,26 @@ +/* $XConsortium: Visual.h,v 1.1 93/07/12 15:28:54 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTVISUAL_H +#define XNESTVISUAL_H + +Visual *xnestVisual(); +Visual *xnestVisualFromID(); +Colormap xnestDefaultVisualColormap(); + +#define xnestDefaultVisual(pScreen) \ + xnestVisualFromID((pScreen), (pScreen)->rootVisual) + +#endif /* XNESTVISUAL_H */ diff --git a/xc/programs/Xserver/hw/xnest/Window.c b/xc/programs/Xserver/hw/xnest/Window.c new file mode 100644 index 000000000..6573f1a8e --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Window.c @@ -0,0 +1,556 @@ +/* $XConsortium: Window.c /main/8 1996/12/02 10:21:53 lehors $ */ +/* $XFree86: xc/programs/Xserver/hw/xnest/Window.c,v 3.4 1996/12/27 07:07:53 dawes Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ +#include "X.h" +#include "Xproto.h" +#include "gcstruct.h" +#include "window.h" +#include "windowstr.h" +#include "pixmapstr.h" +#include "colormapst.h" +#include "scrnintstr.h" +#include "region.h" + +#include "Xnest.h" + +#include "Display.h" +#include "Screen.h" +#include "XNGC.h" +#include "Drawable.h" +#include "Color.h" +#include "Visual.h" +#include "Events.h" +#include "Args.h" + +int xnestWindowPrivateIndex; + +static int xnestFindWindowMatch(pWin, ptr) + WindowPtr pWin; + pointer ptr; +{ + xnestWindowMatch *wm = (xnestWindowMatch *)ptr; + if (wm->window == xnestWindow(pWin)) { + wm->pWin = pWin; + return WT_STOPWALKING; + } + else + return WT_WALKCHILDREN; +} + +WindowPtr xnestWindowPtr(window) + Window window; +{ + xnestWindowMatch wm; + int i; + + wm.pWin = NullWindow; + wm.window = window; + + for (i = 0; i < xnestNumScreens; i++) { + WalkTree(screenInfo.screens[i], xnestFindWindowMatch, (pointer) &wm); + if (wm.pWin) break; + } + + return wm.pWin; +} + +Bool xnestCreateWindow(pWin) + WindowPtr pWin; +{ + unsigned long mask; + XSetWindowAttributes attributes; + Visual *visual; + ColormapPtr pCmap; + + if (pWin->drawable.class == InputOnly) { + mask = 0L; + visual = CopyFromParent; + } + else { + mask = CWEventMask | CWBackingStore; + attributes.event_mask = ExposureMask; + attributes.backing_store = NotUseful; + + if (pWin->parent) { + if (pWin->optional && pWin->optional->visual != wVisual(pWin->parent)) { + visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin)); + mask |= CWColormap; + if (pWin->optional->colormap) { + pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP); + attributes.colormap = xnestColormap(pCmap); + } + else + attributes.colormap = xnestDefaultVisualColormap(visual); + } + else + visual = CopyFromParent; + } + else { /* root windows have their own colormaps at creation time */ + visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin)); + pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP); + mask |= CWColormap; + attributes.colormap = xnestColormap(pCmap); + } + } + + xnestWindowPriv(pWin)->window = XCreateWindow(xnestDisplay, + xnestWindowParent(pWin), + pWin->origin.x - + wBorderWidth(pWin), + pWin->origin.y - + wBorderWidth(pWin), + pWin->drawable.width, + pWin->drawable.height, + pWin->borderWidth, + pWin->drawable.depth, + pWin->drawable.class, + visual, + mask, &attributes); + xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin); + xnestWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin); + xnestWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin); + xnestWindowPriv(pWin)->width = pWin->drawable.width; + xnestWindowPriv(pWin)->height = pWin->drawable.height; + xnestWindowPriv(pWin)->border_width = pWin->borderWidth; + xnestWindowPriv(pWin)->sibling_above = None; + if (pWin->nextSib) + xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin); +#ifdef SHAPE + xnestWindowPriv(pWin)->bounding_shape = + REGION_CREATE(pWin->drawable.pScreen, NULL, 1); + xnestWindowPriv(pWin)->clip_shape = + REGION_CREATE(pWin->drawable.pScreen, NULL, 1); +#endif /* SHAPE */ + + if (!pWin->parent) /* only the root window will have the right colormap */ + xnestSetInstalledColormapWindows(pWin->drawable.pScreen); + + return True; +} + +Bool xnestDestroyWindow(pWin) + WindowPtr pWin; +{ + if (pWin->nextSib) + xnestWindowPriv(pWin->nextSib)->sibling_above = + xnestWindowPriv(pWin)->sibling_above; +#ifdef SHAPE + REGION_DESTROY(pWin->drawable.pScreen, + xnestWindowPriv(pWin)->bounding_shape); + REGION_DESTROY(pWin->drawable.pScreen, + xnestWindowPriv(pWin)->clip_shape); +#endif + XDestroyWindow(xnestDisplay, xnestWindow(pWin)); + xnestWindowPriv(pWin)->window = None; + + if (pWin->optional && pWin->optional->colormap && pWin->parent) + xnestSetInstalledColormapWindows(pWin->drawable.pScreen); + + return True; +} + +Bool xnestPositionWindow(pWin, x, y) + WindowPtr pWin; + int x, y; +{ + xnestConfigureWindow(pWin, + CWParent | + CWX | CWY | + CWWidth | CWHeight | + CWBorderWidth); + + return True; +} + +void xnestConfigureWindow(pWin, mask) + WindowPtr pWin; + unsigned int mask; +{ + unsigned int valuemask; + XWindowChanges values; + + if (mask & CWParent && + xnestWindowPriv(pWin)->parent != xnestWindowParent(pWin)) { + XReparentWindow(xnestDisplay, xnestWindow(pWin), + xnestWindowParent(pWin), + pWin->origin.x - wBorderWidth(pWin), + pWin->origin.y - wBorderWidth(pWin)); + xnestWindowPriv(pWin)->parent = xnestWindowParent(pWin); + xnestWindowPriv(pWin)->x = pWin->origin.x - wBorderWidth(pWin); + xnestWindowPriv(pWin)->y = pWin->origin.y - wBorderWidth(pWin); + xnestWindowPriv(pWin)->sibling_above = None; + if (pWin->nextSib) + xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin); + } + + valuemask = 0; + + if (mask & CWX && + xnestWindowPriv(pWin)->x != pWin->origin.x - wBorderWidth(pWin)) { + valuemask |= CWX; + values.x = + xnestWindowPriv(pWin)->x = + pWin->origin.x - wBorderWidth(pWin); + } + + if (mask & CWY && + xnestWindowPriv(pWin)->y != pWin->origin.y - wBorderWidth(pWin)) { + valuemask |= CWY; + values.y = + xnestWindowPriv(pWin)->y = + pWin->origin.y - wBorderWidth(pWin); + } + + if (mask & CWWidth && + xnestWindowPriv(pWin)->width != pWin->drawable.width) { + valuemask |= CWWidth; + values.width = + xnestWindowPriv(pWin)->width = + pWin->drawable.width; + } + + if (mask & CWHeight && + xnestWindowPriv(pWin)->height != pWin->drawable.height) { + valuemask |= CWHeight; + values.height = + xnestWindowPriv(pWin)->height = + pWin->drawable.height; + } + + if (mask & CWBorderWidth && + xnestWindowPriv(pWin)->border_width != pWin->borderWidth) { + valuemask |= CWBorderWidth; + values.border_width = + xnestWindowPriv(pWin)->border_width = + pWin->borderWidth; + } + + if (valuemask) + XConfigureWindow(xnestDisplay, xnestWindow(pWin), valuemask, &values); + + if (mask & CWStackingOrder && + xnestWindowPriv(pWin)->sibling_above != xnestWindowSiblingAbove(pWin)) { + WindowPtr pSib; + + /* find the top sibling */ + for (pSib = pWin; pSib->prevSib != NullWindow; pSib = pSib->prevSib); + + /* the top sibling */ + valuemask = CWStackMode; + values.stack_mode = Above; + XConfigureWindow(xnestDisplay, xnestWindow(pSib), valuemask, &values); + xnestWindowPriv(pSib)->sibling_above = None; + + /* the rest of siblings */ + for (pSib = pSib->nextSib; pSib != NullWindow; pSib = pSib->nextSib) { + valuemask = CWSibling | CWStackMode; + values.sibling = xnestWindowSiblingAbove(pSib); + values.stack_mode = Below; + XConfigureWindow(xnestDisplay, xnestWindow(pSib), valuemask, &values); + xnestWindowPriv(pSib)->sibling_above = xnestWindowSiblingAbove(pSib); + } + } +} + +Bool xnestChangeWindowAttributes(pWin, mask) + WindowPtr pWin; + unsigned long mask; +{ + XSetWindowAttributes attributes; + + if (mask & CWBackPixmap) + switch (pWin->backgroundState) { + case None: + attributes.background_pixmap = None; + break; + + case ParentRelative: + attributes.background_pixmap = ParentRelative; + break; + + case BackgroundPixmap: + attributes.background_pixmap = xnestPixmap(pWin->background.pixmap); + break; + + case BackgroundPixel: + mask &= ~CWBackPixmap; + break; + } + + if (mask & CWBackPixel) + if (pWin->backgroundState == BackgroundPixel) + attributes.background_pixel = xnestPixel(pWin->background.pixel); + else + mask &= ~CWBackPixel; + + if (mask & CWBorderPixmap) + if (pWin->borderIsPixel) + mask &= ~CWBorderPixmap; + else + attributes.border_pixmap = xnestPixmap(pWin->border.pixmap); + + if (mask & CWBorderPixel) + if (pWin->borderIsPixel) + attributes.border_pixel = xnestPixel(pWin->border.pixel); + else + mask &= ~CWBorderPixel; + + if (mask & CWBitGravity) + attributes.bit_gravity = pWin->bitGravity; + + if (mask & CWWinGravity) /* dix does this for us */ + mask &= ~CWWinGravity; + + if (mask & CWBackingStore) /* this is really not useful */ + mask &= ~CWBackingStore; + + if (mask & CWBackingPlanes) /* this is really not useful */ + mask &= ~CWBackingPlanes; + + if (mask & CWBackingPixel) /* this is really not useful */ + mask &= ~CWBackingPixel; + + if (mask & CWOverrideRedirect) + attributes.override_redirect = pWin->overrideRedirect; + + if (mask & CWSaveUnder) /* this is really not useful */ + mask &= ~CWSaveUnder; + + if (mask & CWEventMask) /* events are handled elsewhere */ + mask &= ~CWEventMask; + + if (mask & CWDontPropagate) /* events are handled elsewhere */ + mask &= ~CWDontPropagate; + + if (mask & CWColormap) { + ColormapPtr pCmap; + + pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP); + + attributes.colormap = xnestColormap(pCmap); + + xnestSetInstalledColormapWindows(pWin->drawable.pScreen); + } + + if (mask & CWCursor) /* this is handeled in cursor code */ + mask &= ~CWCursor; + + if (mask) + XChangeWindowAttributes(xnestDisplay, xnestWindow(pWin), + mask, &attributes); + + return True; +} + +Bool xnestRealizeWindow(pWin) + WindowPtr pWin; +{ + xnestConfigureWindow(pWin, CWStackingOrder); +#ifdef SHAPE + xnestShapeWindow(pWin); +#endif /* SHAPE */ + XMapWindow(xnestDisplay, xnestWindow(pWin)); + + return True; +} + +Bool xnestUnrealizeWindow(pWin) + WindowPtr pWin; +{ + XUnmapWindow(xnestDisplay, xnestWindow(pWin)); + + return True; +} + +void xnestPaintWindowBackground(pWin, pRegion, what) + WindowPtr pWin; + RegionPtr pRegion; + int what; +{ + int i; + BoxPtr pBox; + + xnestConfigureWindow(pWin, CWWidth | CWHeight); + + pBox = REGION_RECTS(pRegion); + for (i = 0; i < REGION_NUM_RECTS(pRegion); i++) + XClearArea(xnestDisplay, xnestWindow(pWin), + pBox[i].x1 - pWin->drawable.x, + pBox[i].y1 - pWin->drawable.y, + pBox[i].x2 - pBox[i].x1, + pBox[i].y2 - pBox[i].y1, + False); +} + +void xnestPaintWindowBorder(pWin, pRegion, what) + WindowPtr pWin; + RegionPtr pRegion; + int what; +{ + xnestConfigureWindow(pWin, CWBorderWidth); +} + +void xnestCopyWindow(pWin, oldOrigin, oldRegion) + WindowPtr pWin; + xPoint oldOrigin; + RegionPtr oldRegion; +{ +} + +void xnestClipNotify(pWin, dx, dy) + WindowPtr pWin; + int dx, dy; +{ + xnestConfigureWindow(pWin, CWStackingOrder); +#ifdef SHAPE + xnestShapeWindow(pWin); +#endif /* SHAPE */ +} + +static Bool xnestWindowExposurePredicate(display, event, ptr) + 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; +{ + XEvent event; + Window window; + BoxRec Box; + + XSync(xnestDisplay, False); + + window = xnestWindow(pWin); + + while (XCheckIfEvent(xnestDisplay, &event, + xnestWindowExposurePredicate, (char *)&window)) { + + Box.x1 = pWin->drawable.x + wBorderWidth(pWin) + event.xexpose.x; + Box.y1 = pWin->drawable.y + wBorderWidth(pWin) + event.xexpose.y; + Box.x2 = Box.x1 + event.xexpose.width; + Box.y2 = Box.y1 + event.xexpose.height; + + event.xexpose.type = ProcessedExpose; + + if (RECT_IN_REGION(pWin->drawable.pScreen, pRgn, &Box) != rgnIN) + XPutBackEvent(xnestDisplay, &event); + } + + miWindowExposures(pWin, pRgn, other_exposed); +} + +#ifdef SHAPE +static Bool xnestRegionEqual(pReg1, pReg2) + RegionPtr pReg1, pReg2; +{ + BoxPtr pBox1, pBox2; + unsigned int n1, n2; + + if (pReg1 == pReg2) return True; + + if (pReg1 == NullRegion || pReg2 == NullRegion) return False; + + pBox1 = REGION_RECTS(pReg1); + n1 = REGION_NUM_RECTS(pReg1); + + pBox2 = REGION_RECTS(pReg2); + n2 = REGION_NUM_RECTS(pReg2); + + if (n1 != n2) return False; + + if (pBox1 == pBox2) return True; + + if (memcmp(pBox1, pBox2, n1 * sizeof(BoxRec))) return False; + + return True; +} + +void xnestShapeWindow(pWin) + WindowPtr pWin; +{ + Region reg; + BoxPtr pBox; + XRectangle rect; + int i; + Bool overlap; + + if (!xnestRegionEqual(xnestWindowPriv(pWin)->bounding_shape, + wBoundingShape(pWin))) { + + if (wBoundingShape(pWin)) { + REGION_COPY(pWin->drawable.pScreen, + xnestWindowPriv(pWin)->bounding_shape, wBoundingShape(pWin)); + + reg = XCreateRegion(); + pBox = REGION_RECTS(xnestWindowPriv(pWin)->bounding_shape); + for (i = 0; + i < REGION_NUM_RECTS(xnestWindowPriv(pWin)->bounding_shape); + i++) { + rect.x = pBox[i].x1; + rect.y = pBox[i].y1; + rect.width = pBox[i].x2 - pBox[i].x1; + rect.height = pBox[i].y2 - pBox[i].y1; + XUnionRectWithRegion(&rect, reg, reg); + } + XShapeCombineRegion(xnestDisplay, xnestWindow(pWin), + ShapeBounding, 0, 0, reg, ShapeSet); + XDestroyRegion(reg); + } + else { + REGION_EMPTY(pWin->drawable.pScreen, + xnestWindowPriv(pWin)->bounding_shape); + + XShapeCombineMask(xnestDisplay, xnestWindow(pWin), + ShapeBounding, 0, 0, None, ShapeSet); + } + } + + if (!xnestRegionEqual(xnestWindowPriv(pWin)->clip_shape, + wClipShape(pWin))) { + + if (wClipShape(pWin)) { + REGION_COPY(pWin->drawable.pScreen, + xnestWindowPriv(pWin)->clip_shape, wClipShape(pWin)); + + reg = XCreateRegion(); + pBox = REGION_RECTS(xnestWindowPriv(pWin)->clip_shape); + for (i = 0; + i < REGION_NUM_RECTS(xnestWindowPriv(pWin)->clip_shape); + i++) { + rect.x = pBox[i].x1; + rect.y = pBox[i].y1; + rect.width = pBox[i].x2 - pBox[i].x1; + rect.height = pBox[i].y2 - pBox[i].y1; + XUnionRectWithRegion(&rect, reg, reg); + } + XShapeCombineRegion(xnestDisplay, xnestWindow(pWin), + ShapeClip, 0, 0, reg, ShapeSet); + XDestroyRegion(reg); + } + else { + REGION_EMPTY(pWin->drawable.pScreen, + xnestWindowPriv(pWin)->clip_shape); + + XShapeCombineMask(xnestDisplay, xnestWindow(pWin), + ShapeClip, 0, 0, None, ShapeSet); + } + } +} +#endif /* SHAPE */ diff --git a/xc/programs/Xserver/hw/xnest/XNFont.h b/xc/programs/Xserver/hw/xnest/XNFont.h new file mode 100644 index 000000000..87cbebf05 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/XNFont.h @@ -0,0 +1,36 @@ +/* $XConsortium: Font.h,v 1.1 93/07/12 15:28:20 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + + +#ifndef XNESTFONT_H +#define XNESTFONT_H + +typedef struct { + XFontStruct *font_struct; +} xnestPrivFont; + +extern int xnestFontPrivateIndex; + +#define xnestFontPriv(pFont) \ + ((xnestPrivFont *)FontGetPrivate(pFont, xnestFontPrivateIndex)) + +#define xnestFontStruct(pFont) (xnestFontPriv(pFont)->font_struct) + +#define xnestFont(pFont) (xnestFontStruct(pFont)->fid) + +Bool xnestRealizeFont(); +Bool xnestUnrealizeFont(); + +#endif /* XNESTFONT_H */ diff --git a/xc/programs/Xserver/hw/xnest/XNGC.h b/xc/programs/Xserver/hw/xnest/XNGC.h new file mode 100644 index 000000000..51adb69d2 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/XNGC.h @@ -0,0 +1,43 @@ +/* $XConsortium: GC.h,v 1.1 93/07/12 15:28:24 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTGC_H +#define XNESTGC_H + +/* This file uses the GC definition form Xlib.h as XlibGC. */ + +typedef struct { + XlibGC gc; + int nClipRects; +} xnestPrivGC; + +extern int xnestGCPrivateIndex; + +#define xnestGCPriv(pGC) \ + ((xnestPrivGC *)((pGC)->devPrivates[xnestGCPrivateIndex].ptr)) + +#define xnestGC(pGC) (xnestGCPriv(pGC)->gc) + +Bool xnestCreateGC(); +void xnestValidateGC(); +void xnestChangeGC(); +void xnestCopyGC(); +void xnestDestroyGC(); +void xnestChangeClip(); +void xnestDestroyClip(); +void xnestDestroyClipHelper(); +void xnestCopyClip(); + +#endif /* XNESTGC_H */ diff --git a/xc/programs/Xserver/hw/xnest/XNWindow.h b/xc/programs/Xserver/hw/xnest/XNWindow.h new file mode 100644 index 000000000..9b96804a9 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/XNWindow.h @@ -0,0 +1,79 @@ +/* $XConsortium: Window.h,v 1.1 93/07/12 15:28:58 rws Exp $ */ +/* + +Copyright 1993 by Davor Matic + +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. Davor Matic makes no representations about +the suitability of this software for any purpose. It is provided "as +is" without express or implied warranty. + +*/ + +#ifndef XNESTWINDOW_H +#define XNESTWINDOW_H + +typedef struct { + Window window; + Window parent; + int x; + int y; + unsigned int width; + unsigned int height; + unsigned int border_width; + Window sibling_above; +#ifdef SHAPE + RegionPtr bounding_shape; + RegionPtr clip_shape; +#endif /* SHAPE */ +} xnestPrivWin; + +typedef struct { + WindowPtr pWin; + Window window; +} xnestWindowMatch; + +extern int xnestWindowPrivateIndex; + +#define xnestWindowPriv(pWin) \ + ((xnestPrivWin *)((pWin)->devPrivates[xnestWindowPrivateIndex].ptr)) + +#define xnestWindow(pWin) (xnestWindowPriv(pWin)->window) + +#define xnestWindowParent(pWin) \ + ((pWin)->parent ? \ + xnestWindow((pWin)->parent) : \ + xnestDefaultWindows[pWin->drawable.pScreen->myNum]) + +#define xnestWindowSiblingAbove(pWin) \ + ((pWin)->prevSib ? xnestWindow((pWin)->prevSib) : None) + +#define xnestWindowSiblingBelow(pWin) \ + ((pWin)->nextSib ? xnestWindow((pWin)->nextSib) : None) + +#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(); +#ifdef SHAPE +void xnestShapeWindow(); +#endif /* SHAPE */ + +#endif /* XNESTWINDOW_H */ diff --git a/xc/programs/Xserver/hw/xnest/Xnest.h b/xc/programs/Xserver/hw/xnest/Xnest.h new file mode 100644 index 000000000..c61a1154f --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Xnest.h @@ -0,0 +1,95 @@ +/* $XConsortium: Xnest.h,v 1.1 95/07/10 17:43:42 ray Exp $ */ +/* + +Copyright (c) 1995 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +*/ + +/* +** Machines with a 64 bit library interface and a 32 bit server require +** name changes to protect the guilty. +*/ +#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 /*_XSERVER64*/ + +#define GC XlibGC +#include "Xlib.h" +#include "Xutil.h" +#include <X11/extensions/shape.h> +#undef GC + +#ifdef _XSERVER64_tmp +#define _XSERVER64 +#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 /*_XSERVER64_tmp*/ + + + + + + diff --git a/xc/programs/Xserver/hw/xnest/Xnest.man b/xc/programs/Xserver/hw/xnest/Xnest.man new file mode 100644 index 000000000..e4009b662 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/Xnest.man @@ -0,0 +1,261 @@ +.\" $TOG: Xnest.man /main/7 1997/11/04 21:21:03 kaleb $ +.\" Copyright (c) 1993, 1994 X Consortium +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining +.\" a copy of this software and associated documentation files (the +.\" "Software"), to deal in the Software without restriction, including +.\" without limitation the rights to use, copy, modify, merge, publish, +.\" distribute, sublicense, and/or sell copies of the Software, and to +.\" permit persons to whom the Software is furnished to do so, subject to +.\" the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be included +.\" in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +.\" OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" Except as contained in this notice, the name of the X Consortium shall +.\" not be used in advertising or otherwise to promote the sale, use or +.\" other dealings in this Software without prior written authorization +.\" from the X Consortium. +.TH XNEST 1 "Release 6.4" "X Version 11" +.SH NAME +Xnest \- a nested X server +.SH SYNOPSIS +.B Xnest +[-options] +.SH DESCRIPTION +\fIXnest\fP is a client and a server. \fIXnest\fP is a client of the +real server which manages windows and graphics requests on its behalf. +\fIXnest\fP is a server to its own clients. \fIXnest\fP manages +windows and graphics requests on their behalf. To these clients +\fIXnest\fP appears to be a conventional server. +.SH OPTIONS +\fIXnest\fP supports all standard options of the sample server +implementation. For more details, please see the manual page on your +system for \fIXserver\fP. The following additional arguments are +supported as well. +.TP 4 +.B \-display \fIstring\fP +This option specifies the display name of the real server that +\fIXnest\fP should try to connect with. If it is not provided on the +command line \fIXnest\fP will read the \fIDISPLAY\fP environment +variable in order to find out the same information. +.TP 4 +.B \-sync +This option tells \fIXnest\fP to synchronize its window and graphics +operations with the real server. This is a useful option for +debugging, but it will slow down the performance considerably. It +should not be used unless absolutely necessary. +.TP 4 +.B \-full +This option tells \fIXnest\fP to utilize full regeneration of real +server objects and reopen a new connection to the real server each +time the nested server regenerates. The sample server implementation +regenerates all objects in the server when the last client of this +server terminates. When this happens, \fIXnest\fP by default +maintains the same top level window and the same real server +connection in each new generation. If the user selects full +regeneration, even the top level window and the connection to the real +server will be regenerated for each server generation. +.TP 4 +.B \-class \fIstring\fP +This option specifies the default visual class of the nested server. +It is similar to the \fI-cc\fP option from the set of standard options +except that it will accept a string rather than a number for the +visual class specification. The string must be one of the following +six values: \fIStaticGray\fP, \fIGrayScale\fP, \fIStaticColor\fP, +\fIPseudoColor\fP, \fITrueColor\fP, or \fIDirectColor\fP. If both, +\fI-class\fP and \fI-cc\fP options are specified, the last instance of +either option assumes precedence. The class of the default visual of +the nested server need not be the same as the class of the default +visual of the real server; although, it has to be supported by the +real server. See \fIxdpyinfo\fP for a list of supported visual +classes on the real server before starting \fIXnest\fP. If the user +chooses a static class, all the colors in the default colormap will be +preallocated. If the user chooses a dynamic class, colors in the +default colormap will be available to individual clients for +allocation. +.TP 4 +.B \-depth \fIint\fP +This option specifies the default visual depth of the nested server. +The depth of the default visual of the nested server need not be the +same as the depth of the default visual of the real server; although, +it has to be supported by the real server. See \fIxdpyinfo\fP for a +list of supported visual depths on the real server before starting +\fIXnest\fP. +.TP 4 +.B \-sss +This option tells \fIXnest\fP to use the software screen saver. By +default \fIXnest\fP will use the screen saver that corresponds to the +hardware screen saver in the real server. Of course, even this screen +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 +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 +will be the maximum width and height of each top level \fIXnest\fP +window. \fIXnest\fP will allow the user to make any top level window +smaller, but it will not actually change the size of the nested server +root window. As of yet, there is no mechanism within the sample +server implementation to change the size of the root window after +screen initialization. In order to do so, one would probably need to +extend the X protocol. Therefore, it is not likely that this will be +available any time soon. If this option is not specified \fIXnest\fP +will choose width and height to be 3/4 of the dimensions of the root +window of the real server. +.TP 4 +.B \-bw \fIint\fP +This option specifies the border width of the top level \fIXnest\fP +window. The integer parameter must be a positive number. The default +border width is 1. +.TP 4 +.B \-name \fIstring\fP +This option specifies the name of the top level \fIXnest\fP window. +The default value is the program name. +.TP 4 +.B \-scrns \fIint\fP +This option specifies the number of screens to create in the nested +server. For each screen, \fIXnest\fP will create a separate top level +window. Each screen is referenced by the number after the dot in the +client display name specification. For example, \fIxterm -display +:1.1\fP will open an \fIxterm\fP client in the nested server with the +display number \fI:1\fP on the second screen. The number of screens +is limited by the hard coded constant in the server sample code which +is usually 3. +.TP 4 +.B \-install +This option tells \fIXnest\fP to do its own colormap installation by +bypassing the real window manager. For it to work properly the user +will probably have to temporarily quit the real window manager. By +default \fIXnest\fP will keep the nested client window whose colormap +should be installed in the real server in the +\fIWM\_COLORMAP\_WINDOWS\fP property of the top level \fIXnest\fP +window. If this colormap is of the same visual type as the root +window of the nested server, \fIXnest\fP will associate this colormap +with the top level \fIXnest\fP window as well. Since this does not +have to be the case, window managers should look primarily at the +\fIWM\_COLORMAP\_WINDOWS\fP property rather than the colormap +associated with the top level \fIXnest\fP window. Unfortunately, +window managers are not very good at doing that yet so this option +might come in handy. +.TP 4 +.B \-parent \fIwindow_id\fP +This option tells \fIXnest\fP to use the \fIwindow_id\fP as the +root window instead of creating a window. This option is used +by the xrx xnestplugin. +.SH USAGE +Starting up \fIXnest\fP is as simple as starting up \fIxclock\fP from +a terminal emulator. If a user wishes to run \fIXnest\fP on the same +workstation as the real server, it is important that the nested server +is given its own listening socket address. Therefore, if there is a +server already running on the user's workstation, \fIXnest\fP will +have to be started up with a new display number. Since there is +usually no more than one server running on a workstation, specifying +\fIXnest :1\fP on the command line will be sufficient for most users. +For each server running on the workstation the display number needs to +be incremented by one. Thus, if you wish to start another +\fIXnest\fP, you will need to type \fIXnest :2\fP on the command line. +.PP +To run clients in the nested server each client needs to be given the +same display number as the nested server. For example, \fIxterm +-display :1\fP will start up an \fIxterm\fP in the first nested server +and \fIxterm -display :2\fP will start an \fIxterm\fP in the second +nested server from the example above. Additional clients can be +started from these \fIxterm\fPs in each nested server. +.SH XNEST AS A CLIENT +\fIXnest\fP behaves and looks to the real server and other real +clients as another real client. It is a rather demanding client, +however, since almost any window or graphics request from a nested +client will result in a window or graphics request from \fIXnest\fP to +the real server. Therefore, it is desirable that \fIXnest\fP and the +real server are on a local network, or even better, on the same +machine. As of now, \fIXnest\fP assumes that the real server supports +the shape extension. There is no way to turn off this assumption +dynamically. \fIXnest\fP can be compiled without the shape extension +built in, and in that case the real server need not support it. The +dynamic shape extension selection support should be considered in +further development of \fIXnest\fP. +.PP +Since \fIXnest\fP need not use the same default visual as the the real +server, the top level window of the \fIXnest\fP client always has its +own colormap. This implies that other windows' colors will not be +displayed properly while the keyboard or pointer focus is in the +\fIXnest\fP window, unless the real server has support for more than +one installed colormap at any time. The colormap associated with the +top window of the \fIXnest\fP client need not be the appropriate +colormap that the nested server wants installed in the real server. +In the case that a nested client attempts to install a colormap of a +different visual from the default visual of the nested server, +\fIXnest\fP will put the top window of this nested client and all +other top windows of the nested clients that use the same colormap +into the \fIWM\_COLORMAP\_WINDOWS\fP property of the top level +\fIXnest\fP window on the real server. Thus, it is important that the +real window manager that manages the \fIXnest\fP top level window +looks at the \fIWM\_COLORMAP\_WINDOWS\fP property rather than the +colormap associated with the top level \fIXnest\fP window. Since most +window managers appear to not implement this convention properly as of +yet, \fIXnest\fP can optionally do direct installation of colormaps +into the real server bypassing the real window manager. If the user +chooses this option, it is usually necessary to temporarily disable +the real window manager since it will interfere with the \fIXnest\fP +scheme of colormap installation. +.PP +Keyboard and pointer control procedures of the nested server change +the keyboard and pointer control parameters of the real server. +Therefore, after \fIXnest\fP is started up, it will change the +keyboard and pointer controls of the real server to its own internal +defaults. Perhaps there should be a command line option to tell +\fIXnest\fP to inherit the keyboard and pointer control parameters +from the real server rather than imposing its own. This is a future +consideration. +.SH XNEST AS A SERVER +\fIXnest\fP as a server looks exactly like a real server to its own +clients. For the clients there is no way of telling if they are +running on a real or a nested server. +.PP +As already mentioned, \fIXnest\fP is a very user friendly server when +it comes to customization. \fIXnest\fP will pick up a number of +command line arguments that can configure its default visual class and +depth, number of screens, etc. In the future, \fIXnest\fP should read +a customization input file to provide even greater freedom and +simplicity in selecting the desired layout. Unfortunately, there is +no support for backing store and save under as of yet, but this should +also be considered in the future development of \fIXnest\fP. +.PP +The only apparent intricacy from the users' perspective about using +\fIXnest\fP as a server is the selection of fonts. \fIXnest\fP +manages fonts by loading them locally and then passing the font name +to the real server and asking it to load that font remotely. This +approach avoids the overload of sending the glyph bits across the +network for every text operation, although it is really a bug. The +proper implementation of fonts should be moved into the \fIos\fP +layer. The consequence of this approach is that the user will have to +worry about two different font paths - a local one for the nested +server and a remote one for the real server - since \fIXnest\fP does +not propagate its font path to the real server. The reason for this +is because real and nested servers need not run on the same file +system which makes the two font paths mutually incompatible. Thus, if +there is a font in the local font path of the nested server, there is +no guarantee that this font exists in the remote font path of the real +server. \fIXlsfonts\fP client, if run on the nested server will list +fonts in the local font path and if run on the real server will list +fonts in the remote font path. Before a font can be successfully +opened by the nested server it has to exist in local and remote font +paths. It is the users' responsibility to make sure that this is the +case. +.SH BUGS +Won't run well on servers supporting different visual depths. +Still crashes randomly. Probably has some memory leaks. +.SH AUTHOR +Davor Matic, MIT X Consortium + diff --git a/xc/programs/Xserver/hw/xnest/icon b/xc/programs/Xserver/hw/xnest/icon new file mode 100644 index 000000000..725f1131a --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/icon @@ -0,0 +1,14 @@ +#define icon_width 32 +#define icon_height 32 +static unsigned char icon_bits[] = { + 0xff, 0x00, 0x00, 0xc0, 0xfe, 0x01, 0x00, 0xc0, 0xfc, 0x03, 0x00, 0x60, + 0xf8, 0x07, 0x00, 0x30, 0xf8, 0x07, 0x00, 0x18, 0xf0, 0x0f, 0x00, 0x0c, + 0xe0, 0x1f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x06, 0xc0, 0x3f, 0x00, 0x03, + 0x80, 0x7f, 0x80, 0x01, 0x00, 0xff, 0xc0, 0x00, 0x00, 0xfe, 0x61, 0x00, + 0x00, 0xfe, 0x31, 0x00, 0x00, 0xfc, 0x33, 0x00, 0x00, 0xf8, 0x1b, 0x00, + 0x00, 0xf0, 0x0d, 0x00, 0x00, 0xf0, 0x0e, 0x00, 0x00, 0x60, 0x1f, 0x00, + 0x00, 0xb0, 0x3f, 0x00, 0x00, 0x98, 0x7f, 0x00, 0x00, 0x98, 0x7f, 0x00, + 0x00, 0x0c, 0xff, 0x00, 0x00, 0x06, 0xfe, 0x01, 0x00, 0x03, 0xfc, 0x03, + 0x80, 0x01, 0xfc, 0x03, 0xc0, 0x00, 0xf8, 0x07, 0xc0, 0x00, 0xf0, 0x0f, + 0x60, 0x00, 0xe0, 0x1f, 0x30, 0x00, 0xe0, 0x1f, 0x18, 0x00, 0xc0, 0x3f, + 0x0c, 0x00, 0x80, 0x7f, 0x06, 0x00, 0x00, 0xff}; diff --git a/xc/programs/Xserver/hw/xnest/os2Stub.c b/xc/programs/Xserver/hw/xnest/os2Stub.c new file mode 100644 index 000000000..a31172436 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/os2Stub.c @@ -0,0 +1,386 @@ +/* + * (c) Copyright 1996 by Sebastien Marineau + * <marineau@genie.uottawa.ca> + * + * 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 + * HOLGER VEIT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Sebastien Marineau shall not be + * used in advertising or otherwise to promote the sale, use or other dealings + * in this Software without prior written authorization from Sebastien Marineau. + * + */ + +/* $XFree86: xc/programs/Xserver/hw/xnest/os2Stub.c,v 3.0 1996/05/13 06:44:20 dawes Exp $ */ + +/* This below implements select() for calls in xnest. It has been */ +/* somewhat optimized for improved performance, but assumes a few */ +/* things so it cannot be used as a general select. */ + +#include <stdio.h> +#include <sys/select.h> +#include <sys/errno.h> +#include <sys/time.h> +#define INCL_DOSSEMAPHORES +#define INCL_DOSNPIPES +#define INCL_DOSMISC +#define INCL_DOSMODULEMGR +#undef BOOL +#undef BYTE +#include <os2.h> +#include "Xpoll.h" + +HEV hPipeSem; +HMODULE hmod_so32dll; +static int (*os2_tcp_select)(int*,int,int,int,long); +ULONG os2_get_sys_millis(); +extern int _files[]; + +#define MAX_TCP 256 +/* These lifted from sys/emx.h. Change if that changes there! */ +#define F_SOCKET 0x10000000 +#define F_PIPE 0x20000000 + +struct select_data +{ + fd_set read_copy; + fd_set write_copy; + BOOL have_read; + BOOL have_write; + int tcp_select_mask[MAX_TCP]; + int tcp_emx_handles[MAX_TCP]; + int tcp_select_copy[MAX_TCP]; + int socket_nread; + int socket_nwrite; + int socket_ntotal; + int pipe_ntotal; + int pipe_have_write; + int max_fds; +}; + +int os2PseudoSelect(int nfds, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, struct timeval *timeout) +{ +static BOOL FirstTime=TRUE; +static haveTCPIP=TRUE; +ULONG timeout_ms; +ULONG postCount, start_millis,now_millis; +char faildata[16]; +struct select_data sd; +BOOL any_ready; +int np,ns, i,ready_handles,n; +APIRET rc; + +sd.have_read=FALSE; sd.have_write=FALSE; +sd.socket_nread=0; sd.socket_nwrite=0; sd.socket_ntotal=0; +sd.max_fds=31; ready_handles=0; any_ready=FALSE; +sd.pipe_ntotal=0; sd.pipe_have_write=FALSE; + +if(FirstTime){ + /* First load the so32dll.dll module and get a pointer to the SELECT function */ + + if((rc=DosLoadModule(faildata,sizeof(faildata),"SO32DLL",&hmod_so32dll))!=0){ + fprintf(stderr, "Could not load module so32dll.dll, rc = %d. Error note %s\n",rc,faildata); + haveTCPIP=FALSE; + } + if((rc = DosQueryProcAddr(hmod_so32dll, 0, "SELECT", (PPFN)&os2_tcp_select))!=0){ + fprintf(stderr, "Could not query address of SELECT, rc = %d.\n",rc); + haveTCPIP=FALSE; + } + /* Call these a first time to set the semaphore */ + /* rc = DosCreateEventSem(NULL, &hPipeSem, DC_SEM_SHARED, FALSE); + if(rc) { + fprintf(stderr, "Could not create event semaphore, rc=%d\n",rc); + return(-1); + } + rc = DosResetEventSem(hPipeSem, &postCount); */ /* Done in xtrans code for servers*/ + +fprintf(stderr, "Client select() done first-time stuff, sem handle %d.\n",hPipeSem); + + FirstTime = FALSE; +} + +/* Set up the time delay structs */ + + if(timeout!=NULL) { + timeout_ms=timeout->tv_sec*1000+timeout->tv_usec/1000; + } + else { timeout_ms=1000000; } /* This should be large enough... */ + if(timeout_ms>0) start_millis=os2_get_sys_millis(); + +/* Copy the masks */ + {FD_ZERO(&sd.read_copy);} + {FD_ZERO(&sd.write_copy);} + if(readfds!=NULL){ XFD_COPYSET(readfds,&sd.read_copy); sd.have_read=TRUE;} + if(writefds!=NULL) {XFD_COPYSET(writefds,&sd.write_copy);sd.have_write=TRUE;} + +/* And zero the original masks */ + if(sd.have_read){ FD_ZERO(readfds);} + if(sd.have_write) {FD_ZERO(writefds);} + if(exceptfds != NULL) {FD_ZERO(exceptfds);} + +/* Now we parse the fd_sets passed to select and separate pipe/sockets */ + n = os2_parse_select(&sd,nfds); + if(n == -1) { + errno = EBADF; + return (-1); + } + +/* Now we have three cases: either we have sockets, pipes, or both */ +/* We handle all three cases differently to optimize things */ + +/* Case 1: only pipes! */ + if((sd.pipe_ntotal >0) && (!sd.socket_ntotal)){ + np = os2_check_pipes(&sd,readfds,writefds); + if(np > 0){ + return (np); + } + else if (np == -1) { return(-1); } + while(!any_ready){ + rc = DosWaitEventSem(hPipeSem, timeout_ms); + /* if(rc) fprintf(stderr,"Sem-wait timeout, rc = %d\n",rc); */ + if(rc == 640) { + return(0); + } + if((rc != 0) && (rc != 95)) {errno= EBADF; return(-1);} + np = os2_check_pipes(&sd,readfds,writefds); + if (np > 0){ + return(np); + } + else if (np < 0){ return(-1); } + } + } + +/* Case 2: only sockets. Just let the os/2 tcp select do the work */ + if((sd.socket_ntotal > 0) && (!sd.pipe_ntotal)){ + ns = os2_check_sockets(&sd, readfds, writefds, timeout_ms); + return (ns); + } + +/* Case 3: combination of both */ + if((sd.socket_ntotal > 0) && (sd.pipe_ntotal)){ + np = os2_check_pipes(&sd,readfds,writefds); + if(np > 0){ + any_ready=TRUE; + ready_handles += np; + } + else if (np == -1) { return(-1); } + + ns = os2_check_sockets(&sd,readfds,writefds, 0); + if(ns>0){ + ready_handles+=ns; + any_ready = TRUE; + } + else if (ns == -1) {return(-1);} + + while (!any_ready && timeout_ms){ + + rc = DosWaitEventSem(hPipeSem, 10L); + if(rc == 0){ + np = os2_check_pipes(&sd,readfds,writefds); + if(np > 0){ + ready_handles+=np; + any_ready = TRUE; + } + else if (np == -1) { + return(-1); } + } + + ns = os2_check_sockets(&sd,readfds,writefds,exceptfds, 0); + if(ns>0){ + ready_handles+=ns; + any_ready = TRUE; + } + else if (ns == -1) {return(-1);} + + if (i%8 == 0) { + now_millis = os2_get_sys_millis(); + if((now_millis-start_millis) > timeout_ms) timeout_ms = 0; + } + i++; + } + } + +return(ready_handles); +} + + +ULONG os2_get_sys_millis() +{ + APIRET rc; + ULONG milli; + + rc = DosQuerySysInfo(14, 14, &milli, sizeof(milli)); + if(rc) { + fprintf(stderr,"Bad return code querying the millisecond counter! rc=%d\n",rc); + return(0); + } + return(milli); +} + +int os2_parse_select(sd,nfds) +struct select_data *sd; +int nfds; +{ + int i; + APIRET rc; +/* First we determine up to which descriptor we need to check. */ +/* No need to check up to 256 if we don't have to (and usually we dont...)*/ +/* Note: stuff here is hardcoded for fd_sets which are int[8] as in EMX! */ + + if(nfds > sd->max_fds){ + for(i=0;i<((FD_SETSIZE+31)/32);i++){ + if(sd->read_copy.fds_bits[i] || + sd->write_copy.fds_bits[i]) + sd->max_fds=(i*32) +32; + } + } + else { sd->max_fds = nfds; } +/* Check if result is greater than specified in select() call */ + if(sd->max_fds > nfds) sd->max_fds = nfds; + + if (sd->have_read) + { + for (i = 0; i < sd->max_fds; ++i) { + if (FD_ISSET (i, &sd->read_copy)){ + if(_files[i] & F_SOCKET) + { + sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i); + sd->tcp_emx_handles[sd->socket_ntotal]=i; + sd->socket_ntotal++; sd->socket_nread++; + } + else if (_files[i] & F_PIPE) + { + sd -> pipe_ntotal++; + /* rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i); + if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;} */ + } + } + } + } + + if (sd->have_write) + { + for (i = 0; i < sd->max_fds; ++i) { + if (FD_ISSET (i, &sd->write_copy)){ + if(_files[i] & F_SOCKET) + { + sd->tcp_select_mask[sd->socket_ntotal]=_getsockhandle(i); + sd->tcp_emx_handles[sd->socket_ntotal]=i; + sd->socket_ntotal++; sd->socket_nwrite++; + } + else if (_files[i] & F_PIPE) + { + sd -> pipe_ntotal++; + /* rc = DosSetNPipeSem((HPIPE)i, (HSEM) hPipeSem, i); + if(rc) { fprintf(stderr,"Error SETNPIPE rc = %d\n",rc); return -1;} */ + sd -> pipe_have_write=TRUE; + } + } + } + } + + +return(sd->socket_ntotal); +} + + +int os2_check_sockets(sd,readfds,writefds) +struct select_data *sd; +fd_set *readfds,*writefds; +{ + int e,i; + int j,n; + memcpy(sd->tcp_select_copy,sd->tcp_select_mask, + sd->socket_ntotal*sizeof(int)); + + e = os2_tcp_select(sd->tcp_select_copy,sd->socket_nread, + sd->socket_nwrite, 0, 0); + + if(e == 0) return(e); +/* We have something ready? */ + if(e>0){ + j = 0; n = 0; + for (i = 0; i < sd->socket_nread; ++i, ++j) + if (sd->tcp_select_copy[j] != -1) + { + FD_SET (sd->tcp_emx_handles[j], readfds); + n ++; + } + for (i = 0; i < sd->socket_nwrite; ++i, ++j) + if (sd->tcp_select_copy[j] != -1) + { + FD_SET (sd->tcp_emx_handles[j], writefds); + n ++; + } + errno = 0; + + return n; + } + if(e<0){ + /*Error -- TODO. EBADF is a good choice for now. */ + fprintf(stderr,"Error in server select! e=%d\n",e); + errno = EBADF; + return (-1); + } + } + +/* Check to see if anything is ready on pipes */ + +int os2_check_pipes(sd,readfds,writefds) +struct select_data *sd; +fd_set *readfds,*writefds; +{ +int i,e; +ULONG ulPostCount; +PIPESEMSTATE pipeSemState[128]; +APIRET rc; + e = 0; + rc = DosResetEventSem(hPipeSem,&ulPostCount); + rc = DosQueryNPipeSemState((HSEM) hPipeSem, (PPIPESEMSTATE)&pipeSemState, + sizeof(pipeSemState)); + if(rc) fprintf(stderr,"SELECT: rc from QueryNPipeSem: %d\n",rc); + i=0; + while (pipeSemState[i].fStatus != 0) { + /*fprintf(stderr,"SELECT: sem entry, stat=%d, flag=%d, key=%d,avail=%d\n", + pipeSemState[i].fStatus,pipeSemState[i].fFlag,pipeSemState[i].usKey, + pipeSemState[i].usAvail); */ + if((pipeSemState[i].fStatus == 1) && + (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy))){ + FD_SET(pipeSemState[i].usKey,readfds); + e++; + } + else if((pipeSemState[i].fStatus == 2) && + (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy))){ + FD_SET(pipeSemState[i].usKey,writefds); + e++; + } + else if( (pipeSemState[i].fStatus == 3) && + ( (FD_ISSET(pipeSemState[i].usKey,&sd->read_copy)) || + (FD_ISSET(pipeSemState[i].usKey,&sd->write_copy)) )){ + errno = EBADF; + /* fprintf(stderr,"Pipe has closed down, fd=%d\n",pipeSemState[i].usKey); */ + return (-1); + } + i++; + } /* endwhile */ + /*fprintf(stderr,"Done listing pipe sem entries, total %d entries, total ready entries %d\n",i,e);*/ +errno = 0; +return(e); +} + diff --git a/xc/programs/Xserver/hw/xnest/screensaver b/xc/programs/Xserver/hw/xnest/screensaver new file mode 100644 index 000000000..4940f2650 --- /dev/null +++ b/xc/programs/Xserver/hw/xnest/screensaver @@ -0,0 +1,686 @@ +#define screensaver_width 256 +#define screensaver_height 256 +static unsigned char screensaver_bits[] = { + 0xa8, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x00, 0x80, 0x0a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x40, 0x55, + 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x50, + 0x55, 0x05, 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x80, 0xaa, 0x2a, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x00, 0xa0, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x15, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, + 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0xaa, + 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x00, 0x00, 0x00, 0xa0, + 0xaa, 0x0a, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x00, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xaa, 0x2a, 0x80, 0x02, 0x80, 0xaa, 0xaa, 0x82, 0x0a, 0xa8, 0x28, 0x80, + 0x8a, 0x80, 0x2a, 0x80, 0x80, 0x8a, 0xa2, 0x82, 0x0a, 0xaa, 0x0a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x2a, 0x02, 0x80, 0x82, 0x41, 0x40, 0x00, 0x50, + 0x55, 0x41, 0x00, 0x00, 0x04, 0x00, 0x54, 0x40, 0x10, 0x00, 0x40, 0x00, + 0x51, 0x55, 0x00, 0x15, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x41, 0x00, 0x10, 0x14, 0x00, 0x00, 0x00, 0xa8, 0x8a, 0x02, 0x00, 0x02, + 0x00, 0x20, 0xa2, 0x00, 0x80, 0x00, 0x08, 0x00, 0xaa, 0x2a, 0x00, 0x2a, + 0x08, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x80, + 0x01, 0x00, 0x01, 0x50, 0x45, 0x05, 0x00, 0x01, 0x10, 0x10, 0x40, 0x11, + 0x40, 0x00, 0x44, 0x00, 0x50, 0x15, 0x01, 0x15, 0x04, 0x00, 0x40, 0x00, + 0x05, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x50, 0x20, 0x00, 0x00, 0xa2, + 0xaa, 0x2a, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x08, 0x00, 0x00, 0x00, 0x00, + 0xa2, 0xaa, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x01, 0x40, 0x44, 0x15, 0x10, 0x01, + 0x10, 0x10, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x54, 0x55, 0x41, 0x45, + 0x04, 0x00, 0x40, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x54, + 0x20, 0x80, 0x00, 0x82, 0xaa, 0x0a, 0x00, 0x00, 0x22, 0x00, 0x80, 0x0a, + 0x00, 0x00, 0x82, 0x00, 0xa0, 0x8a, 0x22, 0x02, 0x00, 0x08, 0x20, 0x00, + 0xa8, 0x00, 0x00, 0x20, 0x00, 0x80, 0x00, 0x2a, 0x10, 0x40, 0x00, 0x01, + 0x54, 0x45, 0x10, 0x00, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x00, + 0x50, 0x45, 0x05, 0x41, 0x00, 0x04, 0x10, 0x00, 0x50, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x15, 0x00, 0x28, 0x00, 0xaa, 0xaa, 0x0a, 0x0a, 0x00, + 0x20, 0x08, 0x00, 0x20, 0x00, 0x00, 0x80, 0x00, 0xa8, 0xa2, 0x22, 0x2a, + 0x00, 0x00, 0x0a, 0x00, 0xa8, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x0a, + 0x50, 0x05, 0x00, 0x01, 0x55, 0x45, 0x00, 0x00, 0x01, 0x00, 0x00, 0x40, + 0x01, 0x00, 0x00, 0x00, 0x40, 0x55, 0x11, 0x00, 0x00, 0x54, 0x01, 0x00, + 0x44, 0x01, 0x00, 0x00, 0x05, 0x40, 0x00, 0x05, 0x00, 0x08, 0x00, 0x80, + 0xaa, 0xaa, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0a, 0x00, 0x80, 0x00, + 0x80, 0xaa, 0x28, 0x20, 0x00, 0x00, 0x02, 0x00, 0x80, 0x02, 0x00, 0x00, + 0x28, 0x00, 0x80, 0x02, 0x10, 0x10, 0x00, 0x01, 0x54, 0x45, 0x01, 0x00, + 0x41, 0x00, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x10, 0x55, 0x14, 0x00, + 0x00, 0x04, 0x04, 0x00, 0x40, 0x01, 0x00, 0x00, 0x40, 0x40, 0x40, 0x01, + 0x08, 0x00, 0x80, 0x00, 0xa8, 0xa2, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x20, 0xa0, 0xaa, 0x00, 0x80, 0x28, 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x80, 0x02, 0x00, 0x00, 0x80, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x14, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x40, 0x00, 0x00, 0x08, 0x20, 0x80, 0x00, 0x08, 0x08, 0x80, 0x80, + 0x80, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x8a, 0x00, + 0x02, 0x02, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, + 0x10, 0x10, 0x00, 0x01, 0x10, 0x45, 0x55, 0x01, 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, + 0x20, 0xa2, 0xaa, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x80, 0x00, 0x02, 0x04, 0x00, 0x40, 0x00, 0x04, 0x04, 0x40, 0x40, + 0x00, 0x01, 0x00, 0x04, 0x04, 0x00, 0x00, 0x01, 0x00, 0x51, 0x45, 0x05, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x45, 0x01, + 0x2a, 0x80, 0xaa, 0xaa, 0x82, 0xaa, 0x2a, 0xa0, 0x02, 0x02, 0x80, 0xa8, + 0x00, 0x2a, 0xa0, 0x02, 0x80, 0xa2, 0x00, 0xa0, 0xa0, 0x0a, 0xa0, 0x00, + 0x00, 0x00, 0x80, 0x88, 0x02, 0x00, 0x08, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x50, 0x41, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xa0, 0xaa, 0x0a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x20, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x54, 0x40, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x54, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2a, 0x80, 0xaa, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, + 0x02, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x55, 0x55, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x05, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x15, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xa8, 0xaa, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x0a, 0x80, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x50, 0x55, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x15, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, + 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0x2a, 0x20, 0x00, 0x00, 0x41, 0x05, 0x55, 0x54, 0x11, 0x04, 0x00, 0x14, + 0x40, 0x10, 0x44, 0x15, 0x15, 0x00, 0x00, 0x50, 0x01, 0x00, 0x50, 0x55, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x10, 0x50, 0x40, + 0x82, 0x08, 0x02, 0x08, 0x20, 0x08, 0x00, 0x22, 0xa0, 0x20, 0x88, 0x00, + 0x22, 0x00, 0x00, 0xa8, 0x2a, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x80, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xaa, 0x08, 0x88, 0x20, 0x44, 0x10, 0x01, 0x04, + 0x50, 0x04, 0x00, 0x41, 0x10, 0x11, 0x44, 0x00, 0x41, 0x00, 0x00, 0x54, + 0x41, 0x00, 0x40, 0x55, 0x15, 0x00, 0x40, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x54, 0x11, 0x04, 0x11, 0x80, 0x20, 0x02, 0x08, 0xa0, 0x08, 0x00, 0x02, + 0x88, 0x20, 0x88, 0x00, 0x82, 0x00, 0x00, 0x2a, 0x22, 0x00, 0x80, 0xaa, + 0x2a, 0x00, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x08, 0x20, + 0x40, 0x10, 0x01, 0x04, 0x50, 0x04, 0x00, 0x01, 0x04, 0x41, 0x44, 0x00, + 0x41, 0x00, 0x00, 0x15, 0x05, 0x14, 0x15, 0x50, 0x10, 0x05, 0x40, 0x41, + 0x41, 0x10, 0x45, 0x05, 0x50, 0x04, 0x04, 0x10, 0x80, 0x20, 0x02, 0x08, + 0xa0, 0x08, 0x00, 0x02, 0x08, 0x22, 0x82, 0x00, 0x82, 0x00, 0x00, 0x0a, + 0x2a, 0x22, 0x8a, 0x22, 0x22, 0x08, 0x80, 0x22, 0x22, 0x88, 0x88, 0x02, + 0x28, 0x02, 0x08, 0x20, 0x40, 0x10, 0x15, 0x54, 0x10, 0x05, 0x00, 0x14, + 0x04, 0x41, 0x44, 0x05, 0x41, 0x00, 0x00, 0x05, 0x50, 0x01, 0x41, 0x04, + 0x05, 0x11, 0x00, 0x05, 0x44, 0x44, 0x50, 0x00, 0x10, 0x05, 0x50, 0x10, + 0x80, 0x0a, 0x02, 0x08, 0x20, 0x0a, 0x00, 0x20, 0xa8, 0x82, 0x82, 0x00, + 0x2a, 0x00, 0x80, 0x02, 0x22, 0x02, 0x82, 0x20, 0x20, 0x08, 0x20, 0x88, + 0x82, 0x88, 0x8a, 0x00, 0x88, 0x0a, 0x80, 0x20, 0x40, 0x04, 0x01, 0x04, + 0x10, 0x05, 0x00, 0x40, 0x04, 0x41, 0x41, 0x00, 0x11, 0x00, 0x40, 0x01, + 0x41, 0x41, 0x41, 0x14, 0x15, 0x11, 0x40, 0x44, 0x04, 0x44, 0x40, 0x00, + 0x44, 0x15, 0x00, 0x11, 0x80, 0x08, 0x02, 0x08, 0x20, 0x0a, 0x00, 0x80, + 0x08, 0x82, 0x82, 0x00, 0x22, 0x00, 0xa0, 0x00, 0x22, 0x22, 0x82, 0x20, + 0x22, 0x0a, 0x20, 0x28, 0x82, 0x82, 0x88, 0x00, 0x88, 0x2a, 0x00, 0x22, + 0x44, 0x10, 0x01, 0x04, 0x10, 0x04, 0x00, 0x41, 0x04, 0x01, 0x41, 0x00, + 0x41, 0x00, 0x50, 0x01, 0x14, 0x14, 0x01, 0x55, 0x10, 0x15, 0x40, 0x45, + 0x05, 0x01, 0x45, 0x00, 0x04, 0x55, 0x04, 0x11, 0x82, 0x20, 0x02, 0x08, + 0x20, 0x08, 0x00, 0x22, 0x08, 0x82, 0x80, 0x00, 0x82, 0x00, 0xa8, 0x00, + 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0xaa, 0x88, 0x20, 0x41, 0x10, 0x55, 0x54, 0x11, 0x04, 0x00, 0x14, + 0x04, 0x01, 0x41, 0x15, 0x41, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x54, 0x51, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x15, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x54, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, + 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xa8, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x00, 0x50, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, + 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, + 0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x40, 0x15, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x00, 0x00, 0x00, 0x00, + 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x00, 0x80, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x14, 0x40, 0x01, 0x41, 0x40, 0x01, 0x14, 0x10, 0x01, 0x00, 0x40, + 0x01, 0x04, 0x14, 0x14, 0x14, 0x10, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0xaa, 0x00, 0x00, 0x00, 0x80, 0x82, 0xa0, 0x20, 0x82, + 0xa2, 0x20, 0x02, 0x22, 0x28, 0x02, 0x00, 0x08, 0x8a, 0x22, 0x08, 0x08, + 0x22, 0x28, 0x0a, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x44, 0x54, + 0x01, 0x00, 0x00, 0x40, 0x41, 0x40, 0x10, 0x04, 0x11, 0x11, 0x04, 0x41, + 0x10, 0x04, 0x00, 0x04, 0x04, 0x40, 0x10, 0x00, 0x41, 0x10, 0x11, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xaa, 0x02, 0x00, 0x00, 0xa0, + 0x82, 0x80, 0x08, 0x08, 0x02, 0x08, 0x88, 0x80, 0x08, 0x08, 0x00, 0x08, + 0x08, 0x20, 0x20, 0x80, 0x80, 0x20, 0x00, 0x00, 0x10, 0x50, 0x14, 0x14, + 0x45, 0x05, 0x40, 0x05, 0x41, 0x14, 0x15, 0x50, 0x41, 0x01, 0x04, 0x00, + 0x01, 0x04, 0x50, 0x00, 0x11, 0x04, 0x00, 0x14, 0x00, 0x40, 0x10, 0x44, + 0x00, 0x11, 0x00, 0x00, 0xa0, 0x88, 0x22, 0xa2, 0x88, 0x08, 0x00, 0x2a, + 0x82, 0x22, 0x22, 0xa8, 0x80, 0x0a, 0x08, 0x00, 0x02, 0xa8, 0x8a, 0xaa, + 0x08, 0x08, 0x00, 0xa8, 0x00, 0x2a, 0x20, 0x80, 0xaa, 0x20, 0x00, 0x00, + 0x00, 0x05, 0x04, 0x15, 0x55, 0x04, 0x40, 0x04, 0x50, 0x54, 0x01, 0x54, + 0x00, 0x54, 0x04, 0x00, 0x01, 0x04, 0x40, 0x00, 0x10, 0x04, 0x00, 0x40, + 0x05, 0x41, 0x40, 0x40, 0x00, 0x10, 0x00, 0x00, 0x80, 0x08, 0x02, 0x82, + 0x80, 0x08, 0x80, 0x20, 0x02, 0x02, 0x02, 0x2a, 0x00, 0xa0, 0x08, 0x00, + 0x02, 0x08, 0x80, 0x00, 0x08, 0x08, 0x00, 0x00, 0x8a, 0x20, 0x20, 0x82, + 0x00, 0x20, 0x00, 0x00, 0x10, 0x45, 0x04, 0x11, 0x51, 0x04, 0x50, 0x44, + 0x44, 0x44, 0x01, 0x15, 0x00, 0x40, 0x05, 0x00, 0x01, 0x04, 0x40, 0x00, + 0x10, 0x04, 0x00, 0x00, 0x54, 0x40, 0x40, 0x41, 0x00, 0x10, 0x00, 0x00, + 0xa0, 0x28, 0x02, 0x0a, 0x8a, 0x08, 0x20, 0x0a, 0x0a, 0x28, 0x02, 0x0a, + 0x00, 0x80, 0x08, 0x00, 0x02, 0x08, 0x80, 0x00, 0x08, 0x08, 0x00, 0x00, + 0x88, 0x20, 0x80, 0x80, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x05, 0x40, 0x00, 0x11, 0x00, + 0x01, 0x10, 0x10, 0x01, 0x11, 0x04, 0x00, 0x04, 0x50, 0x40, 0x41, 0x01, + 0x01, 0x11, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, + 0xaa, 0x00, 0x80, 0x02, 0x80, 0x80, 0x20, 0x02, 0x02, 0x20, 0x08, 0x82, + 0x08, 0x08, 0x00, 0x08, 0x88, 0x20, 0x80, 0x00, 0x82, 0x20, 0x00, 0x00, + 0x00, 0x40, 0x01, 0x10, 0x00, 0x00, 0x00, 0x54, 0x55, 0x01, 0x40, 0x01, + 0x40, 0x14, 0x40, 0x41, 0x05, 0x40, 0x01, 0x14, 0x14, 0x14, 0x00, 0x44, + 0x01, 0x45, 0x00, 0x00, 0x14, 0x54, 0x00, 0x00, 0x00, 0x80, 0x02, 0x08, + 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x04, 0x00, 0x00, 0x00, 0x50, + 0x55, 0x05, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0xa8, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x01, + 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0xa0, + 0xaa, 0x0a, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x15, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x55, 0x15, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x8a, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x54, 0x45, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, 0x00, 0x00, + 0xa8, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x05, 0x50, 0x00, 0x50, 0x40, 0x45, 0x11, 0x00, 0x50, + 0x40, 0x41, 0x01, 0x00, 0x14, 0x00, 0x51, 0x40, 0x40, 0x00, 0x05, 0x14, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0a, + 0x88, 0x02, 0xaa, 0xa8, 0x80, 0x00, 0x00, 0xaa, 0xa8, 0xa2, 0x02, 0x00, + 0xa2, 0xa0, 0x22, 0xa8, 0xa0, 0xa0, 0x8a, 0x2a, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x14, 0x04, 0x01, 0x45, 0x51, + 0x04, 0x40, 0x00, 0x45, 0x41, 0x51, 0x01, 0x00, 0x41, 0x50, 0x54, 0x50, + 0x50, 0x50, 0x14, 0x14, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x82, 0xa2, 0xa0, 0x02, 0xa0, 0x88, 0x82, + 0xa0, 0x88, 0x02, 0x80, 0x82, 0x28, 0x28, 0xa0, 0x20, 0x28, 0x08, 0x8a, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x45, 0x54, 0x00, + 0x14, 0x40, 0x41, 0x50, 0x05, 0x51, 0x10, 0x41, 0x41, 0x41, 0x01, 0x00, + 0x05, 0x14, 0x10, 0x50, 0x40, 0x10, 0x14, 0x54, 0x04, 0x00, 0x41, 0x55, + 0x04, 0x45, 0x01, 0x04, 0x20, 0x02, 0x08, 0x00, 0x2a, 0xa0, 0x00, 0xa0, + 0x8a, 0x20, 0xa8, 0xa2, 0xa0, 0xa0, 0x00, 0x80, 0x0a, 0x28, 0x28, 0xa0, + 0x20, 0x28, 0x0a, 0x2a, 0x00, 0x00, 0x22, 0x0a, 0x80, 0x88, 0x02, 0x88, + 0x04, 0x50, 0x01, 0x00, 0x54, 0x40, 0x01, 0x50, 0x15, 0x10, 0x14, 0x51, + 0x40, 0x41, 0x01, 0x00, 0x15, 0x14, 0x14, 0x40, 0x11, 0x14, 0x05, 0x14, + 0x00, 0x40, 0x10, 0x00, 0x15, 0x45, 0x04, 0x01, 0x00, 0x00, 0x08, 0x00, + 0xa8, 0xa0, 0x00, 0x28, 0x8a, 0x08, 0x0a, 0x28, 0xa0, 0xa0, 0x00, 0x00, + 0x2a, 0x0a, 0x28, 0xa0, 0x08, 0x8a, 0x02, 0x0a, 0x00, 0x80, 0x00, 0x08, + 0x80, 0x00, 0x00, 0x82, 0x44, 0x11, 0x00, 0x00, 0x50, 0x50, 0x00, 0x10, + 0x05, 0x40, 0x15, 0x05, 0x50, 0x50, 0x00, 0x00, 0x14, 0x14, 0x14, 0x40, + 0x11, 0x54, 0x00, 0x05, 0x00, 0x00, 0x11, 0x00, 0x01, 0x40, 0x04, 0x44, + 0x80, 0x20, 0x0a, 0x00, 0xa0, 0xa0, 0x00, 0x88, 0x82, 0xa8, 0x0a, 0x00, + 0xa0, 0xa0, 0x00, 0x00, 0x28, 0x0a, 0x0a, 0xa0, 0x08, 0x0a, 0x00, 0x0a, + 0x00, 0x00, 0x22, 0x0a, 0xa2, 0x00, 0x00, 0x88, 0x01, 0x40, 0x15, 0x00, + 0x50, 0x51, 0x40, 0x00, 0x01, 0x51, 0x15, 0x00, 0x50, 0x50, 0x00, 0x00, + 0x54, 0x14, 0x54, 0x40, 0x05, 0x14, 0x00, 0x05, 0x00, 0x40, 0x41, 0x15, + 0x14, 0x45, 0x04, 0x05, 0x00, 0x00, 0x00, 0x80, 0xa0, 0xa0, 0x20, 0x88, + 0x80, 0xaa, 0x08, 0x82, 0x28, 0x28, 0x02, 0x20, 0x28, 0x0a, 0x2a, 0xa0, + 0x02, 0x0a, 0x88, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x41, 0x40, 0x11, 0x44, 0x00, 0x55, 0x14, 0x44, + 0x50, 0x50, 0x01, 0x40, 0x10, 0x54, 0x15, 0x40, 0x01, 0x14, 0x04, 0x45, + 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0x22, 0xa0, 0x0a, 0x00, 0x00, 0x0a, 0x2a, 0x20, 0x28, 0xa8, 0x00, 0xa0, + 0x08, 0xa8, 0x08, 0xa0, 0x00, 0xa8, 0x82, 0x82, 0x02, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x05, 0x00, + 0x00, 0x54, 0x55, 0x10, 0x50, 0x50, 0x00, 0x00, 0x05, 0x50, 0x04, 0x40, + 0x00, 0x50, 0x40, 0x05, 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x80, 0xaa, 0x2a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x05, 0x00, 0x40, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0a, + 0x00, 0x80, 0xaa, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x00, 0x00, 0x55, 0x55, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x01, + 0x00, 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0xa8, 0xaa, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x82, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x50, 0x55, + 0x05, 0x00, 0x00, 0x14, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x28, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x0a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, + 0x00, 0x00, 0x40, 0x55, 0x15, 0x00, 0x00, 0x50, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0a, 0x00, 0x00, 0x00, 0x80, 0xaa, + 0x2a, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x55, 0x50, 0x15, + 0x55, 0x11, 0x55, 0x00, 0x15, 0x00, 0x54, 0x01, 0x00, 0x54, 0x01, 0x40, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x00, 0x20, 0x82, 0x20, 0x08, 0x82, 0x00, 0x22, 0x80, + 0x08, 0x08, 0x28, 0xa2, 0x28, 0x20, 0x08, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xa2, + 0x00, 0x04, 0x41, 0x10, 0x04, 0x11, 0x00, 0x40, 0x10, 0x14, 0x10, 0x54, + 0x54, 0x11, 0x10, 0x00, 0x01, 0x00, 0x50, 0x14, 0x15, 0x05, 0x45, 0x01, + 0x50, 0x50, 0x44, 0x14, 0x05, 0x00, 0x04, 0x40, 0x20, 0x02, 0x22, 0x02, + 0x22, 0x08, 0x20, 0x20, 0x00, 0x08, 0x20, 0xa8, 0x28, 0x22, 0x08, 0x80, + 0x02, 0x00, 0x88, 0x22, 0xa2, 0x88, 0x28, 0x02, 0x88, 0x80, 0x22, 0xa2, + 0x08, 0x00, 0x08, 0x22, 0x00, 0x04, 0x41, 0x00, 0x04, 0x00, 0x01, 0x40, + 0x00, 0x10, 0x40, 0x04, 0x11, 0x10, 0x04, 0x10, 0x05, 0x00, 0x10, 0x04, + 0x01, 0x55, 0x45, 0x04, 0x10, 0x50, 0x44, 0x15, 0x01, 0x00, 0x14, 0x10, + 0x00, 0x2a, 0xa0, 0x02, 0x2a, 0x20, 0x22, 0x80, 0x02, 0x22, 0x20, 0x02, + 0x0a, 0xa0, 0x02, 0x08, 0x0a, 0x00, 0x20, 0x02, 0x82, 0x80, 0x20, 0x02, + 0x80, 0x88, 0x28, 0x82, 0x00, 0x00, 0xa8, 0x20, 0x00, 0x44, 0x40, 0x01, + 0x14, 0x00, 0x04, 0x00, 0x05, 0x10, 0x40, 0x00, 0x11, 0x10, 0x05, 0x04, + 0x14, 0x00, 0x44, 0x44, 0x01, 0x51, 0x44, 0x04, 0x10, 0x45, 0x14, 0x11, + 0x01, 0x00, 0x50, 0x11, 0x00, 0x82, 0x20, 0x02, 0x22, 0x20, 0x28, 0x20, + 0x08, 0x2a, 0x80, 0x02, 0x02, 0x20, 0x08, 0x00, 0x00, 0x00, 0x28, 0x28, + 0x02, 0x8a, 0x22, 0x02, 0xa0, 0xa8, 0x08, 0x8a, 0x00, 0x00, 0x80, 0x22, + 0x00, 0x04, 0x41, 0x10, 0x04, 0x01, 0x10, 0x00, 0x10, 0x41, 0x40, 0x01, + 0x11, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x51, 0x20, 0x82, 0x20, 0x00, + 0x02, 0x20, 0x28, 0x20, 0x88, 0x20, 0x80, 0x00, 0x82, 0x20, 0x28, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x22, 0x10, 0x04, 0x45, 0x10, 0x04, 0x01, 0x10, 0x40, + 0x04, 0x40, 0x00, 0x00, 0x41, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x41, + 0x8a, 0x0a, 0xaa, 0x8a, 0xaa, 0xa8, 0x20, 0xa0, 0x82, 0xa2, 0x80, 0x80, + 0xaa, 0xa8, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x15, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xaa, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xa8, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, + 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xa0, 0xa2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x2a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x10, 0x50, + 0x41, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x15, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0xa0, 0x80, 0x02, 0xa8, 0x28, + 0x0a, 0xa0, 0x02, 0xa8, 0x00, 0x8a, 0x02, 0x28, 0x00, 0x00, 0x00, 0x0a, + 0x28, 0x80, 0x2a, 0x80, 0x22, 0x80, 0x0a, 0x00, 0xa8, 0x00, 0x28, 0x2a, + 0x00, 0x05, 0x00, 0x50, 0x00, 0x00, 0x55, 0x51, 0x14, 0x14, 0x54, 0x54, + 0x01, 0x54, 0x01, 0x50, 0x50, 0x05, 0x00, 0x05, 0x00, 0x50, 0x55, 0x40, + 0x51, 0x50, 0x15, 0x00, 0x54, 0x05, 0x14, 0x55, 0x00, 0x0a, 0x00, 0xa0, + 0x00, 0x80, 0xaa, 0x2a, 0x2a, 0x08, 0x2a, 0xa8, 0x02, 0xaa, 0x02, 0xa0, + 0xa0, 0x02, 0x00, 0x0a, 0x00, 0xa8, 0xaa, 0x80, 0x2a, 0xa8, 0x2a, 0x80, + 0xaa, 0x0a, 0xa8, 0xaa, 0x01, 0x05, 0x00, 0x50, 0x05, 0x40, 0x55, 0x55, + 0x14, 0x00, 0x14, 0x50, 0x05, 0x54, 0x01, 0x40, 0x51, 0x01, 0x00, 0x55, + 0x00, 0x54, 0x55, 0x41, 0x15, 0x54, 0x55, 0x40, 0x55, 0x15, 0x54, 0x55, + 0x02, 0x0a, 0x00, 0xa0, 0x0a, 0xa0, 0x02, 0x2a, 0x2a, 0x00, 0x0a, 0x88, + 0x0a, 0x2a, 0x00, 0x80, 0xaa, 0x00, 0x00, 0xaa, 0x00, 0xaa, 0xa0, 0xa2, + 0x0a, 0x2a, 0xa8, 0xa0, 0x0a, 0x0a, 0xaa, 0xa0, 0x01, 0x14, 0x01, 0x40, + 0x55, 0x50, 0x01, 0x14, 0x14, 0x00, 0x05, 0x04, 0x15, 0x15, 0x00, 0x00, + 0x51, 0x00, 0x00, 0x54, 0x05, 0x14, 0x40, 0x45, 0x05, 0x15, 0x50, 0x41, + 0x01, 0x14, 0x54, 0x40, 0x02, 0xa8, 0x00, 0x80, 0xaa, 0xa8, 0x00, 0x2a, + 0x28, 0x88, 0x02, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, + 0x0a, 0x0a, 0xa0, 0xa2, 0x82, 0x0a, 0xa0, 0xa0, 0x00, 0x28, 0x2a, 0xa0, + 0x01, 0x50, 0x00, 0x00, 0x55, 0x50, 0x00, 0x14, 0x54, 0x54, 0x05, 0x15, + 0x14, 0x15, 0x00, 0x00, 0x11, 0x00, 0x00, 0x50, 0x05, 0x15, 0x00, 0x40, + 0x01, 0x05, 0x40, 0x51, 0x00, 0x14, 0x14, 0x40, 0x00, 0xa8, 0x00, 0x00, + 0xa8, 0x28, 0x00, 0x28, 0x28, 0xa8, 0x02, 0x80, 0x0a, 0x0a, 0x00, 0x80, + 0x08, 0x00, 0x00, 0x80, 0x8a, 0x0a, 0x00, 0xa0, 0x80, 0xaa, 0xaa, 0xa8, + 0xaa, 0x2a, 0x0a, 0xa0, 0x01, 0x44, 0x01, 0x00, 0x50, 0x55, 0x00, 0x14, + 0x50, 0x14, 0x01, 0x00, 0x15, 0x05, 0x00, 0x40, 0x15, 0x00, 0x00, 0x00, + 0x15, 0x05, 0x00, 0x50, 0x41, 0x55, 0x55, 0x51, 0x55, 0x15, 0x15, 0x40, + 0x00, 0x80, 0x02, 0x00, 0xa0, 0x28, 0x00, 0x0a, 0x28, 0x0a, 0x02, 0x00, + 0x8a, 0x0a, 0x00, 0xa0, 0x2a, 0x00, 0x00, 0x00, 0x8a, 0x0a, 0x00, 0xa0, + 0x80, 0xaa, 0xaa, 0xa8, 0xaa, 0x2a, 0x0a, 0xa0, 0x01, 0x40, 0x01, 0x00, + 0x50, 0x55, 0x00, 0x14, 0x50, 0x05, 0x00, 0x00, 0x14, 0x05, 0x00, 0x50, + 0x50, 0x00, 0x00, 0x00, 0x15, 0x05, 0x00, 0x50, 0x40, 0x55, 0x55, 0x51, + 0x55, 0x15, 0x05, 0x50, 0x00, 0x80, 0x02, 0x2a, 0xa8, 0x28, 0x00, 0x0a, + 0xa8, 0x0a, 0x80, 0xaa, 0x82, 0x02, 0x00, 0x20, 0xa0, 0x00, 0xa0, 0x82, + 0x8a, 0x0a, 0x00, 0xa0, 0x80, 0x02, 0x00, 0x28, 0x00, 0x00, 0x0a, 0xa0, + 0x00, 0x00, 0x05, 0x14, 0x50, 0x54, 0x00, 0x15, 0x50, 0x05, 0x40, 0x55, + 0x01, 0x05, 0x00, 0x10, 0x40, 0x01, 0x40, 0x01, 0x05, 0x15, 0x50, 0x51, + 0x40, 0x01, 0x00, 0x50, 0x00, 0x00, 0x05, 0x50, 0x00, 0x00, 0x0a, 0x2a, + 0xa8, 0xa8, 0x80, 0x0a, 0xa0, 0x02, 0x80, 0x0a, 0x80, 0x02, 0x00, 0x08, + 0x80, 0x02, 0xa0, 0x82, 0x0a, 0x2a, 0xa8, 0xa0, 0x80, 0x02, 0x2a, 0xa8, + 0x80, 0x8a, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x54, 0x55, 0x50, 0x55, 0x05, + 0x50, 0x01, 0x00, 0x00, 0x44, 0x05, 0x00, 0x04, 0x00, 0x05, 0x40, 0x55, + 0x05, 0x54, 0x55, 0x50, 0x00, 0x55, 0x15, 0x50, 0x55, 0x05, 0x05, 0x50, + 0x00, 0x00, 0x00, 0xa8, 0x2a, 0xa0, 0xaa, 0x0a, 0xa0, 0x00, 0x08, 0x00, + 0x8a, 0x02, 0x00, 0x0a, 0x00, 0x00, 0x80, 0xaa, 0x02, 0xaa, 0x2a, 0x28, + 0x80, 0xaa, 0x0a, 0xa0, 0xaa, 0x82, 0x02, 0x28, 0x00, 0x00, 0x00, 0x50, + 0x15, 0x40, 0x55, 0x05, 0x40, 0x01, 0x10, 0x00, 0x55, 0x01, 0x00, 0x05, + 0x00, 0x00, 0x00, 0x55, 0x01, 0x54, 0x15, 0x50, 0x00, 0x55, 0x05, 0x40, + 0x55, 0x01, 0x05, 0x50, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x80, 0x0a, 0x0a, + 0xa0, 0x00, 0x00, 0xa0, 0xaa, 0x02, 0x80, 0x0a, 0x00, 0x00, 0x00, 0x2a, + 0x00, 0xa0, 0x0a, 0x28, 0x00, 0xa8, 0x00, 0x80, 0x2a, 0x80, 0x02, 0x28, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x55, 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0xa0, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x50, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, + 0xaa, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x55, 0x01, 0x50, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, + 0x55, 0x05, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x0a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0xaa, 0x8a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x45, 0x05, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0xa0, 0x22, 0xa8, 0x0a, 0xa8, 0x00, + 0xa8, 0xa0, 0x28, 0x80, 0xaa, 0x22, 0x28, 0xa0, 0x02, 0x2a, 0x2a, 0xa0, + 0x02, 0x8a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x15, 0x50, 0x15, 0x54, 0x15, 0x54, 0x01, 0x55, 0x41, 0x55, 0x00, + 0x55, 0x11, 0x54, 0x50, 0x05, 0x54, 0x54, 0x54, 0x05, 0x54, 0x05, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x08, 0x08, + 0x20, 0x08, 0x02, 0x82, 0x82, 0x82, 0x82, 0x00, 0xaa, 0x08, 0x20, 0x20, + 0x08, 0x08, 0x08, 0x0a, 0x0a, 0x28, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x50, 0x10, 0x04, 0x10, 0x10, 0x00, 0x01, 0x04, + 0x01, 0x01, 0x01, 0x01, 0x54, 0x14, 0x11, 0x00, 0x10, 0x10, 0x04, 0x04, + 0x04, 0x10, 0x00, 0x14, 0x51, 0x10, 0x44, 0x01, 0x50, 0x44, 0x44, 0x14, + 0xa0, 0x00, 0x02, 0x08, 0x08, 0x80, 0x00, 0x82, 0x00, 0x82, 0x80, 0x00, + 0xa8, 0x28, 0x00, 0xa0, 0x0a, 0x20, 0x08, 0x02, 0x08, 0x08, 0x00, 0x00, + 0x20, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x05, 0x04, 0x00, + 0x10, 0x00, 0x55, 0x45, 0x55, 0x41, 0x40, 0x00, 0x54, 0x54, 0x00, 0x50, + 0x05, 0x10, 0x04, 0x55, 0x05, 0x04, 0x00, 0x44, 0x10, 0x14, 0x45, 0x04, + 0x10, 0x54, 0x54, 0x04, 0x00, 0x0a, 0x02, 0x00, 0x08, 0x80, 0xaa, 0x82, + 0xaa, 0x82, 0x80, 0x00, 0x2a, 0xaa, 0x00, 0x08, 0x08, 0x20, 0x02, 0xaa, + 0x0a, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x10, 0x14, 0x04, 0x00, 0x04, 0x00, 0x01, 0x40, 0x00, 0x40, 0x40, 0x00, + 0x15, 0x45, 0x15, 0x04, 0x04, 0x10, 0x01, 0x01, 0x00, 0x04, 0x00, 0x05, + 0x15, 0x10, 0x44, 0x04, 0x14, 0x14, 0x41, 0x04, 0x08, 0x08, 0x0a, 0x08, + 0x08, 0x80, 0x02, 0x82, 0x80, 0x20, 0x20, 0x80, 0x8a, 0x8a, 0x22, 0x02, + 0x02, 0xa0, 0x00, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x54, 0x05, 0x54, 0x15, 0x55, 0x01, 0x55, 0x01, + 0x55, 0x51, 0x51, 0x01, 0x45, 0x05, 0x00, 0x54, 0x15, 0x40, 0x00, 0x54, + 0x45, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa8, 0x02, 0xa8, 0x82, 0xaa, 0x00, 0xaa, 0x00, 0x2a, 0xa8, 0xa8, 0x80, + 0x82, 0x22, 0x20, 0xa8, 0x0a, 0x20, 0x00, 0xa8, 0x80, 0xaa, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x55, 0x55, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, + 0x05, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xa0, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, + 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x15, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0xa8, 0xaa, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, + 0x2a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x54, 0x00, 0x54, 0x55, 0x01, 0x00, 0x40, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, + 0x00, 0xa8, 0xaa, 0x02, 0x00, 0x80, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x50, 0x55, 0x05, + 0x00, 0x00, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x54, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0x0a, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x0a, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x02, 0x20, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, + 0x00, 0x40, 0x55, 0x15, 0x00, 0x00, 0x14, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x54, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x80, 0xaa, 0x2a, + 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa8, 0x02, 0x08, 0x00, 0x10, 0x50, 0x50, 0x50, 0x40, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x50, 0x00, + 0x50, 0x00, 0x05, 0x04, 0x01, 0x05, 0x50, 0x40, 0x54, 0x05, 0x04, 0x05, + 0x8a, 0x20, 0x20, 0x88, 0xa0, 0x28, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, + 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x20, 0x00, 0x82, 0x82, 0x08, 0x8a, + 0x82, 0x08, 0x88, 0xa0, 0xa8, 0x0a, 0x22, 0x28, 0x00, 0x41, 0x00, 0x04, + 0x41, 0x44, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x55, 0x55, + 0x00, 0x00, 0x10, 0x00, 0x01, 0x41, 0x10, 0x44, 0x44, 0x10, 0x04, 0x41, + 0x50, 0x15, 0x11, 0x10, 0x80, 0x80, 0x00, 0x02, 0x82, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x80, 0x00, + 0x02, 0x22, 0x20, 0x08, 0x20, 0x20, 0x02, 0x22, 0xa0, 0x2a, 0x22, 0x20, + 0x00, 0x41, 0x10, 0x01, 0x44, 0x00, 0x00, 0x40, 0x41, 0x51, 0x04, 0x14, + 0x15, 0x00, 0x11, 0x44, 0x50, 0x54, 0x40, 0x01, 0x05, 0x10, 0x00, 0x04, + 0x10, 0x40, 0x01, 0x44, 0x10, 0x15, 0x51, 0x00, 0xa8, 0x80, 0x00, 0xaa, + 0x82, 0x00, 0x00, 0x20, 0x22, 0x8a, 0xa2, 0x22, 0x22, 0x80, 0xa0, 0x88, + 0x88, 0x88, 0x88, 0x02, 0x2a, 0x20, 0x00, 0x08, 0xa0, 0x2a, 0xaa, 0x22, + 0x20, 0x8a, 0xa0, 0x02, 0x04, 0x01, 0x01, 0x01, 0x40, 0x00, 0x00, 0x40, + 0x10, 0x10, 0x41, 0x54, 0x11, 0x00, 0x11, 0x40, 0x54, 0x05, 0x04, 0x05, + 0x50, 0x11, 0x00, 0x04, 0x10, 0x00, 0x01, 0x40, 0x10, 0x45, 0x00, 0x15, + 0x82, 0x80, 0x08, 0x02, 0x80, 0x00, 0x00, 0x00, 0x22, 0x88, 0x02, 0x02, + 0x22, 0x00, 0x82, 0x08, 0x02, 0x08, 0x02, 0x0a, 0x80, 0x22, 0x00, 0x08, + 0x20, 0x00, 0x02, 0x20, 0x20, 0xa2, 0x00, 0x28, 0x01, 0x01, 0x05, 0x01, + 0x40, 0x00, 0x00, 0x40, 0x14, 0x51, 0x41, 0x44, 0x11, 0x40, 0x04, 0x11, + 0x04, 0x05, 0x01, 0x14, 0x00, 0x15, 0x00, 0x04, 0x10, 0x00, 0x01, 0x40, + 0x10, 0x51, 0x01, 0x50, 0x82, 0x00, 0x02, 0x02, 0x80, 0x00, 0x00, 0x80, + 0xa2, 0x88, 0x2a, 0x28, 0x22, 0x80, 0x02, 0x28, 0x8a, 0x88, 0x00, 0x28, + 0x00, 0x22, 0x00, 0x08, 0x20, 0x00, 0x02, 0x20, 0xa0, 0xa8, 0x02, 0x20, + 0x01, 0x05, 0x05, 0x04, 0x44, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, + 0x00, 0x00, 0x40, 0x55, 0x15, 0x00, 0x00, 0x00, 0x01, 0x44, 0x00, 0x04, + 0x40, 0x40, 0x04, 0x44, 0x10, 0x51, 0x15, 0x40, 0x82, 0x00, 0x02, 0x08, + 0x82, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, + 0x2a, 0x00, 0x00, 0x00, 0x02, 0x82, 0x08, 0x08, 0x80, 0x20, 0x08, 0x22, + 0xa0, 0xa0, 0x2a, 0x20, 0x14, 0x01, 0x00, 0x50, 0x50, 0x01, 0x00, 0x00, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, + 0x51, 0x00, 0x05, 0x15, 0x00, 0x05, 0x50, 0x50, 0x50, 0x40, 0x15, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x20, 0x80, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x40, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0x2a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x54, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, + 0x00, 0x00, 0x50, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0xa0, 0x0a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x50, 0x55, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, + 0x00, 0xa0, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xaa, + 0x15, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x10, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x2a, 0x00, 0x00, 0x00, + 0x00, 0xa0, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xaa, 0x15, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, + 0x00, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, + 0xa2, 0x00, 0x80, 0x02, 0x0a, 0xa2, 0x82, 0x02, 0x0a, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0a, 0xa8, 0xa0, 0x80, 0x82, 0xa0, 0x11, 0x01, 0x00, 0x04, + 0x11, 0x50, 0x41, 0x04, 0x11, 0x10, 0x00, 0x14, 0x44, 0x40, 0x00, 0x41, + 0x11, 0x00, 0x14, 0x00, 0x44, 0x05, 0x05, 0x04, 0x45, 0x00, 0x10, 0x44, + 0x11, 0x11, 0x04, 0x44, 0xa2, 0x02, 0x20, 0x80, 0x20, 0x28, 0x20, 0x08, + 0x02, 0x20, 0x80, 0x22, 0xa8, 0xa8, 0xa0, 0x82, 0x28, 0x00, 0x28, 0x80, + 0x22, 0x08, 0x82, 0x0a, 0x22, 0x80, 0x00, 0x82, 0x20, 0x00, 0x88, 0x8a, + 0x51, 0x05, 0x50, 0x00, 0x10, 0x11, 0x11, 0x10, 0x01, 0x50, 0x40, 0x10, + 0x54, 0x04, 0x11, 0x04, 0x41, 0x00, 0x50, 0x40, 0x10, 0x04, 0x44, 0x10, + 0x44, 0x40, 0x01, 0x01, 0x10, 0x10, 0x44, 0x14, 0xa2, 0x00, 0xa0, 0x00, + 0xa8, 0x02, 0xa0, 0x0a, 0x02, 0xa0, 0xa0, 0x00, 0x0a, 0x82, 0x08, 0x82, + 0x20, 0x00, 0xa0, 0x20, 0x20, 0x08, 0x22, 0x08, 0x02, 0x80, 0x02, 0x02, + 0x20, 0xa8, 0x8a, 0x82, 0x51, 0x01, 0x40, 0x01, 0x55, 0x01, 0x10, 0x00, + 0x01, 0x40, 0x41, 0x00, 0x04, 0x54, 0x50, 0x41, 0x40, 0x00, 0x40, 0x10, + 0x10, 0x04, 0x41, 0x05, 0x01, 0x00, 0x05, 0x01, 0x10, 0x10, 0x40, 0x50, + 0xa2, 0x08, 0x80, 0x82, 0xa0, 0x8a, 0x20, 0x00, 0x02, 0x80, 0x22, 0x00, + 0x02, 0x0a, 0x28, 0x80, 0x20, 0x00, 0x80, 0x20, 0x08, 0x88, 0xa0, 0x00, + 0x02, 0x00, 0x0a, 0x02, 0x20, 0x08, 0x80, 0xa0, 0x51, 0x01, 0x00, 0x44, + 0x50, 0x11, 0x10, 0x00, 0x01, 0x00, 0x11, 0x00, 0x01, 0x01, 0x04, 0x40, + 0x10, 0x00, 0x40, 0x11, 0x10, 0x10, 0x11, 0x00, 0x01, 0x00, 0x10, 0x01, + 0x10, 0x10, 0x40, 0x50, 0xa2, 0x08, 0x00, 0x88, 0x80, 0x08, 0x20, 0x00, + 0x02, 0x02, 0x22, 0x00, 0x02, 0x02, 0x08, 0x20, 0x20, 0x00, 0x80, 0x08, + 0x08, 0x88, 0x20, 0x80, 0x00, 0x00, 0x20, 0x02, 0x20, 0x28, 0x80, 0xa0, + 0x51, 0x11, 0x10, 0x44, 0x40, 0x50, 0x40, 0x10, 0x01, 0x00, 0x11, 0x00, + 0x01, 0x01, 0x04, 0x40, 0x10, 0x00, 0x01, 0x11, 0x04, 0x50, 0x10, 0x00, + 0x01, 0x40, 0x10, 0x04, 0x11, 0x50, 0x00, 0x01, 0xa2, 0x28, 0x20, 0x82, + 0x0a, 0x20, 0xa0, 0x0a, 0x02, 0x02, 0x22, 0x88, 0x00, 0x82, 0x08, 0x22, + 0x08, 0x80, 0x80, 0x28, 0x08, 0x28, 0x20, 0x88, 0x00, 0x80, 0x08, 0xaa, + 0x20, 0xa0, 0x82, 0xaa, 0x41, 0x50, 0x50, 0x01, 0x55, 0x00, 0x00, 0x05, + 0x05, 0x05, 0x51, 0x04, 0x01, 0x45, 0x14, 0x11, 0x50, 0x00, 0x41, 0x50, + 0x04, 0x10, 0x50, 0x44, 0x00, 0x40, 0x05, 0x50, 0x50, 0x40, 0x01, 0x14, + 0xaa, 0xaa, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xa0, 0x82, + 0x00, 0x2a, 0xa8, 0x20, 0x28, 0x80, 0x2a, 0x20, 0x08, 0x08, 0xa0, 0x82, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x55, 0x01, 0x00, + 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0x80, 0x0a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x54, 0x55, 0x01, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x02, 0xa0, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x50, 0x55, 0x05, 0x40, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa0, 0xaa, 0x0a, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x50, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x55, 0x55, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x2a, 0x2a, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x15, 0x15, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xaa, 0x8a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x45, 0x45, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x88, 0xa2, 0x22, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x88, 0x00, 0x00, 0x80, 0xaa, 0x2a, 0x0a, 0x00, 0x0a, 0x08, + 0x02, 0x22, 0xa0, 0x80, 0x08, 0x00, 0xa0, 0x00, 0x20, 0xa0, 0xa0, 0xa0, + 0x41, 0x01, 0x51, 0x45, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, + 0x00, 0x00, 0x55, 0x55, 0x14, 0x00, 0x11, 0x14, 0x05, 0x45, 0x10, 0x41, + 0x11, 0x00, 0x40, 0x01, 0x14, 0x41, 0x40, 0x10, 0x82, 0x28, 0xa2, 0xaa, + 0x80, 0xa2, 0xa2, 0xa0, 0xa8, 0x00, 0x28, 0x28, 0x08, 0xa2, 0x02, 0xaa, + 0xa8, 0x80, 0x20, 0x88, 0x88, 0x0a, 0x08, 0x82, 0x20, 0x00, 0x80, 0x0a, + 0x00, 0x82, 0x00, 0x08, 0x04, 0x51, 0x51, 0x55, 0x45, 0x44, 0x11, 0x11, + 0x11, 0x01, 0x50, 0x44, 0x04, 0x11, 0x05, 0x55, 0x41, 0x41, 0x40, 0x10, + 0x40, 0x55, 0x04, 0x44, 0x40, 0x00, 0x00, 0x14, 0x00, 0x01, 0x01, 0x04, + 0x88, 0xa8, 0xa8, 0x2a, 0x2a, 0x20, 0x08, 0x0a, 0x0a, 0x02, 0xa0, 0x80, + 0x88, 0x08, 0xa2, 0xaa, 0x02, 0x22, 0x00, 0x08, 0xa0, 0x8a, 0x02, 0x88, + 0x20, 0x00, 0x00, 0x20, 0x00, 0x82, 0x20, 0x02, 0x05, 0x55, 0x54, 0x55, + 0x44, 0x40, 0x50, 0x51, 0x11, 0x01, 0x04, 0x51, 0x10, 0x51, 0x41, 0x55, + 0x05, 0x44, 0x00, 0x10, 0x00, 0x50, 0x54, 0x45, 0x40, 0x00, 0x00, 0x40, + 0x50, 0x01, 0x01, 0x54, 0x80, 0x2a, 0xaa, 0x0a, 0x28, 0x28, 0x08, 0x08, + 0x08, 0x02, 0x88, 0x88, 0x80, 0x08, 0xa8, 0xaa, 0x0a, 0x28, 0x00, 0x08, + 0xa0, 0x02, 0x02, 0x80, 0x20, 0x00, 0x00, 0x80, 0x08, 0x02, 0x02, 0x02, + 0x00, 0x15, 0x55, 0x15, 0x44, 0x44, 0x10, 0x11, 0x11, 0x01, 0x04, 0x45, + 0x50, 0x10, 0x51, 0x55, 0x15, 0x44, 0x00, 0x10, 0x00, 0x01, 0x04, 0x40, + 0x40, 0x00, 0x00, 0x40, 0x04, 0x01, 0x11, 0x04, 0x80, 0x0a, 0xaa, 0x2a, + 0x82, 0x22, 0xa0, 0xa0, 0x08, 0x02, 0xa8, 0xa8, 0x20, 0xa0, 0xa8, 0xaa, + 0x0a, 0x28, 0x00, 0x08, 0x80, 0x00, 0x02, 0x80, 0x20, 0x00, 0x00, 0x80, + 0x02, 0x02, 0x0a, 0x02, 0x00, 0x04, 0x54, 0x55, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x15, 0x44, 0x00, 0x10, + 0x10, 0x00, 0x04, 0x40, 0x40, 0x00, 0x00, 0x40, 0x04, 0x01, 0x04, 0x04, + 0x08, 0x02, 0xa8, 0xaa, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x80, 0xaa, 0x28, 0x82, 0x00, 0x08, 0xa8, 0x80, 0x08, 0x88, + 0x20, 0x00, 0x20, 0x20, 0x02, 0x0a, 0x0a, 0x08, 0x44, 0x00, 0x50, 0x55, + 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x51, 0x01, 0x11, 0x10, 0x54, 0x41, 0x10, 0x44, 0x40, 0x00, 0x40, 0x10, + 0x04, 0x01, 0x04, 0x10, 0x00, 0x00, 0xa0, 0xaa, 0x0a, 0x00, 0x00, 0x00, + 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0xaa, 0x08, 0x00, 0x0a, 0x2a, + 0x2a, 0x0a, 0xa0, 0xa0, 0xa0, 0x00, 0x20, 0x0a, 0x28, 0x02, 0x00, 0xa0, + 0x50, 0x01, 0x50, 0x55, 0x05, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x54, 0x55, 0x01, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; |